You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Dave Connet <co...@entelos.com> on 2001/01/26 01:23:47 UTC

RE: Outputting   from xsl

Along these lines, how do I go about constructing the proper DOM structure?
>I< know I want "&#160;" in the final xml text (which will be passed into
xalan), but when I construct the DOM_Text node (via createTextNode), the
"&#160;" is translated to "&amp;#160;". The final html just doesn't look
quite right! :^(

Thankx!
Dave Connet


-----Original Message-----
From: Joseph_Kesselman@lotus.com [mailto:Joseph_Kesselman@lotus.com]
Sent: Friday, January 19, 2001 1:22 PM
To: xalan-dev@xml.apache.org
Subject: Re: Outputting &nbsp; from xsl



>How do I output &nbsp; from my xsl  file?

That entity isn't defined by default in XML, and so XSL doesn't know how to
interpret it. You can define it in the XSL file's internal subset... or
(assuming you're output HTML) you can use its numeric equivalent directly.
The HTML output mode will convert it back into symbolic form.

I _think_ HTML defines &nbsp; as &#190;...

Re: Outputting   from xsl

Posted by Klaus Malorny <Kl...@knipp.de>.
Dave Connet wrote:
> 
> Along these lines, how do I go about constructing the proper DOM structure?
> >I< know I want "&#160;" in the final xml text (which will be passed into
> xalan), but when I construct the DOM_Text node (via createTextNode), the
> "&#160;" is translated to "&amp;#160;". The final html just doesn't look
> quite right! :^(
> 
> Thankx!
> Dave Connet


quite easy, e.g. createTextNode ("\xA0") or createTextNode ("\u00A0"). One
nice advantange of DOM is that you don't need to care about special characters
and their final textual representation ;-)

regards
Klaus

Re: Outputting   from xsl

Posted by Klaus Malorny <Kl...@knipp.de>.
Dave Connet wrote:
> 
> Along these lines, how do I go about constructing the proper DOM structure?
> >I< know I want "&#160;" in the final xml text (which will be passed into
> xalan), but when I construct the DOM_Text node (via createTextNode), the
> "&#160;" is translated to "&amp;#160;". The final html just doesn't look
> quite right! :^(
> 
> Thankx!
> Dave Connet


quite easy, e.g. createTextNode ("\xA0") or createTextNode ("\u00A0"). One
nice advantange of DOM is that you don't need to care about special characters
and their final textual representation ;-)

regards
Klaus

RE: Outputting   from xsl

Posted by Ashwin Agate <aa...@ind2ind.com>.
I had the same problem with xalan 1.2.2 which I mailed
to the list about 2 weeks ago, titled:
<xsl:text disable-output-escaping="yes">..</xsl:text>, indent, html
formatting

Theoretically you should be able to have the &nbsp;  using

<xsl:text disable-output-escaping="yes"><![CDATA[&nbsp;]]></xsl:text>
But the result is
Result: &amp;nbsp;

but xalan for some reason escapes the & no matter what the
disable-output-escaping
attribute is set

Same is the case with other reserved charachters.

<xsl:text disable-output-escaping="yes">
<![CDATA[&,<,>,',"]]>
</xsl:text>

Result: &amp;,&lt;,&gt;,&apos;,&quot;

Is there a way around this ?

Thanks,
Ashwin




Along these lines, how do I go about constructing the proper DOM structure?
>I< know I want "&#160;" in the final xml text (which will be passed into
xalan), but when I construct the DOM_Text node (via createTextNode), the
"&#160;" is translated to "&amp;#160;". The final html just doesn't look
quite right! :^(

Thankx!
Dave Connet


-----Original Message-----
From: Joseph_Kesselman@lotus.com [mailto:Joseph_Kesselman@lotus.com]
Sent: Friday, January 19, 2001 1:22 PM
To: xalan-dev@xml.apache.org
Subject: Re: Outputting &nbsp; from xsl



>How do I output &nbsp; from my xsl  file?

That entity isn't defined by default in XML, and so XSL doesn't know how to
interpret it. You can define it in the XSL file's internal subset... or
(assuming you're output HTML) you can use its numeric equivalent directly.
The HTML output mode will convert it back into symbolic form.

I _think_ HTML defines &nbsp; as &#190;...