Replies: 2 comments 1 reply
-
Well, this is an XPath question, not really a topic for small section in the manual (too big to cover). There are good online resources for XPath. For this example: The data: <data>
<tel>1234567890</tel>
</data> <Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
<Record element="data">
<PlaceObject>
<Textblock>
<Paragraph>
<Value select="concat('(', substring(tel, 1, 3), ') ', substring(tel, 4, 3), '-', substring(tel, 7, 4))"></Value>
</Paragraph>
</Textblock>
</PlaceObject>
</Record>
</Layout> renders as (123) 456‐7890 See for example https://developer.mozilla.org/en-US/docs/Web/XML/XPath/Reference/Functions/substring If you have another question, don't hesitate to ask. |
Beta Was this translation helpful? Give feedback.
-
I have to admit that I was too lazy for that and asked deepseek for an answer... ("how can i use XPath to transform a telephone number from a string like '1234567890' to a formatted number like "(123) 456-7890"?") |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Patrick,
Could you publish on the documentation some example about operating on text strings to perform special operation, I do a classic example.
The input for the telephone number is:
<tel>1234567890</tel>
But when is generated looks like:
(123) 456-7890
I couldn't figure out how to break the string, for me the layout would need three input, such as:
('input1') 'input2'-'input3'
Thanks... 🙏
Beta Was this translation helpful? Give feedback.
All reactions