Skip to content
This repository has been archived by the owner on Apr 29, 2023. It is now read-only.

Binding code optimisation #88

Open
FabriceSalvaire opened this issue Oct 9, 2017 · 1 comment
Open

Binding code optimisation #88

FabriceSalvaire opened this issue Oct 9, 2017 · 1 comment
Milestone

Comments

@FabriceSalvaire
Copy link

I was thinking to a way to generate an "Objectifier" for MusixXML from the XML schema ... I already coded such tools by hand for a simpler XML format.

After googling on the topic, I discovered PyXB.

I was able to generate a binding for this large schema and did a successful test !

I gave a look to the generated code and found theses "cosmetic" issues:

  • schema urls point to the local filesystem, e.g. /home/fabrice/...
  • there are a lot of stuffs like pyxb.binding.basis.complexTypeDefinition, would be faster to make a alias p_FooBar
  • foo._CF_enumeration.addEnumeration lines could be refactored in a for loop
  • would be nice to have an option to remove doc, it shrinks a little bit the binding file
  • some blank lines

To fix this, I coded a script to clean the binding file cf. https://github.com/FabriceSalvaire/Musica/blob/master/Musica/MusicXML/clean-binding

I am just testing PyXB, it looks great. Thanks to develop it !

Can we imagine to use Jinja to generate code for Python, C++ etc. ?

@pabigot
Copy link
Owner

pabigot commented Oct 9, 2017

Thanks for the kudos. PyXB is a mature project with little refactoring likely to happen. I'll leave this open so others interested in your script can find it, but it's unlikely to ever be integrated into PyXB itself.

@pabigot pabigot added this to the When Pigs Fly milestone Oct 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants