xsl-list
[Top] [All Lists]

RE: [xsl] display & as text

2010-06-04 16:44:05
On Fri, 2010-06-04 at 21:14 +0000, mas christ wrote:
Someone asked for a reason.

The reason is to copy and past text with ampersands into my xml file
without having to convert one ampersand form into another.

You can use <![CDATA[ stuff like < and & not special here ]]>

*but*

now if ]]> occurs in your input you must escape it. E.g. to put <[[]]>
into a string, you might try

<![CDATA[ this is <[[]]> a space-ship]]>
but that does not work. Instead, you must write,
<![CDATA[ this is <[[]]>]]<![CDATA[> a space-ship]]>
which I am sure you will agree is clearer.

With XSLT, you might find it easier to include an external
text file, using unparsed-text(), assuming you are using XSLT 2.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org


--~------------------------------------------------------------------
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>