After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 490491 - Add support for xsd to xml translation
Add support for xsd to xml translation
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: xmlschema
2.6.29
Other All
: Normal enhancement
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2007-10-26 12:28 UTC by Callum Gibson
Modified: 2021-07-05 13:25 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
patch implementing the functionality described (11.24 KB, application/gzip)
2007-10-26 12:33 UTC, Callum Gibson
Details
Example code for using schema translation (3.80 KB, application/octet-stream)
2012-06-05 20:42 UTC, Callum Gibson
Details

Description Callum Gibson 2007-10-26 12:28:31 UTC
I'm submitting code to provide functionality for generating a valid xml instance document from an XML schema definition. Although the implementation touches the existing libxml code in only a couple of places, because it uses the schemas internals it sits best within libxml itself.

The code as submitted implements a subset of XML schemas (enough for what I was working on) but hopefully provides a functional prototype if nothing else.
Comment 1 Callum Gibson 2007-10-26 12:33:07 UTC
Created attachment 97913 [details]
patch implementing the functionality described

Unpack in libxml2 source directory. Includes C source and header files, plus a diff (xsdtrans.diff) to apply with patch. The patch was generated against 2.6.28 and applies cleanly against 2.6.29.
Comment 2 Daniel Veillard 2009-08-23 20:16:46 UTC
I looked quickly at it, but I get really worried about the maintainability.
XSD is already horribly complex in practice and a pain to maintain, I don't
see myself adding extra XSD related code to my list.
So I'm a bit reluctant honnestly, and it's unclear how useful that would be,

Daniel
Comment 3 Callum Gibson 2009-08-23 23:01:56 UTC
Up to you, of course. I've seen you comment previously that you weren't keen on the whole XSD thing, and having delved into it I understand your reticence.

As to usefulness, I needed it at work, saw a couple of requests for same in the mail archive and have seen a few requests on the list since. The trouble is you have xmlbeans to do this in java and similar tools exist for C++ and other languages, but there is nothing for pure C. In my opinion, this implementation is even better than xmlbeans, which allows only compile-time binding of the schema to your data. Mine is done at runtime via callbacks so you can dynamically handle changes in schema or data to some extent.

I couldn't see a way to implement it without accessing the internals, hence I submitted it as a patch to libxml2 rather than have it as a standalone contrib, but maybe someone will find the patches useful, even if they aren't applied to the core library.
Comment 4 Daniel Veillard 2009-08-24 14:12:53 UTC
Yeah, I understand your point of view. Maybe this should go into some contrib section or something. Clearly it would be a shame to not share the code,
but on the other hand I don't feel like providing support for it, especially
as a public API ...

Daniel
Comment 5 Callum Gibson 2012-06-05 20:42:40 UTC
Created attachment 215687 [details]
Example code for using schema translation

For completeness, here is example code I made for someone showing how to use the schema translator API.
Comment 6 GNOME Infrastructure Team 2021-07-05 13:25:16 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/libxml2/-/issues/

Thank you for your understanding and your help.