Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Re: Emitting   to HTML Output

Reply
Thread Tools

Re: Emitting   to HTML Output

 
 
Klaus Johannes Rusch
Guest
Posts: n/a
 
      06-24-2003
Johannes Koch wrote:

> Andy Dingley wrote:
> > Assuming that I want _exactly_   what's the best/neatest way to
> > do this ?

>
> <xslutput encoding="us-ascii" .../>? (Untested)


& is encoded as &amp; regardless of the encoding so this will not make any
difference.

If you really really really need to emit &nbsp; in the output, use

<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>

--
Klaus Johannes Rusch
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.atmedia.net/KlausRusch/


 
Reply With Quote
 
 
 
 
Richard Tobin
Guest
Posts: n/a
 
      06-24-2003
In article <bd9d3a$qmlmt$(E-Mail Removed)>,
Johannes Koch <(E-Mail Removed)> wrote:

>>>Assuming that I want _exactly_ &nbsp; what's the best/neatest way to
>>>do this ?


....

>No, I meant

>and
><xslutput encoding="us-ascii" .../>


That should ensure that it isn't output as a literal NBSP character,
but is not likely to make it be output as &nbsp; instead of  

-- Richard
--
Spam filter: to mail me from a .com/.net site, put my surname in the headers.

FreeBSD rules!
 
Reply With Quote
 
 
 
 
Johannes Koch
Guest
Posts: n/a
 
      06-25-2003
Richard Tobin wrote:
> In article <bd9d3a$qmlmt$(E-Mail Removed)>,
> Johannes Koch <(E-Mail Removed)> wrote:
>>No, I meant
>> 
>>and
>><xslutput encoding="us-ascii" .../>

>
>
> That should ensure that it isn't output as a literal NBSP character,
> but is not likely to make it be output as &nbsp; instead of  


At least with Saxon 6.5.2 and Xalan-J 2.5.0 when outputting HTML, it does.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

 
Reply With Quote
 
Klaus Johannes Rusch
Guest
Posts: n/a
 
      06-25-2003
Johannes Koch wrote:

> At least with Saxon 6.5.2 and Xalan-J 2.5.0 when outputting HTML, it does.


That is the key point: when outputting HTML, an XSLT processor can use HTML
entities, when outputting XML output it cannot, because there is no &nbsp;
entity defined in XML.

--
Klaus Johannes Rusch
(E-Mail Removed)
http://www.atmedia.net/KlausRusch/


 
Reply With Quote
 
Johannes Koch
Guest
Posts: n/a
 
      06-25-2003
Richard Tobin wrote:
> In article <bdc0ei$r6rs7$(E-Mail Removed)>,
> Johannes Koch <(E-Mail Removed)> wrote:
>>So it is a solution for the OP's use case.

>
>
> Yes, so long as you remember that it's implementation dependent.


/me and the OP
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

 
Reply With Quote
 
Micah Cowan
Guest
Posts: n/a
 
      06-27-2003
Klaus Johannes Rusch <(E-Mail Removed)> writes:

> Johannes Koch wrote:
>
> > Andy Dingley wrote:
> > > Assuming that I want _exactly_ &nbsp; what's the best/neatest way to
> > > do this ?

> >
> > <xslutput encoding="us-ascii" .../>? (Untested)

>
> & is encoded as &amp; regardless of the encoding so this will not make any
> difference.
>
> If you really really really need to emit &nbsp; in the output, use
>
> <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>


Which may or may not work. I avoid that feature since you can't depend
on it, and there's never a time (to my knowledge) that it's necessary
for producing well-formed XML with the desired effect (unless the
"desired effect" is defined to include the formatting of the source
code, in which case you're better off post-processing it anyway).

-Micah
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ATLAS and controls emitting Javascript julia.hayward@cadcorp.com ASP .Net 0 01-05-2007 03:57 PM
Client side validators not emitting John Livermore ASP .Net 1 07-18-2003 09:03 PM
Re: Emitting &nbsp; to HTML Output Peter C. Chapin XML 10 06-28-2003 04:14 AM
Re: Emitting &nbsp; to HTML Output Andy Jefferies XML 0 06-25-2003 02:11 PM
Re: minidom toxml() not emitting attribute namespace qualifier Paul Boddie Python 0 06-24-2003 09:44 AM



Advertisments