OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: Re: DOCBOOK-APPS: [QUESTION] translating whitespaces into  


On Fri, Oct 04, 2002 at 01:31:56PM +0200, Daniel S. Haischt wrote:
> hello,
> 
> this question might be likly off-topic...
> 
> i am having a stylesheets that produces some
> HTML output (taking a website xml file as input).
> 
> sometimes i'll like to translate every whitespace
> that occures in a plain text string into  
> 
> example:
> 
> ----------8<-----------8<-----------8<----------
>  This is a foobar sentence.
> 
> sould be translated into:
> 
>  This&nbsp;is&nbsp;a&nbsp;foobar&nbsp;sentence.
> ---------->8----------->8----------->8----------
> 
> i used the XSLT translate() function to accomplish
> this.
> 
>  translate('This is a foobar sentence.', ' ', '&#160;')
> 
> unfortunatly this does not produce the desired result.
> so how is it possible to translate whitespaces into
> &nbsp;?

Hmm, when I do this translation with Saxon, it works and
produces &nbsp; in the output.  When I do it with xsltproc,
I just get plain spaces.  When I use a different character
such as &#161; I get an inverted ! as expected, This means
the translation is working, it just isn't outputting &nbsp;
for &#160;.

Further investigation shows that the Saxon processor
outputs HTML entities for other characters, when they
are defined. Saxon outputs &iexcl; for &#161;, while
xsltproc outputs the octal character in
the character set.  
-- 

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
Caldera International, Inc.                 fax:   (831) 429-1887
                                            email: bobs@caldera.com


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC