Xpath woes

  • 28 July 2023
  • 3 replies

Userlevel 3
Badge +2

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:GetValue >


I’m trying to get the value inside BACrest:return.  Using the XML section of this article as reference.  Also using 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:



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.






Best answer by LMjosephBrett 31 July 2023, 20:57

View original

3 replies

Userlevel 5
Badge +6

Hey @marting 

I wanted to reach out and see if you have reached out to support for this behavior you are seeing?  There may be something we need to get our internal teams to review if there is an issue with parsing XML properly, but to do that we would need you to open up a support ticket. 

As an aside, I did attempt to reproduce the issue you are seeing, and I am able to using a script to hardcode your XML and then attempting to parse it.  However, since you may be doing something different I would still want to take a look at your exact setup.  If you do open a support ticket please do DM me your ticket number so I can take a look!

Userlevel 3
Badge +2

Thanks @LMjosephBrett and sorry about the delayed response.  Ticket created; DM sent.

Userlevel 3
Badge +2

Support was able to get me going on this.  Not sure why but this is the syntax that works:


And, to follow up on my own question, LM has no problem dealing with non-integer (decimal) values.

@LMjosephBrett thanks for your help with getting this solved!