Subject: RE: Literal Text From: Kay Michael <Michael.Kay@xxxxxxx> Date: Mon, 29 Mar 1999 10:55:44 +0100 |
> Given this XSL:
>
> <xsl:text></JPanel></xsl:text>
>
> When run through Lotus XSL Processor I get this output:
>
> </JPanel>
>
> When I really want:
>
> </JPanel>
>
> What am I doing wrong?
>
Misunderstanding one of the underlying concepts of XSL, which is that it produces a tree rather than a stream of characters.
If it's of any interest, SAXON's "almost-XSL" processor does allow you to produce any stream of characters, including XML, HTML, badly-formed-XML, and things-that-aren't-XML-at-all. If you have a valid reason for wanting the characters "</JPanel>" in your output, you can do it in two ways in SAXON:
1: <xsl:tag>/JPanel</xsl:tag>
or
2: <xsl:text saxon:escape="no"></JPanel></xsl:text>
The former approach is there primarily to handle the case where you do want to output well-formed XML, but you have to suppress compile-time checking to achieve it (rather like a cast). An example would be:
<xsl:if test=".[first-of-type()]">
<xsl:tag>JPanel</xsl:tag>
</xsl:if>
...
<xsl:if test=".[last-of-type()]">
<xsl:tag>/JPanel</xsl:tag>
</xsl:if>
The second approach is there primarily to handle the case where the output is not *ML at all, e.g. it might be a CSV file.
Mike Kay
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Literal Text, Andrew McNaughton | Thread | RE: Literal Text, Kay Michael |
Fw: multiple sorting modes, Oren Ben-Kiki | Date | RE: multiple sorting modes, Sargeant, Richard (G |
Month |