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

'Xslt' must be a valid XML error

$
0
0

Hi Team,

Currently i have requirement to write simple xslt and use it for Development purpose, when i create it there have format invalid issue, Could you please support to correct it, For your reference here with attached input xml and current xslt and expected output.

Input xml- 

  

<?xml version="1.0" encoding="UTF-8"?>
<ns0:utrrada_Order xmlns:ns0="http://utrrada.com/3pl/FMS/XSDLibrary">
<Orders>
   <Order>4202623821</Order>
   <DocType Variant="ZNB">PO</DocType>
   <Action>CHG</Action>

   <SoldTo>
      <ID>1000</ID>
    </SoldTo>

    <ShipTo>
      <ID>9001</ID>
    </ShipTo>

    <GoodsSupplier>
      <ID>0000602110</ID>
      <Name>NONSNOW LTD</Name>
    </GoodsSupplier>

    <Vendor>
      <ID>0000402062</ID>
      <Name>HON</Name>
    </Vendor>

 </Orders>
</ns0:utrrada_Order>

XSLT - :

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://utrrada.com/3pl/FMS/XSDLibrary" exclude-result-prefixes="ns0">
<xsl:output indent="yes" method="xml"/>
<xsl:template match="/">

<UniversalShipment xmlns="http://www.cargowise.com/Schemas/Universal/2011/11" version="1.1">
  <Shipment>
  
    <DataContext>
      <DataTargetCollection>
        <DataTarget>
          <Type>OrderManagerOrder</Type>
  <Key><xsl:value-of select="Orders/Order"/></Key>
  
        </DataTarget>
      </DataTargetCollection>

      <Company>
        <Code>USA</Code>
      </Company>
  
  <EnterpriseID>EXK</EnterpriseID>
      <ServerID>TST</ServerID>  
</DataContext>  

 
  </Shipment>
</UniversalShipment>

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

 expected output-

    <UniversalShipment xmlns="http://www.cargowise.com/Schemas/Universal/2011/11" version="1.1">
  <Shipment>
    <DataContext>
      <DataTargetCollection>
        <DataTarget>
          <Type>OrderManagerOrder</Type>
          <Key>4202623821</Key>
        </DataTarget>
      </DataTargetCollection>

      <Company>
        <Code>USA</Code>
      </Company>
      <EnterpriseID>EXK</EnterpriseID>
 
      <ServerID>TST</ServerID>
    </DataContext>


  </Shipment>
</UniversalShipment>


Viewing all articles
Browse latest Browse all 935

Trending Articles



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