How to Replace a string with xslt version 1.0

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

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.
3,542 questions
0 comments No comments
{count} votes

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

    Please try the following:

    <xsl:value-of select="translate(.,',','.')"/>
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.