Skip to content
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

Generate Julia types from XML schema files #154

Open
kskyten opened this issue Nov 21, 2020 · 5 comments
Open

Generate Julia types from XML schema files #154

kskyten opened this issue Nov 21, 2020 · 5 comments
Labels
enhancement New feature or request feature_request

Comments

@kskyten
Copy link

kskyten commented Nov 21, 2020

It would be extremely useful to generate Julia types from XML schema files automatically. This would make it easy to generate, for example, SVG and MathML. Here is some useful code to handle XSD fschema files in Julia.

@aminya
Copy link
Owner

aminya commented Nov 23, 2020

You can parse any XML file if you declare its structure using @aml macro.

See MusicXML.jl for an example of a library that uses AcuteML:
https://github.com/JuliaMusic/MusicXML.jl

@kskyten
Copy link
Author

kskyten commented Nov 25, 2020

Yes, but you have to define the structure of the XML in Julia first. What I'm looking for is automatically generating this Julia code to parse and generate XML based on it's schema. In MusicXML's case I would take the XML schema from here: https://www.musicxml.com/for-developers/musicxml-xsd/ and automatically generate the AcuteML code.

MusicXML
XSD provides a stricter definition of the MusicXML 3.1 format than the MusicXML Document Type Definition (DTD).

@aminya aminya added enhancement New feature or request and removed more-information-needed labels Nov 26, 2020
@aminya
Copy link
Owner

aminya commented Nov 26, 2020

@kskyten This seems like a very good idea. However, I am not sure how we should approach this.

It is also related to #93.

@aminya aminya pinned this issue Nov 26, 2020
@el-oso
Copy link

el-oso commented Feb 11, 2021

Hmmm... Actually I would also benefit from this functionality. I have some XML Schemas that are generated by other people and would be great to automatically create readers and writers based on those.

@goretkin
Copy link

goretkin commented Feb 11, 2021

What would the different types enable you to do, as opposed to using a Dict or NamedTuple or another single type?

Note for example that Julia's own AST representation for its syntax uses (for non-leaf nodes) the same type Expr.
Or another example: https://github.com/yurivish/Hyperscript.jl/blob/c780f6dcd95fbf8931c7afc00499a8436075ae6c/src/Hyperscript.jl#L79-L84

GitHub
Hyperscript: A lightweight DOM representation for Julia - yurivish/Hyperscript.jl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature_request
Projects
None yet
Development

No branches or pull requests

4 participants