xpath

Determine the frequency of occurrence in XQuery

Hi, does anybody know a way of determining the number of times in which a particular value occurs in a sequence, with XQuery. Thanks in advance ...

XPATH equality expression value in XAML Errors (С#, WPF)

MSDN says http://msdn.microsoft.com/en-us/library/ms256086.aspx degree[@from != "Harvard"] - All elements where the from attribute is not equal to "Harvard". but when trying to implement this in my xaml code it causes an error because in XAML syntax all the value elements should be placed in quotes, how can i workaround this? <Co...

XPath 1.0 queries on JAXB objects?

JAXB has been great, a real timesaver, but it's still really time consuming to traverse the resulting object trees; almost as bad as working directly with the DOM. Is there a way that I can do XPath 1.0 queries on a JAXBElement, without having to painstakingly marshal the document to and from a DOM model each time? ...

Problem parsing children of a node with HtmlAgilityPack

Hi All, I'm having a problem parsing the input tag children of a form in html. I can parse them from the root using //input[@type] but not as children of a specific node. Here's some code that illustrates the problem: private const string HTML_CONTENT = "<html>" + "<head>" + "<title>Test Page</title>" + ...

Xquery to extract text in html

I am working on extracting text out of html documents and storing in database. I am using webharvest tool for extracting the content. However I kind of stuck at a point. Inside webharvest I use XQuery expression inorder to extract the data. The html document that I am parsing is as follows: <td><a name="hw">HELLOWORLD</a>H...

XML expression to return attribute for a filtered value

I'm trying to write an expression that will return the priority for for a filtered value. So far I've been able to get correct results when filtering for the attribute to return the value, but not the reverse. Any help with this? //Test/FileTypes/FileType[@Priority = '10'] returns person //Test/FileTypes/FileType/@Priority returns the ...

iterating SimpleXml xpath result

I'm using SimpleXMLElement to read xml returned from a remote server. The results are then parsed with xpath like this: $result = <<<XML <DataImport2Result xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.xxx.xxx/Services/DataImport2"&gt; <Number /> <Blocks> ...

Getting values from XML in Android (API Level 3)

I have a string that contains a xml structure and there are two pieces of data in separate tags that I am after. xpath has been added since API level 8, and with me being stuck with API level 3 (old phone for you ;-)) I need a way to get the data. Would using a regular expression commit a huge sin? ;-) The xml isn't that big... Looki...

Selecting nodes depending on sibling node criteria using XSLT

Suppose I have XML like this: <child_metadata> <metadata> <attributes> <metadata_key value="include"/> <metadata_value value="value1"/> </attributes> </metadata> <metadata> <attributes> <metadata_key value="dont_include"/> <metadata_value...

how to Delete parent Node of XML by checking the Value of it in PHP DOM

I have an XML Like below <Row><Cell ss:StyleID="s245"><Data ss:Type="String">ABSOLUTE</Data></Cell> <Cell ><Data ss:Type="String">Yellow</Data></Cell> <Cell ><Data ss:Type="String">Exist</Data></Cell> <Cell ><Data ss:Type="Number">30</Data></Cell> <Cell ss:StyleID="s258"/> </Row> <Row><Cell ss:StyleID="s229"><Data ss:Type="String">PAR...

BizTalk BAM - manually editing BTT XPath to return just the First instance of a Message Payload property?

Hi! We have a preference for using TPE for BAM tracking since it can be deployed independently of our orchestrations. However, at one point in our process, we need to track a message payload property which has a 1:N relationship with the Root XML Element of the message. Despite the 1:N relationship, extracting just the first value of ...

Ruby on Rails: Xpath: Could not retrieve XPath

This is the error I get: NativeException: java.lang.RuntimeException: Could not retrieve XPath >//id[@class='open'//@id='status_open']< on HtmlPage(http://cucumber.test.com/proposals/view-me/edit#)@17325460 (Culerity::CulerityException) This is my Cucumber command Then the "li" tag with the id "status_open" should have the class "ope...

retrieving text in selenium using xpath?

Hi i have this HTML code: <tr class="odd events" style=""> <tr> <a title="Expand to see Actions" class="toggleEvent" name="actions_for_host_1" href="#"></a> <td id="7" colspan="6"> <div> <ul> <li>Low Alarm at 2010/06/25 07:09 ( <span title="2010/06/25 14:09 (UTC)" class="time_helper">Pacific</span> )</li> </...

Better control of for-each in xsl/xpath possible?

Hey Friends I've got another xsl/xpath problem. Sure a beginners problem, but I'm thinking still too "imperative". <!-- XML --> <Module> <WideTeaserElement> <Headline>Bla bla 1</Headline> </WideTeaserElement> <WideTeaserElement> <Headline>Bla bla 2</Headline> </WideTeaserElement> </Module> <!-- XSL --> <!-- ...

Safe $variable binding in Nokogiri

Supposing I want to query for the XPath //*[@id=$href]. How can I tell nokogiri to safely bind a value for the $href variable? This is similar to REXML's XPath.first( node, "//*[@id=$href]", nil, {"href"=>"linktohere"}) ...

XPATH - Extract Data from elements

Following is the data and Select statement to work with : declare @XMLdata xml set @XMLdata = ' <taggroup key="pros" name="Le pour"> <tag isuseradded="false" count="1">Bonne qualité</tag> <tag isuseradded="false" count="1">Correspond à mes attentes</tag> <tag isuseradded="true" count="1">Impeccable</tag> <ta...

xpath query to xpath result of query

for example we have this xml: <body> <a> <b> <c>hello</c> <c>world</c> </b> </a> <a> <b> <c>another hello</c> <c>world</c> </b> </a> </body> by Xpath query we can find all "B"-tags. But then w...

Determine the length of this Node-set?

Javascript for Mozilla: while (result) { alert(result.childNodes[0].nodeValue); //txt=txt+result.childNodes[0].nodeValue+"<br/>"; result=nodes.iterateNext(); } This is intended to return a series of strings from an xml file. When I use the alert line, it alerts as expected with the proper strings in a series. T...

How do I escape an apostrophe in my XPath text query with Perl and Selenium?

I have an XPath query which needs to match some text in a span attribute, as follows: my $perl_query = qq(span[text\(\)='It's a problem']); $sel->click_ok($perl_query); Where the text has no apostrophe there is no problem. I've tried the following instead of 'It's a problem': 'It\'s a problem' 'It&apos\;s a problem' 'It\${apos}s a ...

how to get the nodes with specific element value

Could some one please tell me how do we use the text function in the XPath query. I needed the information for Hillman Library present in the xml http://www.sis.pitt.edu/~arazeez/Librarydata.xml resultNodes = [rssParser nodesForXPath:@"//Library[1]/Hours/TermOrHolidays" error:nil];. for now I used the [1]. But I wanted to use the tex...