[xsd-users] How to get element type from xsd

Boris Kolpackov boris at codesynthesis.com
Tue Mar 6 02:21:04 EST 2007


Hi Mark,

Mark Lofdahl <mark.lofdahl at bigfoot.com> writes:

> However, I am not getting any PSVI information. When I step through the xsd
> and xerces code in debug, I notice that xsd is calling cloneNode() on the
> passed DOMDocument. I also notice that as nodes are cloned in xerces, it
> does *NOT* copy the fSchemaType member, which is the PSVI information. So
> because the node that is stored in the xsd tree is not the original DOMNode,
> but a copy, it no longer has the PSVI information.

This is a known bug in Xerces-C++ that was fixed for the next version:

http://issues.apache.org/jira/browse/XERCESC-1517


> Do you have any suggestions or workarounds to enable me to get the PSVI
> information?

I see two ways to address this:

1. Apply the fix to Xerces-C++ 2.7.0. Let me know if you need help
   extracting the patch (I have the SVN tree checked out).

2. If (1) is not acceptable, then you can change elements.txx in
   libxsd/xsd/cxx/xml/dom to call

   parser->setFeature(XMLUni::fgXercesDOMHasPSVIInfo, true)

   There are two places: around line 352 and 478. This will work
   because XSD does not make a copy of the DOM documents that it
   creates internally.


hth,
-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/20070306/df55ec76/attachment.pgp


More information about the xsd-users mailing list