I need to add a LF to a string using xpath.
I though I could use concat('My string', codepoints-to-string(10),'on a new line')
WM doesn't seem to like the codepoints-to-string xquery.
What could I use as an alternative?
I though I could use concat('My string', codepoints-to-string(10),'on a new line')
WM doesn't seem to like the codepoints-to-string xquery.
What could I use as an alternative?
RE: xquery ascii codepoints-to-string
Unfortunately the +?+?++codepoints-to-string+?+?+? function is an XPath 2/XQuery function so isn+?+?+?t supported by the Xalan library used by WebMaker.
Can you clarify exactly where you are trying to use this XPath to insert the line break? Is this in your page display bindings for output in a text area for example, or is it eg in RuleMaker when interacting with a database/web service.
I+?+?+?m sure we will be able to find a way around this, depending on exactly what you are trying to achieve. :)
Regards,
Gerard
RE: xquery ascii codepoints-to-string
What to pass through a text string which is a concat between two strings. The strings will be split by the ascii(10) value.
I'd like to do it in the xpath/form rather than having to modify a stored procedure that's already in use.
RE: xquery ascii codepoints-to-string
Thanks for the info.
As you are using the XPath in the Rules Design area, I would suggest trying the following type of XPath:
concat('My string', ' ', 'on a new line')
Eg actually add a new line within quotes as a parameter of the concat function.
Although this ends up looking a bit weird, I think it might give you the required value in the DB.
I hope this helps.
Regards,
Gerard
RE: xquery ascii codepoints-to-string
Just tried this and appears to work. I've added a note to the rule for anyone picking up the code later on as to why it looks strange!
Thanks