traktor-nml-utils icon indicating copy to clipboard operation
traktor-nml-utils copied to clipboard

xsdata.exceptions.ParserError: Unknown property NML:INDEXING

Open snw1968 opened this issue 3 years ago • 2 comments

I am getting this issue exactly the same as issue #4 only using the history schema. So I am assuming the same fix needs to be added to the history code as the collection code.

Traceback (most recent call last): File "x.py", line 91, in history = TraktorHistory(path=Path(f)) File "/usr/local/lib/python3.8/site-packages/traktor_nml_utils/init.py", line 50, in init self.nml: HistoryNml = self.parser.from_path(path, HistoryNml) File "/usr/local/lib/python3.8/site-packages/xsdata/formats/bindings.py", line 21, in from_path return self.parse(str(path.resolve()), clazz) File "/usr/local/lib/python3.8/site-packages/xsdata/formats/dataclass/parsers/nodes.py", line 432, in parse result = handler.parse(source) File "/usr/local/lib/python3.8/site-packages/xsdata/formats/dataclass/parsers/handlers/lxml.py", line 46, in parse return self.process_context(ctx) File "/usr/local/lib/python3.8/site-packages/xsdata/formats/dataclass/parsers/handlers/lxml.py", line 53, in process_context self.parser.start( File "/usr/local/lib/python3.8/site-packages/xsdata/formats/dataclass/parsers/xml.py", line 57, in start super().start(clazz, queue, objects, qname, attrs, ns_map) File "/usr/local/lib/python3.8/site-packages/xsdata/formats/dataclass/parsers/nodes.py", line 464, in start child = item.child(qname, attrs, ns_map, len(objects)) File "/usr/local/lib/python3.8/site-packages/xsdata/formats/dataclass/parsers/nodes.py", line 105, in child raise ParserError(f"Unknown property {self.meta.qname}:{qname}") xsdata.exceptions.ParserError: Unknown property NML:INDEXING

I'm using traktor 3.4.1 and python 3.8

snw1968 avatar Aug 06 '21 15:08 snw1968

It may take some days until I'll manage to fix this, until then you could have a look at the commit https://github.com/wolkenarchitekt/traktor-nml-utils/commit/febe58a47eaedbef1c1d20d327f1c4d9247c0ae3 (and create a PR) that could be adapted in the same way for history-files

wolkenarchitekt avatar Aug 14 '21 16:08 wolkenarchitekt

Sorry for the delay, I finally found the time to have a look at this library again.

Looking at all the errors that might occur due to the complex process approach of XML->XSD->Python conversion, I feel like this library is quite brittle and can break often, like with smartlists, and whatever else NML-XML-property that it doesn't consider.

Nowadays I'd probably just stick to use plain lxml to process NML-files, though that means lots of manual work and code-duplication (and harder to get type hints in a nice way).

Maybe I'll put this library into (non)-maintenance work somewhen soon.

Feel free to take over maintenance (at least within your fork) if you want and if you are brave enough ;-)

wolkenarchitekt avatar Oct 29 '21 20:10 wolkenarchitekt