RE: Single quotes in src value of fo:external-graphic

 

> -----Original Message-----
> From: xsl-editors-request@w3.org 
> [mailto:xsl-editors-request@w3.org] On Behalf Of Nat Dunn
> Sent: Thursday, 2008 February 21 19:57
> To: xsl-editors@w3.org
> Subject: Single quotes in src value of fo:external-graphic
> 
> Isn't the code below from 
> http://www.w3.org/TR/xsl/#fo_external-graphic incorrect?  

Actually, the line you show is from 
http://www.w3.org/TR/xsl/#d0e9795

> 
> <fo:external-graphic src="'url(TH0317A.jpg)'"/>
> 
> It seems to me the single quotes are either misplaced or unnecessary.
> 
> Shouldn't it be:
> 
> <fo:external-graphic src="url('TH0317A.jpg')"/>
> 
> OR
> 
> <fo:external-graphic src="url(TH0317A.jpg)"/>

This is, admittedly, a bit of esoterica.

Under Property datatypes at http://www.w3.org/TR/xsl/#datatype
the <uri-specification> datatype is described.  This definition
was basically inherited from CSS.  It says that the value is
"A sequence of characters..." in which the quotes inside the 
parentheses are optional.  So, despite the fact that url(...)
might look like a function call, it is not--it just a string
that happens to contain parentheses, and technically strings 
in the XSL expression language must be enclosed in quotes.  
So in fact the form shown in the XSL spec is correct, and the 
other two shown above are not.

However, many implementations do not enforce the need for quotes 
around the "url(...)" string [and I, for one, don't blame them], 
so in practice, all three forms shown above will work.

paul

Received on Tuesday, 26 February 2008 19:38:18 UTC