473,327 Members | 2,007 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,327 software developers and data experts.

Accessing the XML inside an XPathNavigator object

I'm integrating with a customer application, and in their assembly, when I
call a method it returns data to us as an XPathNavigator object. I can
parse the various elements I need out of this object with no problem, but
what I cannot seem to do is get at the actual XML string itself. For
accountability, tracking, auditing, and logging, I need to save the XML as
an XML file in an archive folder, but there doesn't seem to be any way of
getting at the actual XML itself.

Ideas? Suggestions?
Nov 17 '05 #1
2 2869


JSheble wrote:
I'm integrating with a customer application, and in their assembly, when I
call a method it returns data to us as an XPathNavigator object. I can
parse the various elements I need out of this object with no problem, but
what I cannot seem to do is get at the actual XML string itself. For
accountability, tracking, auditing, and logging, I need to save the XML as
an XML file in an archive folder, but there doesn't seem to be any way of
getting at the actual XML itself.


It depends on what kind of XPathNavigator that is, if it is created over
an XmlDocument then you can cast and access the OuterXml (or InnerXml
depending on what you want):

XmlNode node = ((IHasXmlNode)xpathNavigator).GetNode();
// use node.OuterXml here

but if the XPathNavigator was created over an XPathDocument then that
cast is not possible.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 17 '05 #2
Unfortunately I do not know nor control how it was created, the customers
assembly returns it. We've already told them we'd rather get an XmlDocument
object, or even better just the plain XML string itself, but they're
unwilling to change.

I'll try casting it out to see what I end up with... Thanx
"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...


JSheble wrote:
I'm integrating with a customer application, and in their assembly, when
I call a method it returns data to us as an XPathNavigator object. I can
parse the various elements I need out of this object with no problem, but
what I cannot seem to do is get at the actual XML string itself. For
accountability, tracking, auditing, and logging, I need to save the XML
as an XML file in an archive folder, but there doesn't seem to be any way
of getting at the actual XML itself.


It depends on what kind of XPathNavigator that is, if it is created over
an XmlDocument then you can cast and access the OuterXml (or InnerXml
depending on what you want):

XmlNode node = ((IHasXmlNode)xpathNavigator).GetNode();
// use node.OuterXml here

but if the XPathNavigator was created over an XPathDocument then that cast
is not possible.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Nov 17 '05 #3

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

Similar topics

1
by: Craig Pearson | last post by:
Hi My function receives an XPathNavigator object. From here I need to build a DataSet to load into SQL Server (using SQLXML adaptor). Does anyone have an idea on the most efficient way to...
1
by: Bruce Dunwiddie | last post by:
I'm trying to build a couple classes that would allow for writing xsl transforms against data that is not originally xml. I've got an xmlreader implementation that seems to work well. Based on some...
7
by: David Thielen | last post by:
Hi; Is there a way from an XPathNavigator object to get an xpath string that will, when used in a Select(xpath) on the underlying base/root XPathNavigator return the same XPathNavigator? In...
4
by: Andy Fish | last post by:
Hi, I can't figure out for the life of me how to select nodes using a namespace in XpathNavigator. For example: XPathDocument doc = new XPathDocument("file.xml"); XPathNavigator nav =...
2
by: Steve | last post by:
Hi. I have ax xpath expression which returns a true or false. I don't know which method to use from the XPathNavigator object to get the result. There's not a ".SelectValue("xpath expression")...
3
by: Vinayak Kamat | last post by:
Hi, I've an 'Employee' class. In my program this object is manipulated, children (List<T>) added, properties modified etc. Everytime this happens I want to be able to show some relevent html to...
4
by: Daniel | last post by:
Is it possible to use regular expressions inside of an xpath statement executed by System.Xml.XmlDocument.SelectSingleNode() ? string sdoc = "<foo><bar a='1'/><bar a='2'/></foo>";...
3
by: David Thielen | last post by:
Hi; Two questions. I have an XPathNavigator object where it's OuterXml property is "<jan>231</jan>" and I am trying to write an xpath statement that will return the "jan". XPathNavigator nav...
4
by: Bruce Sandeman | last post by:
Hi, Does anyone know how to serialize an XPathNavigator object? I have tried the following but it moans that the xpn does not have a parameterless constructor. XPathNavigator xpn =...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.