Re: getting xsl to produce ill-formed xml?

Subject: Re: getting xsl to produce ill-formed xml?
From: "Mark D. Anderson" <mda@xxxxxxxxxxxxxx>
Date: Sun, 21 Mar 1999 09:43:11 -0800
I got several suggestions for this problem:

1. (John Simpson) Generate a CDATA block.
I don't see how this can be done (Oren seems to confirm this
in his <Opinion> element).

2. (Duane Nickul) Post-process with perl.
But that is what I was already doing.
It is the principle of the thing. If I was going to be using
perl, this little exercise would have been done long ago.
I wanted an excuse to play with xsl.

3. (Oren Ben-Kiki) Use <SCRIPT>.
This works, but now I don't get the exact output I wanted --
I've got this "# <SCRIPT>" in the perl program itself.
It is like letting xsl win; not acceptable :).
(Again, I've already got a working system... a reasonable
definition of a hacker is someone who takes a working
system and "improves" it....)

4. (Duane Nickul) Use an entity.
This almost works. If I put this in my style sheet:
<!DOCTYPE xsl:stylesheet SYSTEM "xsl.dtd" [ 
<!ENTITY plarrow "=>"> 
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl";> 
...
<xsl:text>
&lt; 
&plarrow; 
</xsl:text>

Then I get this in the output:
&lt;
=&gt;

I might note that this also holds if I use this stylesheet
declaration:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"; 
        xmlns:html="http://www.w3.org/TR/REC-html40"; 
        result-ns="html"> 
In other words, I can't seem to get xt to expand all entities
I insert (like "&lt;"), and worse yet, it seems to want to
convert any ">" in sight to a "&gt;".

I don't know if this is an xsl thing or an xt thing.

(In general, I've yet to find that xt does much different
based on the stylesheet declaration except maybe put a line like
this across the top of the output:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
.)

-mda




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


Current Thread