Hey all,
Been trying to figure out why this Xpath syntax is not working and I’m at a point where it seems like it’s an issue specific to LM… hoping someone knows of a fix/workaround.
Abridged XML response that I’m getting from a device we want to monitor:
<?xml version="1.0" ?>
<BACrest:GetValue xmlns:BACrest="urn:BACrestService">
[...]
<BACrest:return>75.034996</BACrest:return>
</BACrest:GetValue >
I’m trying to get the value inside BACrest:return. Using the XML section of this article as reference. Also using freeformatter.com as suggested here to validate my Xpath syntax.
I’ve tried a bunch of various syntax options that all work largely as expected in freeformatter but don’t work in LM: I get either NaN or 0. I have verified that I’m getting the expected XML in the body of the response.
Various syntaxes I’ve tried:
BACrest:GetValue/BACrest:return
/BACrest:GetValue/BACrest:return
/BACrest:GetValue/BACrest:return/text()
number(/BACrest:GetValue/BACrest:return)
string(/BACrest:GetValue/BACrest:return)
...etc.
Then I thought maybe LM needs to have an integer (is that a thing?) so I tried this:
substring-before(/BACrest:GetValue/BACrest:return, '.')
...which returns just 75 in freeformatter.
Ideas?
Thanks!
Best answer by LMjosephBrett
View original