If I parse the following xml:(test.xml)
<D:propstat  xmlns:D="DAV:">
  <D:prop>CMVC</D:prop>
</D:propstat>
 
given the following schema:(dav.xsd)
<xsd:schema targetNamespace="DAV:"
            xmlns:D="DAV:"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            elementFormDefault="qualified"
            attributeFormDefault="qualified">
  <xsd:element name="propstat" type="D:propstatType"/>
  <xsd:complexType name="propstatType">
      <xsd:sequence>
        <xsd:element name="prop" type="xsd:string" maxOccurs="unbounded"/>
      </xsd:sequence>
  </xsd:complexType>
</xsd:schema>
Using the DOMParser:
    DOMParser parser;
    parser.setValidationScheme(DOMParser::Val_Always);
    parser.setDoNamespaces(true);
    parser.setDoSchema(true);
    parser.setExternalSchemaLocation("DAV: dav.xsd");
    parser.parse("test.xml", false);

    DOM_Document doc = parser.getDocument();
 
How are the nodes within this document created? I would have assumed
that the parser will generate a namespace aware DOM
i.e.
calling getNodeName() on any node should yield the qualified name ( with the
prefix).
 
This is *not* the behavior that I'm experiencing - is there an error my
source xml/xsd/cpp? Or is this a known bug in Xerces?
 
BTW, if I use the following DOMParser:
    DOMParser parser;
    parser.parse("test.xml", false);
    DOM_Document doc = parser.getDocument();
 
Calling getNodeName() on any node exhibits the expected behavior...
 
Regards,
 
Keyur Dalal
 

Reply via email to