I'm trying to parse a .XSD file that's been loaded into a MSXML 4.0 DOM object. I can't seem to come up with an XPath query that will return me any useful nodes.
The xsd is like:
And some of what I've tried this far is:
Returns all gazillion nodes as expected
Returns no nodes, when I'd expect at least one that describes the namespace
Returns no nodes, when I would expect a collection of <xs:element> nodes
Blows up with an error: "Reference to undeclared namespace prefix: 'xs'."
Returns no nodes.
Any ideas?
Plan B would be to parse the XSD file via SAX (messy, but doable).
Chip H.
The xsd is like:
Code:
<xs:schema xmlns:xs="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema"[/URL] elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="RootElement">
<xs:complexType>
<xs:sequence>
<xs:element name="UserElements">
<xs:complexType>
<xs:sequence>
<xs:element name="E_Code">
more child nodes are here
</xs:element>
<xs:element name="E_Value">
more child nodes are here
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element name="RootElement">
</xs:schema>
And some of what I've tried this far is:
Code:
Set objNodeList = objDOM.documentElement.selectNodes("/descendent::*")
Code:
Set objNodeList = objDOM.documentElement.selectNodes("/namespace::*")
Code:
Set objNodeList = objDOM.documentElement.selectNodes("./child::element")
Code:
Set objNodeList = objDOM.documentElement.selectNodes("./child::xs:element")
Code:
Set objNodeList = objDOM.documentElement.selectNodes("./child::xmlns:element")
Any ideas?
Plan B would be to parse the XSD file via SAX (messy, but doable).
Chip H.