This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: single HTML tag around repeating patterns
- From: Américo Albuquerque <aalbuquerque at viseu dot ipiaget dot pt>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Fri, 12 Jul 2002 17:27:14 +0100
- Subject: RE: [xsl] single HTML tag around repeating patterns
- Keywords: XSL-List
- Reply-to: xsl-list at lists dot mulberrytech dot com
your <div id="procedures" class="procedures" style="display:none"> should be
in the template that call's this one
like:
<xsl:template ...>
<div ...>
<xsl:apply-templates select="PROC/SUBSECTION"/>
</div>
thi sway it wraps all of your subsections
hope that this helps you.
-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Brad Miller
Sent: Friday, July 12, 2002 5:13 PM
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] single HTML tag around repeating patterns
This is probably one of those really simple things that I just can't seem to
grasp today.
I am trying to place a <div> tag around a repeating pattern. Everything I do
either gives me a <div> around each subsection or I get none of the
subsections and just a <div>.
The div tag below should surround all of my SUBSECTIONs. The way I have it
now I get the same div for every subsection.
So how can I get one instance of the div surrounding multiple subsections?
<xsl:template match="PROC/SUBSECTION">
<div id="procedures" class="procedures" style="display:none">
<xsl:for-each select="TITLE">
<h2><xsl:apply-templates select = "." /></h2>
</xsl:for-each>
<xsl:for-each select="PARA">
<p><xsl:apply-templates select = "." /></p>
</xsl:for-each>
<ol>
<xsl:for-each select="LIST/ITEM-NUMBER">
<li><xsl:apply-templates select = "." /></li>
</xsl:for-each>
</ol>
</div>
</xsl:template>
I want my final output to look like this:
<div id="procedures" class="procedures" style="display:none">
<h2>title 1</h2>
<p>paragraph 1</p>
<ol>
<li>list 1.1</li>
<li>list 2.1</li>
</ol>
<h2>title 2</h2>
<p>paragraph 2</p>
<ol>
<li>list 1.2</li>
<li>list 2.2</li>
</ol>
</div>
Thanks
Brad
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list