[xsl] How many levels of nodes can we nest in a xsl:template?

Subject: [xsl] How many levels of nodes can we nest in a xsl:template?
From: "Alice Wei" <ajwei@xxxxxxxxxxx>
Date: Sun, 9 Sep 2007 15:47:01 -0400

    This is my first time trying to put in several layers of nodes within a
template, and the XML is found below:

                <panel n="1" characters="margo damian ike">
                          <balloon who="ike" type="speech">
                        <p>My <emph rend="bold">every</emph> instinct led me
to the <emph
                                rend="bold">right</emph> passages, Doctor
Damian! </p>
                        <p> I'll record it on film for you, right now!</p>
                            </panel> ........(more data)

    <xsl:template match="panelGroup">

        <table id="main" align="center" valign="middle">
                    <xsl:apply-templates select="figure"/>
                    <xsl:apply-templates select="panel"/>

 <xsl:template match="panel">
<xsl:template match="balloon">
                <xsl:value-of select="./@who"/>
                <xsl:when test="./@type ='speech' "> "<xsl:value-of
select="."/>" </xsl:when>
                <xsl:when test="./@type = 'thought' ">
                        <xsl:value-of select="."/>
            <xsl:apply-templates select="p"/>

 <xsl:template match="p">

However, when I transform the data, the data appears twice. The first line
that appears is the line that does not have any other formatting(bold or
italics), and then the second line would show the proper format. The problem
is that when I took out the <xsl:apply-templates/> line from the balloon
template, none of the bold print would show, although text would be only
appeared once. Is this because I have nested too many levels of nodes within
my "main template"? If so, how many templates am I allowed to have to produce
proper results?

A Newbie to xsl:templates nesting

Alice Wei
MIS 2008
School of Library and Information Science

Current Thread