なぜこの行はありません:
apply-templates select="*/*
(XSLT ファイルの「shop」要素の下)
に太字の書式を適用しBlake2
ますか? 出力は次のようになります。
XSLT のルートの開始
「ステップ 1 開始」Alexis (タスク: 営業) Employee2 (タスク: ) Blake2 「ステップ 1 完了」
XSLT のルートの終わり
私の質問は、なぜBlake2
太字でもないのですか? 要素の下にあり<employee>
ます。
その行を に変更*apply-templates select="*"
するBlake2
と、太字になります。これが違う理由は何ですか?
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>
</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 /> <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">
<b> <xsl:apply-templates select="name"/> </b>
(Task: <xsl:apply-templates select="task"/>)
<br></br>
</xsl:template>
</xsl:stylesheet>