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

Mark Lofdahl mark.lofdahl at bigfoot.com
Sat Mar 10 13:25:04 EST 2007


Hi,

I changed elements.txx as described below, but am still having problems. It
appears that XSD is still making a copy of the DOM Document that it creates
internally. Am I missing something?

Thanks,
Mark

-----Original Message-----
From: Boris Kolpackov [mailto:boris at codesynthesis.com] 
Sent: Monday, March 05, 2007 11:21 PM
To: Mark Lofdahl
Cc: xsd-users at codesynthesis.com
Subject: Re: [xsd-users] How to get element type from xsd

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




More information about the xsd-users mailing list