Hi,
I'll use Universe's XDOM functions and I don't understand how to work
with multiple xml nodes within a xPath result.
Into XDOMLocate I can use xPath like /bookstore/book[price<50.00]' ;
it return a nodehandle to the first node which is ok with condition but
when I have many nodes I don't understand how to loop on all nodes....
Any idea, experiences ?
Thanks by advance
Manu
------------------------------------------------------------------
Here is the XML Sample store into &XML& booktore.xml.
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book>
<title lang="fr">Harry Potter</title>
<price>29.99</price>
<type>paper</type>
</book>
<book>
<title lang="eng">Learning XML</title>
<price>39.95</price>
<type>pdf</type>
</book>
<book>
<title lang="fr">Dracula</title>
<price>18.50</price>
<type>paper</type>
</book>
</bookstore>
I try this basic code to extract information.
Status = XDOMOpen('bookstore.xml',XML.FROM.FILE,XDDO)
if Status # XML.SUCCESS then stop
Status = XDOMLocate(XDDO,'/bookstore/book[price<30.00]',"",XBOOKS)
*this must return "2" nodes
Loop
xml = ""
Status = XDOMWrite(XBOOKS,xml,XML.TO.STRING)
CRT "book xml : ":xml
while status = XML.SUCCESS do
Status = XDOM ???? what to get the next node which is ok with the
xpath condition ?
repeat
end
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/