RE: Trouble with disable-output-escaping

Robby Pelssers <[email protected]>
Newsgroups gmane.text.xml.cocoon.user
Message-ID <A5838A1302A3AC48B4A90FAD790B51AB010BF8@AMXPRD0410MB366.eurprd04.prod.outlook.com>
Allright...

You should reminder this tip.  It will only work if you do this in the very last transformer right before calling the serializer.

You owe me a beer ;-)

Robby

-----Original Message-----
From: Christopher Schultz [mailto:[email protected]] 
Sent: Tuesday, November 13, 2012 7:39 PM
To: [email protected]
Subject: Trouble with disable-output-escaping

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

All,

I'm running Cocoon 2.1.11 on Oracle Java 1.6.0_26. I'm using the default Xalan 2.7.1 XSLT processor.

All examples are roughly mocked-up from a much more complicated configuration so I apologize if there are typos, etc. -- I hand-typed this message with no copy/paste.

I have some text data wrapped-up in XML like this:

<node>
  <subnode>
    There is &lt;b&gt;HTML text&lt;/b&gt; in here.
  </submode>
</node>

I'd like to spit-out that text as if it were HTML -- that is, without escaping it on output. I would like to get this text output:

There is <b>HTML</b> in here.

But instead I get this:

    There is &lt;b&gt;HTML text&lt;/b&gt; in here.

Which, of course, is no surprise given no other instructions.

So I tried using disable-output-escaping, which seems uniquely-suited for this purpose:

<xsl:template match="subnode">
  <xsl:value-of select="." disable-output-escaping="yes" /> </xsl:template>

I observe no change in the output. The XSL file has definitely been re-read from the disk (I made other changes so I could verify at least that much), so that's not an issue.

Here's my (rough) configuration:

sitemap:
<map:match pattern="foo.html">
  <map:generate src="source.xml" />

  <map:transform src="generate-cincludes-1.xsl" />

  <map:transform src="generate-cincludes-2.xsl" />

  <map:transform type="cinclude" />

  <!-- this is the XSL I'm working with: -->
  <map:transform src="the-transformer-in-question.xsl" />

  <map:transform type="cinclude" label="content" />

  <map:transform type="i18n" />
  <map:transform src="strip-namespace.xsl" />
  <map:serialize type="xhtml" />
</map:match>

My template header:

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
    xmlns:cinclude="http://apache.org/cocoon/include/1.0"
    xmlns:java="http://xml.apache.org/xalan/java"
> 
    <xsl:output method="html" indent="yes" /> ...

My understanding is that Xalan itself does support disable-output-escaping, and I can't see why Cocoon would interfere with that.

Am I trying to use disable-output-escaping incorrectly? Do I need to run Cocoon (or Xalan) in any special mode or with any particular settings in order to enable disable-output-escaping?

Thanks,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCik6cACgkQ9CaO5/Lv0PAqZgCeIX65HKLVa6rEe6TnL65wEdoi
48gAmgJfBNT+082ehqg7DhduZtEg/4RV
=l8ul
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.