xpath

Subreport within Subreport

Hi, I need to create a sub-report within a subreport, I'm using xpath as my query language. Any suggestion on how I can create it. To Illustrate it: Line Details -> 1st sub-report Line Detail Info -> 2nd sub-report Each Line Details can have >1 Line Detail Info. Thanks ...

How to parse XML in Bash?

Ideally, what I'd like to be able to do is: cat xhtmlfile.xhtml | getElementViaXPath --path='/html/head/title' | sed -e 's%(^<title>|</title>$)%%g' > titleOfXHTMLPage.txt ...

Using JXPath to Query a List

I have a simple class (for testing purposes) that I am trying to Query against using JXPath. I create a list of various animal objects, and I want to get an Iterator for: All Animals where type='CAT' All Animals where numLegs = 4 Here is the simple class: public class Animal { private UUID uuid; private int numLegs; ...

Increment the date

I am not sure if it is something with xslt or xpath..but how do I increment a date by 1 day? For example, if the date is 2/16/2009 I want the date to become 2/17/2009. ...

Select values from XML field in SQL Server 2008

Just looking at my XML field, my rows look like this: <person><firstName>Jon</firstName><lastName>Johnson</lastName></person> <person><firstName>Kathy</firstName><lastName>Carter</lastName></person> <person><firstName>Bob</firstName><lastName>Burns</lastName></person> Note that these are three rows in my table. I'd like to return a S...

Is there a way to compute an XPath from a known value in a web page ?

As I understand XPath, it is a way to navigate through elements in an XML document. The direction is XPath -> element. How do you go the other way around? That is, compute the XPath from a known element value? For example, how would you find the xpath of the "faq" link in the stackoverflow header ? Language is not that important, I am...

Parse an XML string in MySQL

Hi, all. I have a task of parsing a simple XML-formatted string in a MySQL stored procedure. XML looks like this (testing purposes only): <parent> <child>Example 1</child> <child>Example 2</child> </parent> What I need MySQL to do is to produce a result set one row per match. My stored proc code looks like this: DECLARE xmlD...

Using jQuery XPath selectors

I'm using a simple DOM parser function to catch XPath information of all nodes of a document For example, the HTML is: <div> <div>Everyday People</div> <div>My name is ACE</div> <div>Hello world</div> </div> Parsing the DOM to store the XPath info in the array arr: <script type="text/javascript" src="js/jquery/js/jquery-1.3.2....

getting an absolute path from xpath selectors

Is it possible for an xpath selection to return the absolute path for each node found? for quick example //chapter to return //book[1]/chapter //book[2]/chapter ... Thanks ...

XSL select where element has two attributes

How do I select elements that have two attributes? I can do @name | @area which is "name or area", but how do I do "name and area"? ...

Matching a node based on a sibling's value with XPath

Having a XML document like this: <?xml version="1.0" encoding="UTF-8"?> <records type="array"> <record> <name>svn</name> <record-type>A</record-type> <ttl type="integer">86400</ttl> <zone-id type="integer">69075</zone-id> <aux type="integer">0</aux> <id type="integer">xxx</id> <active>Y</active> <data>...

NamespaceContext and using namespaces with XPath

Resolving an xpath that includes namepsaces in Java appears to require the use of a NamespaceContext object, mapping prefixes to namespace urls and vice versa. But I can find no mechanism for getting a NamespaceContext other than implementing it myself. This seems counter-intuitive. Is there any easy way to acquire a NamespaceContext ...

XPath: find link URL by link text

I have a well formed XHTML page. I want to find the destination URL of a link when I have the text that is linked. Example <a href="http://stackoverflow.com"&gt;programming questions site</a> <a href="http://cnn.com"&gt;news&lt;/a&gt; I want an XPath expression such that if given programming questions site it will give http://stackov...

Self learning regular expression or xpath query?

Hi! Is it possible to write code which generates a regular expression or xpath that parses links based on some html document? What i want is to parse a page for some links. The only thing i know is that the majority of the links on the page is those links. For a simple example, take a google search engine results page, for example th...

Difference between XPATH, XQuery and Xpointer

What is the difference between XPath, Xquery and Xpointer? As far as my knowledge, xquery is extended version of Xpath. I have the basic knowledge of XPath. Is there any feature available in XPAth which is not in XQuery. Yesterday, i heard a new word "Xpointer". I am confused. Which product is used for which purpose. ...

Using SAXON Xpath engine in Java

Hi all. Here is my code : public static void main(String[] args) { // System.setProperty( // "javax.xml.xpath.XPathFactory", // "net.sf.saxon.xpath.XPathFactoryImpl"); String xml="<root><a>#BBB#</a><a>#CCC#</a><b><a>#DDD#</a></b></root>"; try{ JDocument dom = new JDocument(xml); XPathFactory factory = net.sf.saxon.xpath.X...

Query html tag with XPath

I am writing the selenium test. I have a label there "Assign Designer" and the select box followed right after the label. Unfortunetely, select box has the dynamic id and I can not query it by id or any other it's attribute. Can I build the XPath query that returns "First select tag after text 'Assign Designer'"? PS. Selenium supports...

Selenium xpath flow

Hi All, Can anyone tell me what is the exact flow of taking out xpath in Selenium-IDE. After trying alot by putting alerts i m not getting how to take out the exact xpath. Selenium displays the xpath according to xpath:position and some others ways also but i want to add the xpath traversing from html i.e the topmost position.How can i ...

How do I get a NameTable from an XDocument?

How do I get a NameTable from an XDocument? It doesn't seem to have the NameTable property that XmlDocument has. EDIT: Judging by the lack of an answer I'm guessing that I may be missing the point. I am doing XPath queries against an XDocument like this... document.XPathSelectElements("//xx:Name", namespaceManager); It works fine bu...

Can I get html elements with nokogiri?

Hi, I have a doubt about nokogiri, I need to get the HTML elements from a page, and get the xpath for each one. The problem is that I can't realize how to do it with nokogiri. The HTML code is random, because I've to parse several pages, from different websites. ...