Questions tagged [selectsinglenode]

Selects the first Xml Node that matches the XPath expression

.NET
Selects the first XmlNode that matches the XPath expression. Any prefixes found in the XPath expression are resolved using the supplied XmlNamespaceManager.

Namespace:  System.Xml
Assembly:  System.Xml (in System.Xml.dll)

http://msdn.microsoft.com/en-us/library/h0hw012b(v=vs.110).aspx

Java

public abstract java.lang.Object selectSingleNode(java.lang.Object context)
                                           throws JDOMException

Evaluates the wrapped XPath expression and returns the first entry in the list of selected nodes (or atomics). Parameters: context - the node to use as context for evaluating the XPath expression. Returns: the first selected item, which may be of types: Element, Attribute, Text, CDATA, Comment, ProcessingInstruction, Boolean, Double, String, or null if no item was selected. Throws: JDOMException - if the evaluation of the XPath expression on the specified context failed.

http://www.jdom.org/docs/apidocs.1.1/org/jdom/xpath/XPath.html#selectSingleNode(java.lang.Object)

126 questions
0
votes
1 answer

HTMLAgilityPack ChildNodes index works, named node does not

I am parsing an XML API response with HTMLAgilityPack. I am able to select the result items from the API call. Then I loop through the items and want to write the ChildNodes to a table. When I select ChildNodes by saying something like: sItemId =…
Mark Stouffer
  • 97
  • 2
  • 10
0
votes
1 answer

object variable or with block variable not set error for XML selectSingleNode VBA

I'm a bit of a novice (both on this site and coding in general) so please bear with me. I have an XML document that looks like this: -
user3357684
  • 1
  • 1
  • 1
0
votes
1 answer

Get sibling values based on a single node's value from an XML document

I want to loop through these results (right now there are 2, but there may be up to 100 in some cases). When I find a match on a specific value for the countrycode within a node, I want to select the latitude and longitude values from that…
Adam
  • 6,041
  • 36
  • 120
  • 208
0
votes
2 answers

XmlDocument.SelectSingleNode not always working accurately

I am having an interesting issue with C# and selecting xml nodes consistently. Our site is in the process of being upgraded from classic ASP to ASP.NET. In order to make the process smoother for visitors while we upgrade, I implemented a 404…
Jeremy
  • 169
  • 1
  • 2
  • 10
0
votes
1 answer

How Can I Find a Specific Node By Using SelectSingleNode From HtmlAgilityPack

Using the HtmlAgilityPack I am trying to obtain the text "9/30/2013" from a node on this website: http://www.nasdaq.com/symbol/goog/financials?query=income-statement&data=quarterly Here is the HTML from the website
gromit1
  • 577
  • 2
  • 14
  • 36
0
votes
1 answer

HtmlAgilityPack Error: Object reference not set to an instance of an object

I have been using this code for months and it has been working perfectly for me but now I am getting this error: Object reference not set to an instance of an object. at this line of code: Dim Page_Most_Recent_Quarter As Date =…
gromit1
  • 577
  • 2
  • 14
  • 36
0
votes
1 answer

Why does SelectSingleElement work for some queries, but not others?

I have the following snippet of XML (Zimbra SOAP API if anyone cares, but it is not important)
Jason Coyne
  • 6,509
  • 8
  • 40
  • 70
0
votes
2 answers

XML selectsinglenode how i filter tag?

I'm starting to program in C # and i am beginner, so i don't have experience. I want to one day be a professional and started to develop solutions. My program save the information in xml file and then read the same information in same xml. The xml…
Vitor Ferreira
  • 163
  • 1
  • 3
  • 11
0
votes
1 answer

foreach xmlnode selectsinglenode not working correctly in c#

I am trying to create a list where each item in the list contains the name of the package and the location where is it saved. I created a constructor with two variables name and location. Then I created a list consisting of that constructor. I am…
Sahil Gupta
  • 285
  • 2
  • 5
  • 16
0
votes
1 answer

Editing an XML file in C#; SelectSingleNode returns null

I'm trying to find existing content within an XML file and change it by making use of the SelectSingleNode command. However, all I get is a NullReferenceException. Maybe I'm just not getting how the file path works with this particular command, but…
0
votes
2 answers

Selecting XML Node with XPath

I have a xml where i want to select a node from it here is the xml:
Zaki
  • 5,540
  • 7
  • 54
  • 91
0
votes
1 answer

SelectSingleNode, how to write xpath query using string variable?

Hi I have xml file (which is actually msbuild file) that uses different namespace
in His Steps
  • 3,075
  • 6
  • 30
  • 38
0
votes
3 answers

htmlagilitypack strange behaviour when using 2 htmldocument objects

Here is the code: HtmlDocument htmlDoc = new HtmlDocument(); HtmlDocument segment = new HtmlDocument(); htmlDoc.OptionWriteEmptyNodes = true; segment.OptionWriteEmptyNodes = true; …
Alex
  • 127
  • 2
  • 12
0
votes
1 answer

Backslash SelectSingleNode Escape

In Javascript I have an XML DOM. I am trying to select a node within the DOM by using SelectSingleNode. Something like cell.SelectSingleNode(stuff [@attrjunk = 'MATCH']). So what I want to match on has a backslash . What do I replace the MATCH…
Kaos
0
votes
1 answer

I can't find selectSingleNode method in my xml dom - metro style

I want to write a RSS reader in metro style, below is one of functions in my app. function btnOKClick() { var btnOK = document.getElementById("btnOK"); var txtAddress = document.getElementById("rssAddress"); WinJS.xhr({ url:…
James
  • 2,570
  • 7
  • 34
  • 57
1 2 3
8
9