xsl-list
[Top] [All Lists]

Re: [xsl] &

2007-03-21 04:28:13

I have a xml document with:

......
<NODE n="1" url="url1" visible_url="url2?escape&amp;amp;chars"></NODE>
..

this is almost certainly a mistake in the input and if you have control
over the generation of these files, you should fix the generator to
produce
<NODE n="1" url="url1" visible_url="url2?escape&amp;chars"></NODE>

and it's ok;
the problem is the onmouseover attribute where I get:

disable-output-escaping is defined to do nothing in attribute values.
It's almost always a bad idea to use d-o-e in any case.



you need to replace &amp; by &, in XSLT2, you could use

select="replace(@visible_url,'&amp;amp;',' &amp;')"

in XSLT1 you could use one of the many replace templates posted to this
list, or the faq to do the same transformation.

David



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>