Hi,
I,m trying to use the following functions:
substring-after and substring-before (http://www.w3.org/TR/xpath#function-substring-before)
They don't return any value. :( Are they not implemented?
The code that I use is pasted below:
**********test.xml********** <a> <x>sub text</x> </a>
**********main.cpp********** int main () { TiXmlDocument * XDp_doc; TiXmlElement * XEp_main; XDp_doc = new TiXmlDocument; if (! XDp_doc -> LoadFile ("test.xml")) { printf ("Can't find test.xml !\n"); return 99; } XEp_main = XDp_doc -> RootElement (); TIXML_STRING text = TinyXPath::S_xpath_string(XEp_main, "substring-after(//x/text(),'sub')"); printf("\nValue is '%s'", text.c_str() ); delete XDp_doc; return 0; }
**********binary execution**********
Vic@cerbero ~/tinyxpath2 $ ./tinyxpath.exe
Value is '' Vic@cerbero ~/tinyxpath2 $
substring-before and substring-after are not implemented yet.
Log in to post a comment.
Hi,
I,m trying to use the following functions:
substring-after and substring-before (http://www.w3.org/TR/xpath#function-substring-before)
They don't return any value. :( Are they not implemented?
The code that I use is pasted below:
**********test.xml**********
<a>
<x>sub text</x>
</a>
**********main.cpp**********
int main ()
{
TiXmlDocument * XDp_doc;
TiXmlElement * XEp_main;
XDp_doc = new TiXmlDocument;
if (! XDp_doc -> LoadFile ("test.xml"))
{
printf ("Can't find test.xml !\n");
return 99;
}
XEp_main = XDp_doc -> RootElement ();
TIXML_STRING text = TinyXPath::S_xpath_string(XEp_main, "substring-after(//x/text(),'sub')");
printf("\nValue is '%s'", text.c_str() );
delete XDp_doc;
return 0;
}
**********binary execution**********
Vic@cerbero ~/tinyxpath2
$ ./tinyxpath.exe
Value is ''
Vic@cerbero ~/tinyxpath2
$
substring-before and substring-after are not implemented yet.