473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

what would the XPATH look like for the node below

KB
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 />
</AppArea>
Nov 12 '05 #1
4 1350
* KB wrote in microsoft.public.dotnet.xml:
Everytime I try to get the xmlnode for the document fragment below
system returns nothing...
What would the xpath be for node <Confirmation> ? 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)


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
for all your XML Namespaces related questions :-)
Nov 12 '05 #2
KB
Thank you... That works.

Bjoern Hoehrmann wrote:
* KB wrote in microsoft.public.dotnet.xml:
Everytime I try to get the xmlnode for the document fragment below
system returns nothing...
What would the xpath be for node <Confirmation> ?


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)

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
for all your XML Namespaces related questions :-)

Nov 12 '05 #3
* KB wrote in microsoft.public.dotnet.xml:
Everytime I try to get the xmlnode for the document fragment below
system returns nothing...
What would the xpath be for node <Confirmation> ? 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)


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
for all your XML Namespaces related questions :-)
Nov 12 '05 #4
KB
Thank you... That works.

Bjoern Hoehrmann wrote:
* KB wrote in microsoft.public.dotnet.xml:
Everytime I try to get the xmlnode for the document fragment below
system returns nothing...
What would the xpath be for node <Confirmation> ?


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)

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
for all your XML Namespaces related questions :-)

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: bdinmstig | last post by:
I refined my attempt a little further, and the following code does seem to work, however it has 2 major problems: 1. Very limited support for XPath features Basic paths are supported for...
1
by: kurt hansen | last post by:
hi I thought that this would be easy, but maybe not so much. I want to: pass an xpath expression and a string value to a stylesheet and copy the source xml document, changing the value of...
8
by: Michael Wohlwend | last post by:
Hi, this is my first xpath try and after reading many web-pages that xpath is still not working :-( (btw, it's my own project, not a homework) I have something like that: <root> <one/>
1
by: Brad Hehe | last post by:
I am attempting to use XPath to query for a specific node in the sample XML I've provided below. I'm unsure of the exact XPath syntax, but I believe I need the following query to get the proper...
0
by: KB | last post by:
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:
1
by: Rob | last post by:
Hi, I am moving through an XML document using an XPath Navigator, and I'd like to be able to get the xpath expression for the location of the current node from the root node. Any ideas how to...
2
by: Bob | last post by:
I have sitemap like XML, of which every element has an attribute "url", e.g. <record menu_id="240" name="Countries and States" url="Countries.aspx"> <record2 page_id="54" url="CountriesEdit.aspx"...
10
by: Michael C# | last post by:
OK, here's the deal. I have a small XML file that represents a small database table. I load it into a System.XML.XMLDocument. So far so good. I run an XPath query against it to retrieve all the...
4
by: eric.goforth | last post by:
In an xsl stylesheet, I have <xsl:when test="string-length(//mystuff) &gt; 0"> <xsl:attribute name="someattribute">blahblahblah</xsl:attribute> </xsl:when> In the xml that mystuff is several...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.