Groups | Blog | Home
all groups > dotnet xml > june 2004 >

dotnet xml : what would the XPATH look like for the node below


KB
6/17/2004 5:34:14 PM
Hello,

Everytime I try to get the xmlnode for the document fragment below
system returns nothing...
What would the xpath be for node <Confirmation> ?

Thanks you
KB

code:

Dim xmlnsManager As New System.Xml.XmlNamespaceManager(xmldoc.NameTable)
xmlnsManager.AddNamespace("synch",
"http://www.abc.com/someapp/synch")
xmlnsManager.AddNamespace("app", "http://www.abc.com/someapp")
applicationarea =
xmldoc.SelectSingleNode("/synch:Synchronization/app:AppArea/Sender/Confirmation",
xmlnsManager)

Document
<Synchronization xmlns="http://www.abc.com/someapp/synch">
<AppArea xmlns="http://www.abc.com/someapp">
<DocId>f41e2b57-8740-4481-85e2-e7f8e1f686ce</DocId>
<CreationDateTime>2003-10-29T22:53:56-05:00</CreationDateTime>
<Sender>
<LogicalId>LogicalId</LogicalId>
<Machine>MACHINE</Machine>
<Application>Yahoo </Application>
<Component>Export</Component>
<Task>Import</Task>
<ReferenceId>RefernceID</ReferenceId>
<Confirmation>1</Confirmation>
</Sender>
<Receiver>
<DbId>DB001</DbId>
<OrgCode>Yahoo</OrgCode>
<Operation>SYNCHRONIZATION</Operation>
<ObjectName>SOMEOBJ</ObjectName>
<OnError>Skip</OnError>
<Application>NOTHING</Application>
<Module>MasterSetup</Module>
<Version>1.0</Version>
</Receiver>
<Comments />
KB
6/17/2004 6:21:01 PM
Thank you... That works.

[quoted text, click to view]
Bjoern Hoehrmann
6/17/2004 11:57:06 PM
* KB wrote in microsoft.public.dotnet.xml:
[quoted text, click to view]

The Sender and Confirmation elements are also in the "app" namespace, so

/synch:Synchronization/app:AppArea/app:Sender/app:Confirmation

should work. http://www.rpbourret.com/xml/NamespacesFAQ.htm has answers
AddThis Social Bookmark Button