Re: disable escaping in copy

Subject: Re: disable escaping in copy
From: Mike Brown <mike@xxxxxxxx>
Date: Thu, 8 Jun 2000 00:15:19 -0600 (MDT)
> The desired output should contain double quotes (")
> instaid of the representation (%22).
> How can I disable the output escaping when I am coping an attribute
> value to appear as an attribute value?
> ****************** xml *******************
> <img src='`request.getParameter("path")`/img.gif'></img>
> [...]
> *************** output ********************
> <img src="`request.getParameter(%22path%22)`/img.gif"></img>

What XSL processor is giving you %22?!

It should give you &#22; or &quot; if the attribute value delimiter is a
double quote, because you mustn't use markup characters for anything but
markup. An HTML engine that knows what is doing should handle 
<element attribute="stuff&#22;stuff&#22;stuff"> correctly.

Your XSL processor apparently believes that all attribute values must be
delimited by double quotes, so what you're asking for if you could disable
the output escaping, which you can't, is <img src="stuff"stuff"stuff">,
which is still going to be wrong. Unless your XSL processor gives you a
way to change the attribute value delimiter, and I don't know of any that
do, you have no choice but to do post-processing, if &quot; or &#22; are
not being correctly handled by whatever is reading the HTML.

Also you are getting </img> closing tags in the output. Did you put
<xsl:output method="html"/> in your stylesheet?

   - Mike
Mike J. Brown, software engineer at         My XML/XSL resources: in Denver, Colorado, USA 

 XSL-List info and archive:

Current Thread