[xsd-users] Handling XML data of unknown type

Boris Kolpackov boris at codesynthesis.com
Mon Sep 4 08:16:29 EDT 2006


Hi Raul,

Raul Huertas <raulh39 at tid.es> writes:

>    We are using version 2.7.0 of Xerces and version 2.2.0 of XSD and have
>    noted that in the file
>        xsd/cxx/xml/dom/elements.txx
>    it is used the Xerces function
>       DOMNode::getLocalName()
>    For example, the line 25 reads:
>         name_ (transcode<C> (e->getLocalName ())),
>    with "e" being a xercesc::DOMElement wich derives from
>    xercesc::DOMNode.
>    The problem is that getLocalName() can return NULL.

Apparently it happens when one creates a namespace-unaware DOM
document. By default XSD always turns namespace support on so
it was never a problem. It also does not seem to be too hard to
make it work for the other case. I've patched the elements.txx
file to first try to use getLocalName and if it returns 0 then
use getTagName for elements and getName for attributes. The
patched version of elements.txx is available here:

http://www.codesynthesis.com/~boris/tmp/xsd-2.2.0-no-namespace-dom-patch.zip
http://www.codesynthesis.com/~boris/tmp/xsd-2.2.0-no-namespace-dom-patch.tar.gz

Can try it and let me know if it works in your case? If it does then I
will forward-port this patch for the next version.

Thanks for investigating and reporting this.

-boris


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060904/a6421aa6/attachment.pgp


More information about the xsd-users mailing list