私のxml入力は次のとおりです。
<?xml version="1.0" encoding="windows-1255"?>
<ns0:PatMedData xmlns="http://Maccabi.Hospitals.Integration" xmlns:ns0="http://Maccabi.Hospitals.Integration">
<MessageId>AS80000000000456</MessageId>
</ns0:PatMedData>
問題は、ルート要素に xmlns="http://Maccabi.Hospitals.Integration" と xmlns:ns0="http://Maccabi.Hospitals.Integration" があることです。これにより、奇妙な問題が発生します
私はこのxsltを試しました:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="//*[local-name() = 'MessageId']">
<xsl:element name="brlName"/>
<xsl:text>BBB</xsl:text>
</xsl:template>
</xsl:stylesheet>
結果は次のとおりです。
<brlName xmlns="">BBB</brlName>
どうすれば xmlns=""??? を取り除くことができますか?
ありがとう...