3 Replies Latest reply on Jan 17, 2018 3:01 PM by tcoufal RSS
    tcoufal Communicator

    Problem with XML (parsing)

    Hi guys,

    I have problem with parsing the XML get response.

    I have tried every approach which I could find. (here or anywhere else).

    It drives me crazy because it is a very simple XML. Here it is.


    <?xml version="1.0" encoding="utf-8"?>

    <LL control="dev/sps/io/Power/state" value="5.07kW" Code="200"/>


    I am getting the result with GetXML (LoadXML works the same), but when I am trying parse the Value out of it, it always returns empty (as none). I am accessing the value with resultXml.LL.@value. (.@code, .@control -- all empty). I have tried to iterate and push the results  into the array - nothing. XML is not using namespaces. If I use warn.log it is also empty. I have tried different Base types. Nothing. Strange is that if I set the result to XML and use var result = Resources[]..... I can see the result while running service through the REST API, but if I try logger.warn(xmlResult) it is also blank.