[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: whitespace as a parameter to a template (replace l

Subject: Re: whitespace as a parameter to a template (replace linefe ed with linefeed tab)
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Fri, 1 Jun 2001 08:22:59 +0100
unexpected token eof in expression
Hi James,

> I thought about that and so I set my replace string to "foo" and my
> by string "bar". Of course the style sheet works just fine with
> these non-white-space values.
>
> I am content with using the other solution you suggested using the
> <xsl:text> tags.

Sorry to hammer on about it then, but it does sound as if you've
missed the quotes around the string value. You need to have two quotes
- one set for the select attribute (I use double quotes) and one set
around the string that is the value of the expression (I use single
quotes):

  <xsl:with-param name="replace" select="'&#10;'" />

If I miss off these single quotes using Saxon then I get the error
'Unexpected token EOF in expression' which is the error that you
reported, which backs up my intuition that this is where you're going
wrong.

The same goes when you're setting other string values, not just
whitespace.  If you do:

  <xsl:with-param name="replace" select="foo" />

Then you're setting the $replace parameter to the node set consisting
of the foo element children of the current node (which might be an
empty node set). The processor won't complain because this is a valid
expression. On the other hand, if you do:

  <xsl:with-param name="replace" select="'foo'" />

Then you're setting it to the string 'foo'.

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.