Overview
Features
Download
Documentation
Community
Add-Ons & Services

XSD - xml schema validation

Discussion of ideas for features and new projects based on POCO.

XSD - xml schema validation

Postby lazalong » 28 Jul 2009, 03:42

Hello

If I am not mistaken poco doesn't have xml scheme validation.

Would an implementation using MIT licensed libxml2 be possible?

In fact libxml support all and more than the expat library.
Wouldn't replacing expat by libxml2 be worthwhile?

libxml - http://xmlsoft.org/
latest release - ftp://xmlsoft.org/libxml2/
Example using libxml from a C/C++ Application - https://collada.org/mediawiki/index.php ... validation
lazalong
 
Posts: 16
Joined: 15 Feb 2008, 08:36
Location: Australia

Re: XSD - xml schema validation

Postby guenter » 28 Jul 2009, 09:58

It should not be too hard to implement an alternative, fully interface compatible XML library based on libxml2. I don't want to generally replace expat with libxml2 though, as expat is fine for (I guess) 90 % of all cases and the overhead of libxml2 over expat is not worth it (given that POCO is often used for embedded stuff where low overhead and low footprint matters a lot).

We have done similar things with other libraries (e.g. NetSSL implemented based on SChannel and MatrixSSL) where we have implemented interface compatible libs on top of alternative backends, and this approach generally works quite well. In the case of XML, I guess about 90 % of the existing XML code can be reused. There's basically just one class that needs to be rewritten for libxml2 - ParserEngine. A few other extensions might be necessary to support the necessary SAX properties and features for validation (and other things libxml2 supports).
guenter
 
Posts: 1107
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: XSD - xml schema validation

Postby lazalong » 28 Jul 2009, 13:56

guenter wrote:...the overhead of libxml2 over expat is not worth it (given that POCO is often used for embedded stuff where low overhead and low footprint matters a lot).

Ok - I thought it would be the reason.

Perhaps the xsd validation could be done as an optional part (USE_LIBXML2_XSD).
Which can be removed if a low footprint is implemented.
lazalong
 
Posts: 16
Joined: 15 Feb 2008, 08:36
Location: Australia


Return to Wishlist

Who is online

Users browsing this forum: No registered users and 1 guest

cron