W3C home > Mailing lists > Public > xsl-editors@w3.org > January to March 2008

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

From: Nat Dunn <ndunn@webucator.com>
Date: Tue, 26 Feb 2008 15:04:26 -0500
To: "'Grosso, Paul'" <pgrosso@ptc.com>, <xsl-editors@w3.org>
Message-ID: <005801c878b2$c9d09120$1b0ba8c0@NatDesktop>

Hi Paul,

Thanks for the reply!  Sorry about giving you the wrong URL.

I guess this is just academic, so feel free to ignore, but...

I'm afraid I still don't understand.  I do understand that url() is not a
function.  As I understand it, in CSS a URI datatype is a subset of the
string datatype.  However, in FO, attribute values are often strings and
there is no need to put extra single quotes around them.  

It seems to me that the value of the src attribute below is a proper URI.

<fo:external-graphic src="url('TH0317A.jpg')"/>

I checked out the CSS documentation
(http://www.w3.org/TR/CSS21/syndata.html#uri) and it shows this example:

body { background: url("http://www.example.com/pinkish.png") }

That seems to me to use the same syntax as the src attribute above.

To agree with the code shown at http://www.w3.org/TR/xsl/#d0e9795, it would
have to be:

body { background: "url(http://www.example.com/pinkish.png)" }

No?

Nat

-----Original Message-----
From: Grosso, Paul [mailto:pgrosso@ptc.com] 
Sent: Tuesday, February 26, 2008 2:37 PM
To: Nat Dunn; xsl-editors@w3.org
Subject: 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 20:02:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 11:00:00 GMT