Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

xsdata.exceptions.ParserError #1096

Closed
amal-khailtash opened this issue Nov 25, 2024 · 5 comments
Closed

xsdata.exceptions.ParserError #1096

amal-khailtash opened this issue Nov 25, 2024 · 5 comments

Comments

@amal-khailtash
Copy link

I am getting this error:

  File ".venv/lib/python3.12/site-packages/xsdata/formats/dataclass/parsers/bases.py", line 95, in start
    child = item.child(qname, attrs, ns_map, len(objects))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv/lib/python3.12/site-packages/xsdata/formats/dataclass/parsers/nodes/element.py", line 469, in child
    raise ParserError(f"Unknown property {self.meta.qname}:{qname}")
xsdata.exceptions.ParserError: Unknown property {http://www.w3.org/2001/XMLSchema}schema:head
make: *** [Makefile:3: gen] Error 1

when running this command:

$ xsdata generate --slots --subscriptable-types --generic-collections --relative-imports --structure-style filenames --package accellera.ipxact.std_1685_2022.ve http://www.accellera.org/XMLSchema/IPXACT/1685-2022-VE-1.0/index.xsd
$ xsdata --version
xsdata, version 24.11
@tefra
Copy link
Owner

tefra commented Dec 1, 2024

This schema
http://accellera.org/XMLSchema/IPXACT/1685-2022-VE-1.0/COND/autoConfigure.xsd

tries to import this

<xs:import schemaLocation="xml.xsd" namespace="http://www.w3.org/XML/1998/namespace"/>

which doesn't exist and the server returns a generic html response, that's why it fails.

Usually vendors are supposed to import he xml namespace like this, or provide the actual file

<xs:import schemaLocation="http://www.w3.org/2001/xml.xsd" namespace="http://www.w3.org/XML/1998/namespace"/>

@amal-khailtash
Copy link
Author

That is awesome! Thank you. I will report back to the vendor. I am also seeing these warnings and I am not sure what causes these:

Compiling schema http://www.accellera.org/XMLSchema/IPXACT/1685-2022/TGI/TGI.wsdl
Builder: 4 main and 0 inner classes
Analyzer input: 4 main and 0 inner classes
Analyzer output: 3 main and 0 inner classes
Generating package: init
Generating package: amal.eda.accellera.ipxact.std_1685_2022.tgi.float_array_type
Generating package: amal.eda.accellera.ipxact.std_1685_2022.tgi.soap_string_array_type
Generating package: amal.eda.accellera.ipxact.std_1685_2022.tgi.integer_array_type
Warnings: 6
warning: Missing extension type: Array
warning: Reset absent type: arrayType
warning: Missing extension type: Array
warning: Reset absent type: arrayType
warning: Missing extension type: Array
warning: Reset absent type: arrayType

They seem to be coming from these. I am not sure what is wrong here:

      <xs:complexType name="floatArrayType">
        <xs:complexContent>
          <xs:restriction base="soapenc:Array">
            <xs:attribute ref="soapenc:arrayType" wsdl:arrayType="xs:float[]"/>
          </xs:restriction>
        </xs:complexContent>
      </xs:complexType>
      <xs:complexType name="soapStringArrayType">
        <xs:complexContent>
          <xs:restriction base="soapenc:Array">
            <xs:attribute ref="soapenc:arrayType" wsdl:arrayType="xs:string[]"/>
          </xs:restriction>
        </xs:complexContent>
      </xs:complexType>
      <xs:complexType name="integerArrayType">
        <xs:complexContent>
          <xs:restriction base="soapenc:Array">
            <xs:attribute ref="soapenc:arrayType" wsdl:arrayType="xs:integer[]"/>
          </xs:restriction>
        </xs:complexContent>
      </xs:complexType>

Where are these extensions need to be defined?

@amal-khailtash
Copy link
Author

It seems none of the WSDL endpoint python classes/functions are generated either for these.

@tefra
Copy link
Owner

tefra commented Dec 2, 2024

Fixed here #1100

Until the next release you can try to install xsdata from the repo

pip install xsdata[cli,lxml] @ git+https://github.com/tefra/xsdata

@amal-khailtash
Copy link
Author

Great! Thank you. Fixed both my issues. Closing...

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants