0
我正在學習考試,我想確保我正確理解這一點。下列內容會打印出ABC還是BC,因爲這些模板並未應用於next/previous/item?XSLT練習示例
的input.xml:
<?xml version="1.0" encoding="UTF-8"?>
<next>
<previous>
<item>A</item>
</previous>
<item>B</item>
<item>C</item>
</next>
input.xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<HowDoes>
<xsl:apply-templates select="next/item" />
<xsl:apply-templates select="previous/item" />
</HowDoes>
</xsl:template>
<xsl:template match="item">
<ThisWork>
<xsl:copy-of select="." />
</ThisWork>
</xsl:template>
</xsl:stylesheet>
看看這裏:http://xsltcake.com/slices/EeAoyt – joshcomley 2013-04-11 11:13:08
這是一個很棒的工具;謝謝! – Lebowski156 2013-04-11 11:22:45
不客氣! – joshcomley 2013-04-11 11:54:40