I have an xml payload that looks like this:
<Product>
<ProductId>790982</ReceiptId>
<Qty>78</Qty>
<Product>
<Product>
<ProductId>WS-5678</ReceiptId>
<Qty>34</Qty>
<Product>
I need to transform using xslt and send it to another system. I am using xsl:value-of to extract the values, but after conversion the first ProductId comes out as a number and the second ProductId comes out as a String.
<itemRef> <xsl:value-of select="/ProductId"/> </itemRef>
I want to convert every ProductId to a string. I've seen a fix where we need to add conf in synapse-properties file. But that would convert every Number to String. Is there any way I can do it only for ProductId by checking if its a number or a string? I've tried concat function as below to add double quotes across the number but that doesn't work.
<xsl:variable name="quot">"</xsl:variable>
<xsl:variable name="sku" select="/ProductId"/>
<itemRef> <xsl:value-of select="concat($quot, $sku,$quot)"/> </itemRef>