How to Replace a string with xslt version 1.0

asked 2020-08-31T13:10:57.577+00:00
Mahesh Madhusanka 106 Reputation points

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
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
1,804 questions
No comments
{count} votes

Accepted answer
  1. answered 2020-08-31T13:19:41.327+00:00
    Yitzhak Khabinsky 19,846 Reputation points

    Please try the following:

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

0 additional answers

Sort by: Most helpful