Hi, I have a xml document,
<body>
<sec sec-type="intro" id="S1">
<title>1. Introduction</title>
<p id="P2">The p2</p>
</sec>
<sec>
<title>2. method</title>
<sec>
<title>2.1 title</title>
<p>the 2.1 p</p>
<sec>
<sec>
</body>
Here's my XSLT
<xsl:template match="/">
<html>
<body bgcolor="#FFFFFF">
<xsl:apply-templates select="//body/sec"/>
</body>
</html>
</xsl:template>
<xsl:template match="//body/sec">
<center><font color="blue">
<br/><xsl:apply-templates select="title"/>
</font></center>
<br/>
<xsl:for-each select="descendant:">
<xsl:apply-templates/>
<br/><br/>
</xsl:for-each>
<xsl:template select="descendant::sec">
<b><xsl:apply-templates select="title"/></b>
<xsl:for-each select="descendant:">
<xsl:apply-templates/>
<br/><br/>
</xsl:for-each>
</xsl:template>
</xsl:template>
In the html output, I cannot see the sub sec title "2.1 title", though I got all the <p>.
How to get the sub sec title? Thanks!!
<body>
<sec sec-type="intro" id="S1">
<title>1. Introduction</title>
<p id="P2">The p2</p>
</sec>
<sec>
<title>2. method</title>
<sec>
<title>2.1 title</title>
<p>the 2.1 p</p>
<sec>
<sec>
</body>
Here's my XSLT
<xsl:template match="/">
<html>
<body bgcolor="#FFFFFF">
<xsl:apply-templates select="//body/sec"/>
</body>
</html>
</xsl:template>
<xsl:template match="//body/sec">
<center><font color="blue">
<br/><xsl:apply-templates select="title"/>
</font></center>
<br/>
<xsl:for-each select="descendant:">
<xsl:apply-templates/>
<br/><br/>
</xsl:for-each>
<xsl:template select="descendant::sec">
<b><xsl:apply-templates select="title"/></b>
<xsl:for-each select="descendant:">
<xsl:apply-templates/>
<br/><br/>
</xsl:for-each>
</xsl:template>
</xsl:template>
In the html output, I cannot see the sub sec title "2.1 title", though I got all the <p>.
How to get the sub sec title? Thanks!!