xslt を使用して、指定された xml から出力 xml を取得したいと考えています。出力 xml には、指定された xml に追加する要素がいくつかあります。しかし、必要な出力が得られません。
次のような入力xmlがあります。
<Response xmlns="http://xyz.abc/max/" xmlns:ns1="http://xyz.abc/max/">
<out xmlns="">
<Number xmlns="http://xyz.abc/max/">Desc1</Number>
<Address xmlns="http://xyz.abc/max">Desc2</Address>
<Records xmlns="http://xyz.abc/max">Desc3</Records>
</out>
</Response>
次のような出力 xml が必要です。
<?xml version="1.0" encoding="UTF-8"?>
<abc:Reqeust xmlns:abc="http://www.nnn.com/bnm"
xmlns:ns1="http://xyz.abc/max/" xmlns="http://xyz.abc/max/" >
<abc:Tray>
<abc:Remote>
<abc:ID>ID1</abc:ID>
<abc:Distance>Always</abc:Distance>
</abc:Remote>
<abc:Time>
1100-01-01T01:01:01+05:30
</abc:Time>
<abc:AreaMap />
</abc:Tray>
<abc:Area>
<abc:Get>
<abc:Fault>Token1</abc:Fault>
</abc:Get>
<Response xmlns="http://xyz.abc/max/" xmlns:ns1="http://xyz.abc/max/">
<out xmlns="">
<Number xmlns="http://xyz.abc/max/">Desc1</Number>
<Address xmlns="http://xyz.abc/max">Desc2</Address>
<Records xmlns="http://xyz.abc/max">Desc3</Records>
</out>
</Response>
</abc:Area>
</abc:Reqeust>
私はxsltを使用しています:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:abc="http://www.nnn.com/bnm"
xmlns:ns1="http://xyz.abc/max/" xmlns="http://xyz.abc/max/" >
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="Response">
<abc:Request>
<abc:Tray>
<abc:Remote>
<abc:ID>ID1</abc:ID>
<abc:Distance>Always</abc:Distance>
</abc:Remote>
<abc:Time>
1100-01-01T01:01:01+05:30
</abc:Time>
<abc:AreaMap />
</abc:Tray>
<abc:Area>
<abc:Get>
<abc:Fault>Token1</abc:Fault>
</abc:Get>
<Response>
<xsl:apply-templates select="@*|node()"/>
</Response>
</abc:Area>
</abc:Request>
</xsl:template>
</xsl:stylesheet>
しかし、必要な出力が得られません。必要な出力 xml を取得するには、xslt にどのような変更を加える必要がありますか?