[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Need help with xsl-html conversion

Subject: Need help with xsl-html conversion
From: Guðmundur Erlingsson <txakolin@xxxxxxxxx>
Date: Fri, 25 Aug 2000 09:40:26 -0000
xsl loop alphabet
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@xxxxxxxxxx</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@xxxxxxxxxx<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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.