<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:MIM="http://Dallas.Kodak.com/2005/Schema/MIMCORE"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns2="http://www.w3.org/1999/xhtml"
xmlns:hfp="http://www.w3.org/2001/XMLSchema-hasFacetAndProperty"
xmlns:DICOM="http://Dallas.Kodak.com/2005/Schema/DICOM-in-XML"
targetNamespace="http://Dallas.Kodak.com/2005/Schema/MIMCORE"
version="2006Jan6">
<xs:element name="DeliveryJob">
<xs:complexType>
<xs:attribute name="version" type="xs:token" fixed="2006Feb23"
use="required" />
</xs:complexType>
</xs:element>
</xs:schema>
This is the XSD I am trying to navigate through and I am trying to access
the xs:attribute node to get the value of the name attribut. Dickester thanks
for your sample XPath query, do you think //xs:attribute/@name would work?
Thanks for your time and help
MMA
"dickster" wrote:
I'm not fully sure what you mean by traverse.
However, XML Schema is written in xml (intentionally) so you can
certainly evaluate XPath expressions against it:
eg.
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns="http://Dickster.com"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" ="http://Dickster.com">
<xsd:element name="person">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="firstname" type="xsd:string"/>
<xsd:element name="surname" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
e.g.
The XPath expression //xsd:element[@name='surname'] returns the
xsd:element node which has an attribute called 'name' set to
'surname'