goetas-webservices / xsd2php

Convert XSD into PHP classes and JMS serializer definitions
MIT License
234 stars 88 forks source link

Unable to generate PHP classes from XSD file #143

Open salisou opened 2 years ago

salisou commented 2 years ago

I am using XSD-PHP for the first time . My goal is to convert XSD files to PHP classes using XSD2PHP

The following is the contents of my config.yml file

 xsd2php:
    namespaces:
      "": 'App\Dto\InfoCamereBilanci'
    destinations_php:
      'App\Dto\InfoCamereBilanci': app\Dto\InfoCamereBilanci
    #     'App\Dto\InfoCamereBilanci': soap\src # on Windows

destinations_jms:
  'App\Dto\InfoCamereBilanci': storage\bilanci\metadata
#    'InfoCamereBilanci': soap\metadata # on Windows

#  Uncomment this section if you want to have also symfony/validator metadata to be generated from XSD
#  destinations_validation:
#    'App\Dto\InfoCamereBilanci': validation
#    'App\Dto\InfoCamereBilanci': soap\validation  #  on Windows

aliases: # optional
  "http://www.xbrl.org/2003/instance/":
    union: "MyCustomMappedPHPType"
naming_strategy: short # optional and default
path_generator: psr4 # optional and default
#  known_locations: # optional
#    "http://www.example.org/test/somefile.xsd": somefile.xsd
#  known_namespace_locations: # optional
#    "urn:veloconnect:catalog-1.1": xsd/catalog-1.1.xsd

The error message I am getting in the command prompt is as follows Can't find type named {http://www.w3.org/2001/XMLSchema}#, at line 160 in http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd

Any help would be appreciated thank you.

simocheccoli commented 2 years ago

Hello @goetas and thank you for the immense work you are doing!

Why is this issue marked as a question?

Are we doing something wrong? Should all custom simple types be configured as ad hoc classes?

simocheccoli commented 2 years ago

Hi @goetas, any news about our question?

simocheccoli commented 2 years ago

@goetas hi! can you help us?