次の機能が期待どおりに機能しないのはなぜですか?
<root xmlns:ns0="xmlns"
ns0:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns1="xsi"
ns1:schemaLocation="[some schema location]" />
基本的に、私はこれを持たないxmlファイルにschemaLocationを追加しようとしています:-
<xsl:template match="/s:*">
<xsl:element name="{local-name()}" namespace="some other namespace">
<xsl:attribute namespace="xmlns" name="xsi">http://www.w3.org/2001/XMLSchema-instance</xsl:attribute>
<xsl:attribute namespace="xsi" name="schemaLocation">[some-loc]</xsl-attribute>
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
Xalan-Cは上記のxmlを提供します。
私が取得しようとしているのは次のようなものです:-
<root xmlns:ns0="http://www.w3.org/2001/XMLSchema-instance"
ns0:schemaLocation="[some schema location]" />