Re: [xsl] maintain TeX ampersands

Subject: Re: [xsl] maintain TeX ampersands
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 10 Nov 2003 15:20:52 GMT
> So yes. I was using html output hence getting &amp; instead of "&" 
> which thanks to you info it now makes sense. Can I output HTML or 
> even XHTML or something leaving the whole unparsed data in an unparsed data tag somehow 
> so as I can then do whatever I want with them ?

You can _request_ that the XSLT system outputs elements using <![CDATA[
rather than entity refs by using the cdata-elements attribute of
xsl:stylesheet.  Note however that if you extract your TeX fragments
from your result document by any XML-aware (or html aware) means then
<p> a &amp; b</p> and <p><![CDATA[ a & b ]]></p> will give you the same
result. the second may look like a single ampersand to a human reader,
but these are the same thing to XML.

SGML allows elements to be declare CDATA so you could have 
<something> a & b </something>
but this is not supported in XML as it defeats the whole point of XML:
it requires that a system read the DTD before parsing the document tree,
to know which elements have special syntax.

In HTML the script and style elements are defined this way, so if you
were to decide that TeX was a script then if your stylesheet had

<script language="tex">a &amp; b</script>
in html output this would appear as
<script language="tex">a & b</script>
but of course in xhtml this would be
<script language="tex">a &amp; b</script>

David

-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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


Current Thread