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

RE: Help quoting sequence elements

Subject: RE: Help quoting sequence elements
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 3 Jul 2007 21:06:32 +0100
RE:  Help quoting sequence elements
<xsl:value-of select="for $i in $code-list return concat('''', $i, '''')" 
  separator=", "/> 

Incidentally, the expression

for $i in $code-list return $i

is just a long-winded way of writing

$code-list

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: cknell@xxxxxxxxxx [mailto:cknell@xxxxxxxxxx] 
> Sent: 03 July 2007 20:48
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Help quoting sequence elements
> 
> I have this variable defined in my stylesheet:
> 
> <xsl:variable name="code-list" 
> select="document('../../hiring-report/xml/position-translation
> .xml')/position-translation/position/code[@pf='pf']" />
> 
> In a template, I have this element:
> <xsl:value-of select="for $i in $code-list return $i" />
> 
> which produces output like this:
> ACC ACT AO ATT AUD BA CI CLK ...
> 
> This is good, but I need output like this:
> 
> 'ACC',' ACT',' AO',' ATT',' AUD',' BA',' CI',' CLK', ...
> 
> That is to say, I need the individual elements of the 
> sequence to be surrounded by single quotes and separated by commas.
> 
> I've been reviewing some examples, but can't figure out how 
> to employ concat() to get the result I need. I'm at the point 
> where I've concluded that there is something fundamental I 
> don't understand here and I'm asking for someone to point it out.
> 
> Thanks. 
> 
> This produces
> 
> --
> Charles Knell
> cknell@xxxxxxxxxx - email

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.