selectnodes

MSXML Select Nodes Not Working

I am working on an automated testing app, and am currently in the process of writing a function that compares values between two XML files that should be identical, but may not be. Here is a sample of the XML I'm trying to process: <?xml version="1.0" encoding="utf-8"?> <report xmlns="http://www.**.com/**"&gt; <subreport name="RBDRep...

How can I navigate deeper in XML and append data in it

I have loaded XmlDocument into memory and created new XmlElement. Now I am trying to add XmlElement to the path /report/section/hosts but I don't know how. I can add it easily below root node of XML but I cannot figure out how can I navigate deeper level in XML and just append there. In pseudo I am trying to do this: doc.SelectNodes("/...

Basics of XmlNode.SelectNodes?

I'm not sure why this isn't working. I have an XmlNode in a known-format. It is: <[setting-name]> <dictionary> <[block-of-xml-to-process]/> <[block-of-xml-to-process]/> <[block-of-xml-to-process]/> </dictionary> </[setting-name]> I have a reference to the node in a variable called pattern. I want an itera...

Is there a way to select sibling nodes?

For some performance reasons, I am trying to find a way to select only sibling nodes of the selected node. For example, <div id="outer"> <div id="inner1"> </div> <div id="inner2"> </div> <div id="inner3"> </div> <div id="inner4"> </div> </div> If I selected inner1 node, is there a way for me to access its sib...

Getting position of the XML element inside For Each loop

How do I get the position of the XML element in this loop? For Each objNode In objDoc.SelectNodes("//books/book") ??? Next What I want in output would be something like 1 2 3 4 .... ...

Use selectNodes with multiple alternative paths OR combine 2-3 IXMLDOMNODELIST

Hi, Just wondering if anyone would be able to help with the following VBScript script I'm writing: Can I do somthing similar to this: Set obj = something.selectNodes(path1, path2, path3) // Where it will match either of the paths? Or, if not, is there a way I can combine what selectNodes returns (IXMLDOMNodeList)? e.g. Set obj1 = s...

XmlNodeList (why is this empty)

I can't understand why this NodeList is Empty XmlDocument document = new XmlDocument(); document.Load(xmlpath); XmlNodeList nodes = document.SelectNodes("/StructureResponse/rootItem/attributes/Attribute"); Here the XmlFile <?xml version="1.0" encoding="utf-8"?> <StructureResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instan...

How to Extract atom rss

Given an url, if it has any rss nodes, then i am adding to the date base. e.g. For the url link text rssDoc.SelectNodes("rss/channel/item").Count is greater than zero but for the atom url google/atom rssDoc.SelectNodes("rss/channel/item").count is equal to zero. How can i check if the atom rss url has any nodes or not ? have tried fo...

XmlNode.SelectNode with multiple attribute.

One of my nodes inmy xml file is as follows. <LOGIN_ID NAME="Kapil"> <SEARCH_ID>Kapil Koli</SEARCH_ID> <GUID>111</GUID> <FIRST_NAME>Kapil</FIRST_NAME> <LAST_NAME>Koli</LAST_NAME> <EMAIL_ID>[email protected]</EMAIL_ID> <PASSWORD>abc123**</PASSWORD> </LOGIN_ID> The code I am using is - XmlDocument document = ...

SelectNodes and GetElementsByTagName

what are main differences between SelectNodes and GetElementsByTagName. ...

selectSingleNode works but not selectNodes

Javascript: var req=xmlDoc.responseXML.selectSingleNode("//title"); alert(req.text); as expected, returns the text of the first "title" node. but this var req=xmlDoc.responseXML.selectNodes("//title"); alert(req.text); returns "undefined." The following: var req=xmlDoc.responseXML.selectNodes("//title").length; alert(req); ret...

Adding OR clause in Node selection criteria - HTMLAgility

Can I put OR clause in node selection using HTMLAgility (HtmlAgilityPack.HtmlNodeCollection)doc.DocumentNode.SelectNodes("//td[@class=\"roomPrice figure\"]"); What I need is some times it should be like SelectNodes("//td[@class=\"roomPrice figure\"]"); and some times it is like SelectNodes("//td[@class=\"roomPrice figure bb\"]"); I ...

Modifying Existing XML Content in C#

Hello I found some examples about this subject. Some of the examples gived a method to modify attribute with SelectNodes() or SelectSingleNode(), and others gived the method to modify attribute with someElement.SetAttribute("attribute-name", "new value"); But I still confused that how to build the relation if I only used a XpathNodeItt...

User selects nodes for a custom view (DRUPAL)

Hi, all, I hope you can either help me, or direct me the the easy-to-find-in-retrospect answer which is already out there. I have had two drupal RFPs in the past month where the admins maintains content, but wants users to be able to mark nodes for viewing later in their own custom view. in both cases, the user should be logged in, and...

How to select all leaf nodes using XPath expression?

I believe it's possible but couldn't figure out the syntax. Something like this: xmlNode.SelectNodes("//*[count(child::*) <= 1]") but this is not correct. ...