AH! OK, sorry for the misread there.
You have 2 options for navigation. One is the use of XPath directly. You
simply need to qualify the namespace bindings using the XmlNamespaceManager.
Assume the following XML Schema. I created by dragging the
Northwind.Customers table onto the design surface of the DataSet designer,
and made a quick edit to create the named customerType complexType instead
of an anonymous type.
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="DataSet1" targetNamespace="http://tempuri.org/DataSet1.xsd"
elementFormDefault="qualified"
attributeFormDefault="qualified" xmlns="http://tempuri.org/DataSet1.xsd"
xmlns:mstns="http://tempuri.org/DataSet1.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:complexType name="customerType">
<xs:sequence>
<xs:element name="CustomerID" type="xs:string" />
<xs:element name="CompanyName" type="xs:string" />
<xs:element name="ContactName" type="xs:string" minOccurs="0" />
<xs:element name="ContactTitle" type="xs:string" minOccurs="0" />
<xs:element name="Address" type="xs:string" minOccurs="0" />
<xs:element name="City" type="xs:string" minOccurs="0" />
<xs:element name="Region" type="xs:string" minOccurs="0" />
<xs:element name="PostalCode" type="xs:string" minOccurs="0" />
<xs:element name="Country" type="xs:string" minOccurs="0" />
<xs:element name="Phone" type="xs:string" minOccurs="0" />
<xs:element name="Fax" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:element name="DataSet1" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Customers" type="mstns:customerType" />
</xs:choice>
</xs:complexType>
<xs:unique name="DataSet1Key1" msdata:PrimaryKey="true">
<xs:selector xpath=".//mstns:Customers" />
<xs:field xpath="mstns:CustomerID" />
</xs:unique>
</xs:element>
</xs:schema>
The XPath to match the "Region" definition in the customerType complexType
looks like:
/xs:schema/xs:complexType[@name='customerType']/xs:sequence/xs:element[@name
='Region']
The other option is to navigate using the Schema Object Model (SOM). The
SOM is represented in the System.Xml.Schema namespace. There is an example
of working with the SOM in the SDK:
http://msdn.microsoft.com/library/en...ClassTopic.asp
--
Kirk Allen Evans
http://blogs.msdn.com/kaevans
-- This posting is provided "AS IS" with no warranties, and confers no
rights.
"David Elliott" <Da**********@BellSouth.net.nospam> wrote in message
news:pv********************************@4ax.com...
Yes. I know.
What I am looking for is how to navigate to the XML Node.
Cheers,
Dave
On Mon, 17 May 2004 19:07:49 -0400, "Kirk Allen Evans [MSFT]"
<ki***@online.microsoft.com> wrote:Are you looking for something like a mapping between the friendly name in
your schema and the actual name in the database? The closest to this
that Iknow of is the SQLXML Annotations.
http://msdn.microsoft.com/library/en...tations_0gqb.a
sp