revXMLTree can't find the node it just provided?

BT keith.clarke at btinternet.com
Tue Mar 16 09:00:36 EDT 2021


Hi folks,
Please can anyone explain what I’m doing wrong here - it seems the revXML library can’t finding the node it has just identified…

1. Create an XML tree to represent some HTML... put revXMLCreateTree(tHTML, false, true, false) into tTreeId
2. Isolate the section of interest by building an XPath to find it by its id… put "//*[@id=" & quote & “test" & quote & "]" into tXPath
3. Check The library resolves the XPath to find a node… 
    put revXMLEvaluateXPath(tTreeId, tXPath ) into tNode
    put tNode  …returns...  /body/*/*/*/*/*/*[2]/*[2]/*/*/*/*[2]/*/*/*/*/*/*/*[2]/*/*[2]/*[3]/*[5]
5. Retrieve the section of the tree ‘under’ this node… put revXMLTree(tTreeId,tXPath,return,space,false,-1) into field “Test” …returns xmlerr, can’t find the element

Any clues?

Thanks & regards,
Keith



More information about the use-livecode mailing list