Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

XML Document mapping structure error

$
0
0

Hi Team,

Currently i have a requirement write a XSLT map for transform one xml format to on another format, According to its seems input xml have special element and i when i tring to write XSLT its getting formatting error, Could you please Support to me to complete that. for your reference here with attached sample input file and Current Xslt and expected Sample output.

Input Sample-:

<value odata.etag="">
<ItemInternalId>2c11af0c-ec99-417d-849d-7db167171abc</ItemInternalId>
<JS_UniqueConsignRef>S14019253333</JS_UniqueConsignRef>
<JS_TransportMode>SEA</JS_TransportMode>
<JS_RS_NKServiceLevel>STD</JS_RS_NKServiceLevel>
<JS_SystemLastEditTimeUtc>2019-12-12T09:58:00Z</JS_SystemLastEditTimeUtc>
<JS_INCO>FOB</JS_INCO>
<JS_PackingMode>FCL</JS_PackingMode>

</value>

Current XSLT- 

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--<xsl:output indent="yes" method="xml" omit-xml-declaration="yes"/> -->
<xsl:output indent="yes" method="xml"/>


<xsl:template match="/">

<value>
    <ItemInternalId><xsl:value-of select="value/ItemInternalId"/></ItemInternalId>
    <JS_UniqueConsignRef><xsl:value-of select="value/JS_UniqueConsignRef"/></JS_UniqueConsignRef>
    <JS_IsForwardRegistered>0</JS_IsForwardRegistered>
    <JS_TransportMode><xsl:value-of select="value/JS_TransportMode"/></JS_TransportMode>

   </value> 
</xsl:template>
</xsl:stylesheet>

Expected Output-

<value odata.etag="">
<ItemInternalId>2c11af0c-ec99-417d-849d-7db167171abc</ItemInternalId>
<JS_UniqueConsignRef>S14019253333</JS_UniqueConsignRef>

 <JS_IsForwardRegistered>0</JS_IsForwardRegistered>

<JS_TransportMode>SEA</JS_TransportMode>
</value> 




Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>