cancel
Showing results for 
Search instead for 
Did you mean: 

X-Path functions

Former Member
0 Kudos

I would like to use an xpath function in an assignment block. I have tried the following:

codepoints-to-string(80)

{codepoints-to-string(80)}

Both cause evaluation errors.

What am I doing wrong?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dave,

This can be accomplished via an XSL Transformation, which supports recursive functions.

Regards,

Michael Teti

Former Member
0 Kudos

Thanks for your sample code

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi, David.

codepoints-to-string is a proposed function for the XPath 2.0 specification, which very few of the major XSL/XML parsers and processors support. We use Apache Xalan, which at present, does not support this.

What exactly are you trying to do? I suspect there may be another way.

- Rick

Former Member
0 Kudos

I am trying to convert an ASCII String to its HEX string equivalent and back again (two separate functions)

Example: "HELLO THERE!" => "48454C4C4F20544845524521"

I have it working by performing character by character lookups in a static string of all possible characters then mapping that over positionally with a static string of corresponding hex values.

I was hoping that there might be a way to do this mathematically so that I did not need to maintain the static strings.

Is there a white paper that goes into more detail on XPATH. I do not see too much in the docs.

Former Member
0 Kudos

Hi David,

XPATH is not specific to xMII.

There are a lot of resources on the web regarding XPATH. Start with www.w3schools.com.

Former Member
0 Kudos

Rick -

Is there a document that lists supported versions of XPATH, XML, etc? Are there examples of using XPATH in xMII assignment blocks?

Former Member
0 Kudos

Hi, David.

If you are certain it will only be ASCII codes, one approach might work, otherwise if you think you will need Unicode characters, another might be required.

Will your application be limited to ASCII characters?

- Rick

sufw
Active Participant
0 Kudos

David,

do a search on "xmii xpath" on SDN and you will find info on XPath usage in xMII like the following: https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e339015e-0b01-0010-a4b8-f35ed792...

With regards to supported XPath functions in Xalan, I believe it only fully implements XPath 1.0 at the moment, but I might be wrong on that. A quick Google search should clear that up.