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

Mark Lofdahl mark.lofdahl at bigfoot.com
Tue Mar 6 20:39:08 EST 2007


Thanks! I'll give that a try.

Would it be possible to add options/flags to XSD to allow the following:
- have xsd call parser->setFeature(XMLUni::fgXercesDOMHasPSVIInfo, true)
- have xsd not create a copy of a DOMDocument that is passed to it

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