question

MaheshMadhusanka-2060 avatar image
0 Votes"
MaheshMadhusanka-2060 asked uzbekadministrator-3307 published

How to Replace a string with xslt version 1.0

Hi Team,

Currently we have faced issue as a the source xml value parsing with the comma (,) inside the value, (ex - 456,00) but we need to parse that value as a 456.00 when we are transform XML stage, According to I'm tried to few ways but still i'm unable to find a exact way to replace comma(,) to dot(.) , For your reference below i have attached sample Source XML and Current Xslt map, Could you please support to sort out this concern.

Input -
<OrderLineNumber>1</OrderLineNumber>
</PackingNoteDetailsRow>
<Sums>
<TotalPieces>240</TotalPieces>
<NetWeight>108,84</NetWeight>
<GrossWeight>123,84</GrossWeight>
<TotalNoOfCartons>10</TotalNoOfCartons>
</Sums>


Current xslt - Its seems this is not related to XSLT 1

<xsl:for-each select="DOCUMENT/PN_CONTENT/PackingNotesRow/Sums/GrossWeight">

<Weight><xsl:value-of select="replace(.,',','.')"/></Weight>

</xsl:for-each>









azure-logic-apps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

YitzhakKhabinsky-0887 avatar image
1 Vote"
YitzhakKhabinsky-0887 answered uzbekadministrator-3307 published

Please try the following:

 <xsl:value-of select="translate(.,',','.')"/>
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

HI @YitzhakKhabinsky-0887

Thank you very much its worked now.

Thanks
Mahesh

1 Vote 1 ·