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

Re: How to use for-each to get comma searated list?

Subject: Re: How to use for-each to get comma searated list?
From: "Farrukh S. Najmi" <najmi@xxxxxxxxx>
Date: Wed, 02 Dec 1998 17:23:03 -0500
xsl for each comma
Thanks Gabriel for the suggestion. I should have read the spec better.
However, I am still having trouble with the MSIE5.0beta2 processing of
my very simple XSL and XSL (attached to this message). I get an error as
follows:

---begin error in MSIE5.0b2

The XML page cannot be displayed 

Cannot view XML input using XSL style sheet. Please correct the error
and then click the Refresh button, or try again later. 


--------------------------------------------------------------------------------
Keyword xsl:text may not be used here. 
 
---end error in MSIE5.0b2

Is this a bug in IE or am I doing something wrong? Is there a
workaround?

-Regards,
Farrukh

Gabriel Paiz III wrote:
> 
> How about adding an 'if' around comma text:
> 
> <xsl:if match=".[$not$ end()]">
>          <xsl:text>,</xsl:text>
> </xsl:if>
> 
> __________________________________
> SPX - Valley Forge T.I.S.
> 25691 Atlantic Ocean Drive Suite B-7
> Lake Forest, CA 92630
> USA    www.vftis.com
> __________________________________
> 
> Tel:    (949) 460 0094
> Fax:    (949) 460 0095
> e-Mail: gpaiz@xxxxxxxxx
> __________________________________
> 
> > #Following is a simplified target HTML mapping desired
> >
> > <BODY>valueList="3.75,2.25"</BODY>
> >
> > --------------
> >
> > #Following is my simplified XSL file
> >
> > <xsl:template match="/">
> > <BODY>
> >        <xsl:text>valueList="</xsl:text>
> >        <xsl:for-each select="Section/Foo">
> >           <xsl:process select="Value"/>
> >           <xsl:text>,</xsl:text>
> >        </xsl:for-each>
> >        <xsl:text>"</xsl:text>
> > </BODY>
> > </xsl:template>

-- 

Regards,
Farrukh Najmi
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="./simple.xsl" ?>

<Doc>

<Section>
  <ListElement>3.75</ListElement>
</Section>

<Section>
  <ListElement>2.75</ListElement>
</Section>


</Doc>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/TR/WD-xsl"
  xmlns:fo="http://www.w3.org/TR/WD-xsl/FO"
  result-ns="fo">

<xsl:template match="/">

<HTML>

<HEAD>
  <TITLE>List Test</TITLE>
</HEAD>

<BODY bgcolor="#ffffff" >
<P>
       <xsl:text>list="</xsl:text>
       <xsl:for-each select="Section">
          <xsl:process select="ListElement"/>
          <xsl:if test=".[not-last-of-type()]">, </xsl:if>
       </xsl:for-each> 
       <xsl:text>"</xsl:text>

</P>
</BODY>
</HTML>

</xsl:template>

</xsl:stylesheet>

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.