Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm pretty new to this whole Xpath Xquery thingy. so please forgive this newbie question.
I have a function in a class and I wish to get a specific node from the content by fx and attribute.
My question is: how do you get the xml output from a nodeiterator?
I have a function:
private string GetXmlString() { XPathNodeIterator n = umbraco.library.GetXmlNodeByXPath("//node [@id = 1079]"); return n.Current.InnerXml;}
this always generates the full site document.
How does one go about and get xml in this manner?
best regards Sune Fengel
Hi Fenglez
Try
private string GetXmlString(){ XPathNodeIterator n = umbraco.library.GetXmlNodeByXPath("//node [@id = 1079]"); n.MoveNext(); return n.Current.InnerXml;}
The XPathNodeIterator may still be positioned at the root node.
Cheers,
Chris
sweet :)
thanks for the pointer, works like a charm.
- Sune
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Using XPathNodeIterator to generate xml in Codebehind
I'm pretty new to this whole Xpath Xquery thingy. so please forgive this newbie question.
I have a function in a class and I wish to get a specific node from the content by fx and attribute.
My question is: how do you get the xml output from a nodeiterator?
I have a function:
this always generates the full site document.
How does one go about and get xml in this manner?
best regards Sune Fengel
Hi Fenglez
Try
The XPathNodeIterator may still be positioned at the root node.
Cheers,
Chris
sweet :)
thanks for the pointer, works like a charm.
- Sune
is working on a reply...