i need copy complete xml contains prefix without prefix tried couple of solution using exclude-result-prefixes no success
i used below xslt
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:ns0="http://www.openapplications.org/oagis/9" xmlns:ns2="http://www.openapplications.org/oagis/9/currencycode/54217:2001" xmlns:ns7="http://www.openapplications.org/oagis/9/codelists" xmlns:ns1="http://www.openapplications.org/oagis/9/qualifieddatatypes/1.1" xmlns:ns3="http://www.openapplications.org/oagis/9/languagecode/5639:1988" xmlns:ns4="http://www.openapplications.org/oagis/9/unitcode/66411:2001" xmlns:ns6="http://www.openapplications.org/oagis/9/ianamimemediatypes:2003" xmlns:ns5="http://www.openapplications.org/oagis/9/unqualifieddatatypes/1.1" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" exclude-result-prefixes="ns0"> <xsl:template match="*" mode="copy"> <xsl:element name="{name()}" namespace="{namespace-uri()}"> <xsl:apply-templates select="@*|node()" mode="copy" /> </xsl:element> </xsl:template> <xsl:template match="@*|text()|comment()" mode="copy"> <xsl:copy/> </xsl:template> </xsl:stylesheet>
and source
<?xml version="1.0" encoding="utf-8"?> <ns0:acknowledgepurchaseorder releaseid="" systemenvironmentcode="production" languagecode="en-us" xmlns:ns0="http://www.openapplications.org/oagis/9" xmlns:ns2="http://www.openapplications.org/oagis/9/currencycode/54217:2001" xmlns:ns7="http://www.openapplications.org/oagis/9/codelists" xmlns:ns1="http://www.openapplications.org/oagis/9/qualifieddatatypes/1.1" xmlns:ns3="http://www.openapplications.org/oagis/9/languagecode/5639:1988" xmlns:ns4="http://www.openapplications.org/oagis/9/unitcode/66411:2001" xmlns:ns6="http://www.openapplications.org/oagis/9/ianamimemediatypes:2003" xmlns:ns5="http://www.openapplications.org/oagis/9/unqualifieddatatypes/1.1" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <ns0:applicationarea> <ns0:sender> <ns0:logicalid>sec</ns0:logicalid> </ns0:sender> <ns0:creationdatetime>2016-06-15</ns0:creationdatetime> </ns0:applicationarea> <ns0:dataarea> <ns0:acknowledge> <ns0:responsecriteria> <ns0:responseexpression actioncode="update"/> </ns0:responsecriteria> </ns0:acknowledge> <ns0:purchaseorder> <ns0:purchaseorderheader> <ns0:documentid xsi:type="ns0:itemidtype"> <ns0:id>6286952</ns0:id> </ns0:documentid> <ns0:attachment inline="false"/> <ns0:customerparty> <ns0:partyids> <ns0:id>692627</ns0:id> </ns0:partyids> </ns0:customerparty> <ns0:supplierparty> <ns0:partyids> <ns0:id>sec</ns0:id> </ns0:partyids> </ns0:supplierparty> </ns0:purchaseorderheader> <ns0:purchaseorderline> <ns0:linenumber>1</ns0:linenumber> <ns0:documentreference type="purchaseorder"> <ns0:documentid xsi:type="ns0:itemidtype"> <ns0:id>310924</ns0:id> </ns0:documentid> </ns0:documentreference> <ns0:attachment inline="false"/> <ns0:item> <ns0:customeritemid> <ns0:id>02898347</ns0:id> </ns0:customeritemid> </ns0:item> <ns0:quantity>30</ns0:quantity> <ns0:unitprice> <ns0:amount currencyid="sek">522.03</ns0:amount> <ns0:perquantity>1</ns0:perquantity> </ns0:unitprice> <ns0:drawingattachment xsi:type="ns0:openattachmenttype" inline="false"/> <ns0:promiseddeliverydatetime>2016-08-01</ns0:promiseddeliverydatetime> <ns0:purchaseordersubline> <ns0:attachment inline="false"/> </ns0:purchaseordersubline> <ns0:purchaseorderschedule> <ns0:attachment inline="false"/> </ns0:purchaseorderschedule> </ns0:purchaseorderline> </ns0:purchaseorder> </ns0:dataarea> </ns0:acknowledgepurchaseorder>
i remove ns0: nodes
Comments
Post a Comment