xsl-list
[Top] [All Lists]

RE: RE: [xsl] Help quoting sequence elements

2007-07-03 14:42:45
Ah ha! Double the single quotes inside a pair of single quotes! I was trying to 
use & #39; inside single quotes. And thanks for pointing out the "separator" 
attribute.
-- 
Charles Knell
cknell(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     Michael Kay <mike(_at_)saxonica(_dot_)com>
Sent:     Tue, 3 Jul 2007 21:06:32 +0100
To:       <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject:  RE: [xsl] 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(_at_)onebox(_dot_)com [mailto:cknell(_at_)onebox(_dot_)com] 
Sent: 03 July 2007 20:48
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] 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[(_at_)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(_at_)onebox(_dot_)com - email

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>