xsl-list
[Top] [All Lists]

Re: [xsl] Outputting Formatted XML within HTML using XSLT

2011-08-31 15:36:52
On 08/31/2011 02:54 PM, Sall, Kenneth wrote:
The above XSLT produces:

[...]

instead of literally quoting the XML.

I don’t believe you. (-:  More politely, the example you posted is not
complete.

crism@portmore:~/tmp$ cat sall.xml
<?xml version="1.0"?>
<root/>

crism@portmore:~/tmp$ cat sall.xsl
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="2.0">
  <xsl:output method="html"/>
  <xsl:template match="root">
    <html>
      <head>
        <title/>
      </head>
      <body>
        <p>
          <xsl:text disable-output-escaping="no"
xml:space="preserve"><![CDATA[<foo><bar/><baz/></foo>]]></xsl:text>
        </p>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

crism@portmore:~/tmp$ java net.sf.saxon.Transform -s:sall.xml -xsl:sall.xsl
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title></title>
   </head>
   <body>
      <p>&lt;foo&gt;&lt;bar/&gt;&lt;baz/&gt;&lt;/foo&gt;</p>
   </body>
</html>

BTW, the disable-output-escaping="no" is redundant.

~Chris
-- 
Chris Maden, text nerd  <URL: http://crism.maden.org/ >
“The present tendency and drift towards the Police State gives all
 free Americans pause.” — Alabama Supreme Court, 1955
 (Pike v. Southern Bell Tel. & Telegraph, 81 So.2d 254)

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