Which is faster, libxml2 or Xpath?
So, when it comes to xml, is using libxml or xpath faster? ...
So, when it comes to xml, is using libxml or xpath faster? ...
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...
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...
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? ...
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...
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...
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'...
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...
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. ...
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 ...
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...
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...
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...
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. ...
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</...
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 ...
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...
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...
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...
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/...