xsl-list
[Top] [All Lists]

Re: [xsl] How would I go about changing my single quotes to double quotes in my XML output line ?

2014-11-20 16:36:35
On Thu, Nov 20, 2014 at 10:06:12PM -0000, Catherine Wilbur 
cwilbur(_at_)uwindsor(_dot_)ca scripsit:
Have following code in XSL stylesheet

Have string fields I surround by single quotes.  How would I change the 
single quote to a double quote without getting a syntax error in the 
<xsl:value-of select=.  Reason I am asking is because some of my string 
fields might have a single quote embedded so I want to surround my string 
fields by double quotes.  With the logic below it causes a syntax error 
with the <xsl:value-of select=" field sytax.

Anyone have any ideas?

This is where &quot; comes in handy.

concat('&quot;',../external_id[1],'&quot;')

won't give you a syntax error, unlike either " or "", because the parser
can tell it's part of the output and not part of the expression.

-- Graydon
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

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