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

Mark Lofdahl mark.lofdahl at bigfoot.com
Mon Mar 5 20:06:35 EST 2007


I am trying to use DOM PSVI to get the XML Schema information for the DOM
element and attribute nodes attached to the xsd tree.

- I am using the "keep_dom" flag.
- I am creating the DOMDocument myself and using
"parser->setFeature(XMLUni::fgXercesDOMHasPSVIInfo, true)" so xerces will
create the PSVI structures.
- I am passing the DOMDocument to the main xsd parsing routine for my class.
- I am calling the _node() method to retrieve the DOM node.
- I am then calling getTypeInfo() or getInterface() to retrieve the PSVI
information.

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.

I know xerces is creating the PSVI information, because if I call
doc->getDocumentElement()->getTypeInfo() on my DOMDocument, I get the
correct PSVI information.

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

Thanks,
Mark Lofdahl








More information about the xsd-users mailing list