Re: Implementing " and ' in literals

Subject: Re: Implementing " and ' in literals
From: Matt Sergeant <matt@xxxxxxxxxxxx>
Date: Fri, 21 Apr 2000 12:23:59 +0100 (BST)
On Thu, 20 Apr 2000, David Carlisle wrote:

> 
> > I want to instigate change (for XPath 2.0,
> > for what it's worth)
> 
> Ah  but that isn't what you said in your message, you said you'd just
> added it as a feature to a (presumably xslt 1.0) implementation :-)

Actually it was there from the start of my implementation due to an
incorrect reading of the spec - and I'd just joined the list so wondered
if it was worth adding for XPath 2.0. I don't (unfortunately) have an XSLT
implementation - much that I wish I had the time to build one (although
realistically does the world really need another XSLT implementation?).

> > It's a shame XPath has no namespace mechanism to
> > make adding grammar extensions simple.
> 
> You can add extension functions from a different namespace, can't you?
> Which isn't strictly a change of grammar, but would allow
> 
> fastnet:quoted-string(.......)
> 
> or whatever you want the syntax to be.

Yes, I could do that. In fact it's an excellent idea. However what I'd
really like to see is proper C escaping in the next release, so that I can
just do "He said \"Hello Mum\"."

> Given you only need this to get a string literal that has both " and '
> and in xslt it's easy to get such a string by
> <xsl:variable name="x">this ' and this "</xsl:variable>
> and then coercing the rtf variable to a string.

That's xslt - we're talking about XPath here.

-- 
<Matt/>

Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread