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

Controlling Sequence of Output

Subject: Controlling Sequence of Output
From: "Joseph Tan" <Joseph.Tan@xxxxxxxxxxxxxxxxxx>
Date: Thu, 31 Jul 2003 12:09:43 -0500
xml sequence of output
Here's part of my xml output

  <B2>MDConsult</B2> 
  <B2>Elsevier</B2> 
  <B3>http://home.mdconsult.com</B3> 
  <B3>http://www.sciencedirect.com</B3> 

I would like my display to be: 

MDConsult (Full-Text), Elsevier (Full-Text) {Note: The "Full-Text" link will link to the correspondent URL.}  

Right now, the display is as follows:

MDConsult, Elsevier; http://home.mdconsult.com, http://www.sciencedirect.com 

Here is is part of my XSL code:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

<xsl:template name="DisplayRemainder">
<xsl:param name="items"/>
<xsl:variable name="separator1" select="', '"/>
<xsl:variable name="separator2" select="'; '"/>
	<br/>
         <xsl:choose>
		<xsl:when test="DBN='Library catalog'">
			Holdings: 
			<xsl:for-each select="$items">
			<xsl:call-template name="DisplayItem"/>
				<xsl:if test="position() != last()">
						<xsl:variable name="pos" select="position()"/>
						<xsl:variable name="next" select="$items[$pos+1]"/>
					<xsl:choose>
						<xsl:when test="name() = name($next)"><xsl:value-of select="$separator1"/></xsl:when>
						<xsl:otherwise><xsl:value-of select="$separator2"/></xsl:otherwise>
					</xsl:choose>
				</xsl:if>
			</xsl:for-each>
		</xsl:when>
		<xsl:otherwise>
			<xsl:for-each select="$items">
			<xsl:call-template name="DisplayItem"/>
				<xsl:if test="position() != last()">
						<xsl:variable name="pos" select="position()"/>
						<xsl:variable name="next" select="$items[$pos+1]"/>
					<xsl:choose>
						<xsl:when test="name() = name($next)"><xsl:value-of select="$separator1"/></xsl:when>
						<xsl:otherwise><xsl:value-of select="$separator2"/></xsl:otherwise>
					</xsl:choose>
				</xsl:if>
			</xsl:for-each>
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>

<xsl:template name="DisplayItem">
          <xsl:value-of select="."/>		
</xsl:template>

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Thanks in advance for helping!

Joseph Tan
UT Southwestern Medical Center




 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.