[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

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


Subject: Re: [xsl] How would I go about changing my single quotes to double quotes in my XML output line ?
From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 20 Nov 2014 22:36:27 -0000

On Thu, Nov 20, 2014 at 10:06:12PM -0000, Catherine Wilbur cwilbur@xxxxxxxxxxx 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


Current Thread
Keywords
xsl