remove atribute on document node



I have to remove the xsi:schemaLocation but I don't get it to work, I think I do something wrong in wt:Envelope/wt:Body/wt:MessageParts/*[not(name() ='xsi:schemaLocation')] definition, but don't know how to solve this


xml source :



<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://ift.tt/1srHvW9">
<Header>
<MessageId>{AAE4C191-6D18-4823-A29D-9C6CA68113C2}</MessageId>
<Action>http://ift.tt/1tvxear;
</Header>
<Body>
<MessageParts xmlns="http://ift.tt/1srHvW9">
<Document xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03 pain.001.001.03.xsd"
xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03"
xmlns:xsi="http://ift.tt/ra1lAU">
<CstmrCdtTrfInitn>
....
</CstmrCdtTrfInitn>
</Document>
</MessageParts>
</Body>
</Envelope>


My xslt



<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://ift.tt/tCZ8VR"
xmlns:wt="http://ift.tt/1srHvW9"
xmlns:s1="http://ift.tt/1wUyRgX"
version="1.0">
<xsl:output method="xml" encoding="iso-8859-1" />
<xsl:template match="/">
<xsl:text disable-output-escaping="yes">&lt;?xml version="1.0" encoding="utf-8"?&gt;</xsl:text>
<xsl:copy-of select="wt:Envelope/wt:Body/wt:MessageParts/*[not(name() ='xsi:schemaLocation')]" />
</xsl:template>
</xsl:stylesheet>


result



<?xml version="1.0" encoding="utf-8"?>
<Document
xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03 pain.001.001.03.xsd" xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03"
xmlns:xsi="http://ift.tt/ra1lAU">
<CstmrCdtTrfInitn>
..
</CstmrCdtTrfInitn>
</Document>


what am I doning wrong?


No comments:

Post a Comment