这是 XML 文件:
<?xml version="1.0"?> 
<?xml-stylesheet type="text/xsl" href="2.xsl" ?>
<root>
    <shop>
        <person> 
            <employee> 
                <name> Alexis </name> 
                <role> Manager </role> 
                <task> Sales </task> 
            </employee> 
            <employee>
                <name> Employee2 </name>
            </employee>
        </person>
        <employee>
            <name> Blake2 </name>
        </employee>
    </shop>
    <person> 
        <employee2>
            <role2> Supervisor </role2> 
            <name2> Blake </name2> 
            <task2> Control </task2> 
        </employee2>
    </person>
</root>
这是 XSLT 文件:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="root"> 
<html><head></head> 
<body>
Start of root in XSLT <p/> <xsl:apply-templates select="person" /> <p/>
End of root in XSLT
</body> 
</html> 
</xsl:template> 
<xsl:template match="shop">
"Step 1 start"
<xsl:apply-templates select="*/*"/>
"Step 1 done" <p/>
</xsl:template> 
<xsl:template match="employee"> 
<u> <xsl:apply-templates select="name"/> </u> 
(Task: <xsl:apply-templates select="task"/>) 
<br></br> 
</xsl:template> 
</xsl:stylesheet>
输出是:
XSLT 中 root 的开始
监督布莱克控制
XSLT 中根的结尾
我的问题是,为什么 Alexis 和 Employee2 不是输出的一部分?他们都在<person>元素之下......