xpathengines

Which is faster, libxml2 or Xpath?

So, when it comes to xml, is using libxml or xpath faster? ...

XPath problem, getting "expression must evaluate to a node-set." error..

I'm having trouble retrieving a single node by its explicit XPath that I have already found by other ways. I have node and I can get its XPath, but when I try to retrieve that same node again this time via node.XPath it gives the "expression must evaluate to a node-set" error. Shouldn't this work? I'm using HtmlAgilityPack in C# btw f...

Regarding XPath

When i am checking an XPath of a link, it appears to be: id('content')/x:table/x:tbody/x:tr/x:td[2]/x:table/x:tbody/x:tr[2]/x:td[1]/x:table/x:tbody/x:tr[2]/x:td/x:table/x:tbody/x:tr[2]/x:td/x:table/x:tbody/x:tr[1]/x:td/x:table/x:tbody/x:tr/x:td/x:table/x:tbody/x:tr[2]/x:td/x:table/x:tbody/x:tr/x:td[4]/x:a[2] How can I use it in in tar...

Convert XPathDocument to string

I have an XPathDocument and would like to export it in a string that contains the document as XML representation. What is easiest way of doing so? ...

xPath Evaluate vs XPathNodeIterator

I am searching the fastest way to count some tags in a huge xml-file (120MB) long Quantity; XPathDocument xDocData = new XPathDocument(str_File_path); XPathNavigator xNavData = xDocData.CreateNavigator(); //Option 1 XPathExpression xExp = xNavData.Compile("sum(Tag/Value)"); Quantity = Convert.ToInt64(xNavData.Evaluate(xExp)); //Option...

Problems with hyphen in Jackrabbit XPath query

Firstly, let me just say that I'm very new to JSR-170 and Jackrabbit/Lucene in general. I have the following XPath query: //*[@sling:resourceType="users/user-profile" and jcr:contains(*/*/*,'sophie\-a')] order by @jcr:score descending I have a user named Sophie-Allen and a user named Sophie-Anne. Searching using the above query retu...

xpath with dom document

I'm trying the find a xml node with xpath query. but i cannot make it working. In firefox result is always "undefined" and chrome throws a error code. <script type="text/javascript"> var xmlString = '<form><name>test</name></form>'; var doc = new DOMParser().parseFromString(xmlString,'text/xml'); var result = doc.evaluate('/form/name'...

What am I doing wrong with xpath?

test.html <html> <body> <span> hello Joe</span> <span> hello Bob</span> <span> hello Gundam</span> <span> hello Corn</span> </body> </html> PHP file $doc = new DOMDocument(); $doc->loadHTMLFile("test.html"); $xpath = new DOMXPath($doc); $retrieve_data = $xpath->evaluate("//span"); echo $retr...

Is there an Actionscript library that can be used to target Flex components in the display list using an xpath-like syntax?

I feel like I've seen something like this before, but not sure where and searches aren't turning up anything useful. A library like this would evaluate xpath-like string expressions that would resolve to references to actual components (if they exist) in a Flex application's display list tree. ...

dom4j XPath not working parsing xhtml document

I'm trying to use dom4j to parse an xhtml document. If I simply print out the document I can see the entire document so I know it is being loaded correctly. The two divs that I'm trying to select are at the exact same level in the document. html body div table tbody tr td table tbody ...

Selecting nodes based on multiple attributes of a node using MiniXPath library

Hi, I have a XML document which looks something like this: <events> <event category="gymnastics" subcategory="rhythmic" date="5" venue="ig stadium"> <id>1</id> </event> <event category="gymnastics" subcategory="test" date="6" venue="jn stadium"> <id>2</id> </event> <event category="athletics" subcate...

How do I modify node value while iterating with XPathNodeIterator?

I'm navigating XML document with XPathNodeIterator, and I want to change some nodes' values. I can't figure out how :( Here's the code I'm using: XPathDocument docNav = new XPathDocument(path); XPathNavigator nav = docNav.CreateNavigator(); nav.MoveToRoot(); XPathNodeIterator itemsIterator = nav.Select("/foo/bar/item"); while (medium...

How can I bind a component to an XML node dynamically at runtime?

I have a custom component based on mx:ComboBox. Within it I connect to an HTTPService (the url is passed as a paramter) and bind the combobox. Parameters to be sent to the HTTPService are passed to the component. This is working fine. But I want to modify it to make it re-usable with other HTTP service URLs, which return the XML in a dif...

Does GWT and/or SmartGWT provide an implementation of CSS selectors?

I've seen GWT's getElementById, but I'm looking for something a lot more flexible/powerful. I'd prefer CSS selectors, but an XPath interface would do in a pinch. Thanks. ...

avoid error when xpath does not find namespace in xml

Hello everyone, Could someone tell me how to avoid these errors? Testing for existance of namespace? It starts when I want to add geo information to an array I thought it was enough to do this. (from the picasa api feed) foreach($feed->xpath('//gml:pos') as $pos) { $feed_arr['geo'][$i]['pos'] = (string)$pos[0]; $i++; } <b>Warning</...

Using XPathResult

I'm finding little documentation on XPathResult on the mozilla developper site. All functions listed redirect to the main page, so they're probably not documented yet. var myFind; myFind = document.evaluate( '/html/body/table[1]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); I'm looking for a way ...

XPath.evaluate performance slows down (absurdly) over multiple calls

I am trying to use the javax.xml.xpath package to run XPath expressions on a document with multiple namespaces, and I'm having goofy performance problems. My test document is pulled from a real, production example. It is about 600k of xml. The document is a fairly complex Atom feed. I realize that what I'm doing with XPath could be d...

The various versions of Android and XPath support

Hi folks, I am a newbie in the Android world, having limited experience in Java from my varsity days decades ago. These days I am a pampered dev in the .NET world. These days I am a proud owner of an HTC Desire and decided to try my hand at Android dev. Now I have struck a bit of a dilemma. I am writing an app which heavily uses XML ch...

IE9 selectSingleNode missing from beta, how to overcome this in JavaScript?

XMLDocument object in Internet Explorer 9 does not contain definition for selectSingleNode Xpath-based traversal anymore. Of course, I googled a little and came across this thread, where it is unsure is it missing by specification or by the fact it is still "in beta". http://social.msdn.microsoft.com/Forums/en/iewebdevelopment/thread/0...

Using Selenium to determine whether checkboxes with a specific class are checked

I'm using Selenium with PHPUnit to try to tell whether a bunch of checkboxes with a specific class are checked and I'm having a bit of trouble. My code: $count = $this->getXpathCount('//form//input[@type="checkbox" and @class="required"]'); for ($i = 1; $i <= $count; $i++) { $this->assertTrue($this->isChecked(sprintf('xpath=//form/...