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

Re: How to escape "$" in output?

Subject: Re: How to escape "$" in output?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 25 May 2005 15:32:48 -0400
wlwbuild
David,

At 02:50 PM 5/25/2005, you wrote:
I have an element like the following that I need to emit from within a
template:

    <wlwBuild work="${app.dir}/${work.file}"
serverclasspath="${server.classpath}">
       <build outputdir="${output.dir}"
outputfilename="${output.file}"/>
    </wlwBuild>

I need to make sure it is emitted literally, particularly so that the
Ant expressions are not munged by XSLT.

Do I have to use manual "xsl:element" and "xsl:attribute" elements, with
attribute values using "concat" to separate the "$" from the rest of the
value?

No, you don't. Actually I don't think it will be the '$' characters that will be the problem here, but rather the curly braces, which the XSLT processor sees as attribute value templates.


In order to prevent this, you can escape the curly braces by doubling them. So your stylesheet would say

<wlwBuild work="${{app.dir}}/${{work.file}}"
          serverclasspath="${{server.classpath}}">
   <build outputdir="${{output.dir}}" outputfilename="${{output.file}}"/>
</wlwBuild>

This should produce the literal output you want.

I tried using '<xsl:text disable-output-escaping="yes">...', but that
complains about the "wlwBuild" element, saying it's not legal at that
point in the stylesheet.

That's weird, though I suppose if you posted the code we might be able to see why. On the other hand, you might not want to bother: d-o-e isn't the way you want to do this anyway.


Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

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.