[xsd-users] Possible XSD v1.8.0 bugs.
Boris Kolpackov
boris at codesynthesis.com
Tue Jan 31 10:10:15 EST 2006
Ken,
Ken Ng <ken.ng at martoneradiotech.com> writes:
> I found out that it was my fault. I looked at the header file for the
> generated source code for library.xsd and saw that it accepts a
> DOMDocument & object, so I had crafted up a DOMDocument object and tried
> passing it in:
>
> XercesDOMParser parser;
> parser.parse(xml_file);
> auto_ptr<element::type>
> kr(element( *(dynamic_cast<xercesc::DOMDocument
> *>(parser.getDocument()) )) );
>
> Upon inspecting why it didn't work, I found that I could make it work if
> the function call "getLocalName()" in file xsd/cxx/xml/dom/elements.hxx
> was changed to "getNodeName()".
getNodeName returns a name with a namespace prefix while getLocalName
returns an unprefixed name. XML prefixes are syntactic sugar which,
in the code, are resolved to XML namespaces and all the dealings happen
with the namespace-qualified names.
I think your example above failed with getLocalName because your XML
document did not conform to the namespace requirements of the library.xsd
schema.
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/20060131/3325bd42/attachment.pgp
More information about the xsd-users
mailing list