Hi, > I would like to create .xsd files, that is XMLSchemas, from python classes. > I am not an expert in lxml and I wonder if lxml is an appropriate tool for > such a > purpose.
Yes, you can certainly apply lxml to create.xsd files, since they are, well, XML. :-) > Could I envisage to use the E factory to create .xsd types? That might indeed be a good idea, you've probably seen the examples for creating a vocabulary (or DSL, if you wish) here: https://lxml.de/tutorial.html#the-e-factory (you may also want to look at https://lxml.de/apidoc/lxml.html.builder.html). While I've never actually done it that'd be what I'd look at first if I needed to create schemas. Another possibility might be using custom element classes (https://lxml.de/element_classes.html) but I think the E-Factory approach is simpler and probably saner. Best, Holger Landesbank Baden-Wuerttemberg Anstalt des oeffentlichen Rechts Hauptsitze: Stuttgart, Karlsruhe, Mannheim, Mainz HRA 12704 Amtsgericht Stuttgart HRA 4356, HRA 104 440 Amtsgericht Mannheim HRA 40687 Amtsgericht Mainz Die LBBW verarbeitet gemaess Erfordernissen der DSGVO Ihre personenbezogenen Daten. Informationen finden Sie unter https://www.lbbw.de/datenschutz. _______________________________________________ lxml - The Python XML Toolkit mailing list -- lxml@python.org To unsubscribe send an email to lxml-le...@python.org https://mail.python.org/mailman3/lists/lxml.python.org/ Member address: arch...@mail-archive.com