This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Disable Output Escaping - really useful



	Can you explain what "your output tree will not work as expected
        unless it is going to be reparsed" means?

If you go, in a template, 

<p>
this <b>and</b> that
</p>

then your result tree contains 

a p node with three children
 a text node with value "{newline}this "
 a b node, which itself has one text node child with value "and".
 a text node with value " that{newline}"


If you go, in a template, 

<p><xsl:text disable-output-encoding="yes">
this <b>and</b> that
</xsl:text></p>

then your result tree contains 

a p node with one child
  a text node with value "{newline}this <b>and</b> that{newline}"

together with some magic extra information that if writing to a file
that < and > should be written as < and > not &lt; &gt;.

so if you are writing to a file, in the first case the XSL system walks
that tree and produces
<p>
this <b>and</b> that
</p>

as literal characters, the browser parses that as (X)HTML and renders
it as a paragraph with a bold "and".

In the second case you get the same result.


_but_ if you are not writing to a file but instead you are passing the
entire tree straight to a renderer (as happens when you embed an XSL
engine in IE or in FOP or in any other XML system that shares the in
memory tree with the transformation system)

then in the second case the tree the renderer gets does _not_
include a b node, it just has a text node containing the characters <b>
and the special magic XSL information about how those characters should
be rendered has no effect: it doesn't suddenly make <b>and</b> into
a b node as the text string is never parsed as XML syntax, the renderer
is being passed a `ready parsed' XML tree.

So what appears in your IE5 window is the characters
this <b>and</b> that
literally.


> What about the DOCTYPE issue when XT wouldn't output one? Is there a
> non-hack solution to that?

the last few xt releases have supported controlling doctype with
xsl:output so I am not sure what the problem is?


David


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]