XSL and entities

Subject: XSL and entities
From: "Philippe Le Hégaret" <Philippe.Le_Hegaret@xxxxxxxxxxxxxxx>
Date: Fri, 18 Sep 1998 14:18:33 +0200
I'm currently working on an XML report. I use
my own DTD. To show an example, I introduced
the element 'code':
<!ELEMENT code (#PCDATA)*>
<!ATTLIST code
    %book.generalAttr;>

Here is an example of this element:

<code>
&lt;!ELEMENT paragraph (#PCDATA)*>

&lt;!ELEMENT item (paragraph)+>

&lt;!ELEMENT list (item)+>
&lt;!ATTLIST list
        type (ordered|unordered) "unordered">
</code>

  Now, I want to transform this document in LaTeX,
and HTML.

latex.xsl:
    <xsl:template match='code'>
      <xsl:text>\begin{center}\scriptsize
                \begin{verbatim}</xsl:text>
      <xsl:process-children/>
      <xsl:text>\end{verbatim}
                \end{center}</xsl:text>
    </xsl:template>

html.xsl:
    <xsl:template match='code'>
    <pre>
      <xsl:process-children/>
    </pre>
    </xsl:template>

  The problem appears during the HTML transformation.
It produces this result :
          <pre>
<!ELEMENT paragraph (#PCDATA)*>

<!ELEMENT item (paragraph)+>

<!ELEMENT list (item)+>
<!ATTLIST list
        type (ordered|unordered) "unordered">      
    </pre>

  This is incorrect. If I put &amp;lt; , the LaTeX output
will be incorrect.

  Is there a XSL solution to do this ?

Philippe.


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


Current Thread