-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Something like CreateFromDocument or JAXBContext.newInstance? #332
Labels
enhancement
New feature or request
Comments
In pyxb you still need to know the module with the generated models right and in jaxb you have to register the types manually beforehand. The jaxb api seems interesting and easy to implement. |
tefra
added a commit
that referenced
this issue
Dec 1, 2020
tefra
added a commit
that referenced
this issue
Dec 2, 2020
tefra
added a commit
that referenced
this issue
Dec 2, 2020
tefra
added a commit
that referenced
this issue
Dec 2, 2020
tefra
added a commit
that referenced
this issue
Dec 2, 2020
tefra
added a commit
that referenced
this issue
Dec 2, 2020
Notes: Its preferable to specify the target class otherwise the xml context will scan all imported modules to find the matching dataclass. The scan result is cached, minimizing performance hit. Closes #332
Thanks, I'll try. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I want to parse XML it seems that I always have to specify the type:
In certain cases that would be overly restrictive. IIRC pyxb generates a method like CreateFromDocument, and e.g. in JAXB you can use a JAXBContext which you can configure with the namespaces to recognise.
Als to xsdata generated classes seem to contains sufficient information. Element-name and namespace of the root element generally is enough to know the type to create.
I may be missing something, but I don't see an easy way to accomplish this.
The text was updated successfully, but these errors were encountered: