user function XPGetAtt()
Local cXML := ""
Local oXML
oXML := TXMLManager():New()
cXML += '<book isNew="true">' + CRLF
cXML += ' <title>A Clash of Kings</title>' + CRLF
cXML += ' <author>George R. R. Martin</author>' + CRLF
cXML += ' <price>9.99</price>' + CRLF
cXML += ' <origin>US</origin>' + CRLF
cXML += '</book>' + CRLF
if !oXML:Parse( cXML )
conout( "Errors on Parse!" )
return
endif
// Vai exibir "true"
conout( oXML:XPathGetAtt( "/book", "isNew" ) )
// Vai exibir ""
conout( oXML:XPathGetAtt( "/book", "myAtt" ) )
// Vai exibir ""
conout( oXML:XPathGetAtt( "/book/title", "isNew" ) )
// Vai exibir ""
conout( oXML:XPathGetAtt( "/book/title", "myAtt" ) )
return
|