The Chilkat solution (I only need the first item at the moment, so I've not implemented traversal)
Code:
Object oXMLHelper is a cObject
Property Integer phChilkat
Property Integer phCursorObj
Function ChilkatObject Returns Integer
Integer hObj
If ((phChilkat(Self))=0) Begin
Get Create (Refclass(cComChilkatXml)) to hObj
Send CreateComObject to hObj
Set phChilkat to hObj
End
Function_Return (phChilkat (Self))
End_Function
Function CursorObject Returns Integer
Integer hObj
If ((phCursorObj(Self))=0) Begin
Get Create (Refclass(cComChilkatXml)) to hObj
Send CreateComObject to hObj
Set phCursorObj to hObj
End
Function_Return (phCursorObj (Self))
End_Function
Procedure Set XML String sXML
Integer hObj
Boolean isOK
Get ChilkatObject to hObj
Get ComLoadXml of hObj sXML to isOK
If (not(isOK)) Showln "error. could not load xml"
End_Procedure
Function FindFirstSection String sSearch Returns Boolean
Integer hObj
Integer hCursor
Variant vTag
Get ChilkatObject to hObj
Get CursorObject to hCursor
If (IsComObjectCreated(hCursor)) Send ReleaseComObject to hCursor
Move (ComSearchForTag(hObj, (pvComObject(hObj)) ,sSearch)) to vTag
If (IsComObject(vTag)) Begin
Set pvComObject of hCursor to vTag
Function_Return True
End
Function_Return False
End_Function
Function TagValue String sTag Returns String
Integer hObj
Integer hCursor
Get ChilkatObject to hObj
Get CursorObject to hCursor
If (IsComObjectCreated(hCursor)) Begin
Function_Return (ComGetChildContent(hCursor,sTag))
End
If (IsComObjectCreated(hObj)) Begin
Function_Return (ComGetChildContent(hObj,sTag))
End
Function_Return ""
End_Function
End_Object
Set XML of oXMLHelper to (psXML(hObj))
Move (FindFirstSection(oXMLHelper,"records")) to isOK
If (not(IsOK)) Function_Return ""
Move (TagValue(oXMLHelper,"sf:Id")) to sResponse