This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Need help with xsl-html conversion
- To: xsl-list at mulberrytech dot com
- Subject: Need help with xsl-html conversion
- From: Guğmundur Erlingsson <txakolin at bok dot hi dot is>
- Date: Fri, 25 Aug 2000 09:40:26 -0000
- Reply-To: xsl-list at mulberrytech dot com
Hi,
I'm trying to set up a list of employees in xml, and I'm going to use xsl to
display it in two different ways, in alphabetical order and by departments.
In the alphabetical output (in html) I want to have all the characters in
the alphabet at the beginning of the file, and each character is a link to
the appropriate section. Nothing complex. The thing that I'm not sure of how
to implement is the <a name...> anchor. The xml-file is setup like this:
<file>
<part id="A">
<emp>
<name>Allen, Jane</name>
<job></job>
<dep>Sales department</dep>
<email>JAllen@blabla.com</email>
<tel>8675668</tel>
</emp>
</part>
<part id="B">
<emp>
<name>Bright, John</name>
etc....
The thing is that I'm trying to make a loop that goes through the file and
spits out html something like this:
<h2><a name="A">A</a><h2>
<p>Allen, Jane<br>
Sales department<br>
jallen@blabla.com<br>
8675668</p>
and so on. Fairly simple. But I can't find a way to get the XSL loop to get
the value of the 'part' element and put it into the <a name=""> tag, between
the quotation marks. Meaning that I don't want to repeat the loop for every
single letter of the alphabet. So far the XSL part looks someting like this:
<h2><a name=""></a><xsl:value-of select="@id"/></h2>
<xsl:for-each select="starfsm">
<p class="noindent">
<xsl:choose>
<xsl:when test="job[.='']"><xsl:value-of
select="nafn"/></xsl:when>
<xsl:otherwise><xsl:value-of select="nafn"/>,
</xsl:otherwise>
</xsl:choose>
and so on. This is something that should be fairly simple, but I can't find
it. Does anyone have a suggestion?
Gudmundur
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list