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
2
votes
1 answer

Agility Pack Select SingleNode @id contains or @id is like

Is there any functionality in Html Agility Pack SelectSingleNode to let me search similiar IDs? Looking for something like string str = node.SelectSingleNode("//td[@id **contains** 'id_']/span/text()") .InnerText; or string str =…
Add080bbA
  • 1,818
  • 1
  • 18
  • 25
2
votes
1 answer

Reading XML with a colon (:)

I'm trying to get the views of a video from the following XML document (https://gdata.youtube.com/feeds/api/videos?q=example), I'm able to get the link and the autor because there is no colon in the tag. I'm trying to get yt:statistics but I've no…
Joery
  • 759
  • 4
  • 13
  • 33
2
votes
1 answer

MSXML SelectSingleNode returning all values

When running this command: objDoc.SelectSingleNode ("//ProfileSettings/Form[@name='frmViewMailMessages']/Control[@name='subMailMessages']/Height") With objDoc's XML being:
2
votes
1 answer

selectSingleNode using vbscript

Below is the structure of my xml file: I am trying following code to get value of…
Maan Dim
  • 21
  • 1
  • 1
  • 2
2
votes
0 answers

Loading in XML file with Javascript in Internet Explorer 10 not working

I'm loading in an XML file with javascript using the code below. The problem I'm having is with Internet Explorer 10 alone, it's working in every other browser. After some research I'm quite confident it's the fact that IE10 dropped…
2
votes
1 answer

Getting width from html using HtmlAgilityPack

Hey all i have the following HTML:
StealthRT
  • 10,108
  • 40
  • 183
  • 342
2
votes
4 answers

NodeList.SelectSingleNode() syntax

Having problems getting NodeList.SelectSingleNode() to work properly. My XML looks like this:
paparush
  • 1,340
  • 1
  • 17
  • 25
1
vote
4 answers

Null returned when selecting a node in XML document

New to XML. I have a 3rd party webservice that supplies an XML document that I have to update the element values and pass back. The core issue issue is I get an NullReferenceException error when calling the node.RemoveAll() method in the code…
Don
  • 49
  • 3
  • 10
1
vote
1 answer

how to supply stylesheet variable value from html or javascript

My issue is regarding rendering on client that uses xsl. This already works in IE but I want to make it work on firefox First, the stylesheet (variablexsl.xsl) The only thing special here is the existence of
Sekhar
  • 5,614
  • 9
  • 38
  • 44
1
vote
2 answers

SelectSingleNode always returns null when form is deployed to the server

When I deploy an Infopath 2007 form to the SharePoint server, the SelectSingleNode always returns null but always works locally. Here is an example of the following code that is failing: XPathNavigator vendor = payeeDS.SelectSingleNode( …
1
vote
1 answer

XPath string for selecting data types

I have an XML Document that specifies certain data instead data nodes like so: Value I need to be able to look through this document and select the above node. XmlNode node =…
Kyle Uithoven
  • 2,414
  • 5
  • 30
  • 43
1
vote
0 answers

SelectSingleNode vs dot reference

I was under the impression that dot referencing an XML node was the same as SelectSingle node, but there seems to be a difference. Given $xml = [Xml]@" STRING
Gordon
  • 6,257
  • 6
  • 36
  • 89
1
vote
2 answers

Select Single Node of XML with Powershell

I'm struggling reading a XML:
Txitxarro
  • 25
  • 5
1
vote
1 answer

When I use SelectSingleNode Method with my XmlElement It Still Reads the Whole Document and Not Inside My Element

I have a code that reads Xml files and I have an InvoiceLine List that had Invoice lines in it. My question is, when I use SelectSingleNode and search for a spesific cbc:ID tag, it brings me the first cbc:ID tag in the DOCUMENT which is not inside…
Ezgi
  • 23
  • 6
1
vote
1 answer

trying to select a single node from xml file fails

Within a PowerShell script I try to select the second MemberShipRule (for UnixComponentGroup) from this XML file:
1 2
3
8 9