- List item
I am using an XSLT for formatting all my Decimal type nodes to European format in XML. My XML looks like following
<?xml version="1.0" encoding="utf-16"?>
<Envelope>
<Body>
<getPriceRecommendationResponse>
<status>
<statusCode>Success</statusCode>
</status>
<priceRecommendation>
<tssArticleNumber>Item Number</tssArticleNumber>
<compoundCode>T46N</compoundCode>
<compoundGroupCodeBucket>A</compoundGroupCodeBucket>
<compoundCodeBucket>T46 & others</compoundCodeBucket>
<qualityIndexCode>-</qualityIndexCode>
<qualityIndexBucket>Std Quality</qualityIndexBucket>
<weight>66.0341</weight>
<weightGroupBucket>BT 36.2227 and 73.4214</weightGroupBucket>
<weightIsValidBucket>YES</weightIsValidBucket>
<subGroupCode>PT</subGroupCode>
<subGroupCodeBucket>7:B03</subGroupCodeBucket>
<stockDistinction>MTS</stockDistinction>
<productIdBucket>Item</productIdBucket>
<referencePrice>41.9176</referencePrice>
<averageQuantity>5</averageQuantity>
<quantityAdjustments>0.77</quantityAdjustments>
<highDV>2.05792</highDV>
<averageDV>1.40269</averageDV>
<lowDV>0.95137</lowDV>
<additionalAdjustmentsTotal>1</additionalAdjustmentsTotal>
<highPrice>66.42256189184</highPrice>
<averagePrice>45.27399672488</averagePrice>
<lowPrice>30.70694327624</lowPrice>
</priceRecommendation>
</getPriceRecommendationResponse>
</Body>
</Envelope>
My XSLT looks like following
<?xml-stylesheet type="text/xsl" href="decimalformat.xsl"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://ift.tt/tCZ8VR" xmlns:fo="http://ift.tt/vyPH5E" xmlns:msxml="urn:schemas-microsoft-com:xslt">
<xsl:output method="xml" omit-xml-declaration="yes" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<!-- identity transform -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:decimal-format name="eu" decimal-separator=',' grouping-separator='.' />
<xsl:template match="*[number()=number()]">
<xsl:copy>
<xsl:value-of select="format-number(@*|node(), '#.##0,##########', 'eu')" />
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
But i am getting an error while trying this in my application whereas its working fine in transformation tool. The Error is as follows.
Microsoft Dynamics NAV
A call to System.Xml.Xsl.XslTransform.Load failed with this message: Expression must evaluate to a node-set.
OK
If i exclude the code
<xsl:value-of select="format-number(@*|node(), '#.##0,##########', 'eu')" />
its not giving the error but of no use. i have changed it as
<xsl:value-of select="format-number(., '#.##0,##########', 'eu')" />
also but same error. Please help me. Thanks
No comments:
Post a Comment