This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: disable escaping in copy


> 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:
webb.net in Denver, Colorado, USA           http://www.skew.org/xml/


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]