Re: [xslt] Bug when declaring entities?



On Tue, Sep 17, 2002 at 01:43:50PM -0400, Daniel Veillard wrote:
> 
>   I don't think it's what you actually have in your stylesheet.
> but :
>   <!ENTITY nbsp "<xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text>">
> 
>   otherwise your entity declaration makes no sense and libxslt would
> not generate an error since there is no namespace used in the entity !
> 

Sorry for that mistake. I had taken out the namespaces in order to get
xsltproc to work.


> > The code in my stylesheet is taken directly from a book on xslt. If I
> 
>   that's theorically fine but if you do
> 
>   <foo xmlns:xsl="bar">&nbsp;</foo>
>   <foo xmlns:xsl="err">&nbsp;</foo>
> 
> your &nbsp; reference would lead to different namespaces for the element
> text and in 99% of the case you don't want this so my parser complain about
> it.
> Simply define the namespace in the entity:
> 
>   <!ENTITY nbsp "<xsl:text xmlns:xsl="..." disable-output-escaping='yes'>&amp;nbsp;</xsl:text>">


I don't follow this. I think I need to read more about namespaces to
fully understand your argument.
> 
>  then it becomes context insensitive and libxml2 won't complain.
> Anyway using "disable-output-escaping" is bad practice in general...

I know this isn't a tutorial mailing list, but how else would I get
'&nbsp;' into an html document using xsltproc?

> 
> > run the same code with xalan, I don't get an error. 
> 
>   They are just a bunch of losers :-)
> More seriously we have different appreciation of some of those suble issues.

There is the issue of speed in xalan versus xsltproc, but I think I'll
bring this topic up in another thread.

Thank you very much for your response. I am able to generate &nbsp;,
even if my method is perhaps wrong.

Paul

-- 

************************
*Paul Tremblay         *
*phthenry@earthlink.net*
************************



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]