I don't understand. Are you requesting the count feature to exist in LibXML? My first example shows it exists already.
There was no NAME in your original question, only SNAME. There's only one SNAME per CLT, so it's not clear what output you want.
| [reply] |
I was not aware of "count(preceding-sibling)" function ,your code just worked fine.
I tried google what are the different option available in LibXML but could not find can u help me on that.
If wanted the output some thing like
VAL1,NAME,0
VAL1,NAME1,0
VAL2,NAME,0
VAL2,NAME1,0
| [reply] |
I was not aware of "count(preceding-sibling)" function ,your code just worked fine. I tried google what are the different option available in LibXML but could not find can u help me on that. If wanted the output some thing like VAL1,NAME,0 VAL1,NAME1,0 VAL2,NAME,0 VAL2,NAME1,0
Forget google, start with the docs, XML::LibXML: This module is an interface to libxml2, providing XML and HTML parsers with DOM, SAX and XMLReader interfaces, a large subset of DOM Layer 3 interface and a XML::XPath-like interface to XPath API of libxml2.
Next the libxml2 docs: Libxml2 includes complete XPath, XPointer and XInclude implementations.
Now my tips
xpather.pl / examples(for tree-xpath and others)/walkthroughs/tutorials ...
This tutorial needs javascript http://zvon.org/comp/r/tut-XPath_1.html Simple online XPath tester
Hi:)
| [reply] |