0
我要插入從子元件PCDATA到選擇的節點屬性插入PCDATA成屬性
XML
<root>
<tag>
<tag1>SOME TEXT</tag1>
</tag>
</root>
MY XSL
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xi="http://www.w3.org/2001/XInclude" version="1.0">
<xsl:template match="root">
<tag-out>
<xsl:attribute name="text">
<!-- What should I select? -->
<xsl:value-of select="tag/tag1/???"/>
</xsl:attribute>
<tag-out>
</xsl:template>
...........
</xsl:stylesheet>
希望的輸出XML
<root-out text="SOME TEXT">
<tag-out/>
</root-out>
感謝
對不起,我寫了一個 :)的例子,並在我的主腳本中出現錯誤。問題解決了 –
Nawa