Re: [xsl] nbsp and copy-of and output xml

Subject: Re: [xsl] nbsp and copy-of and output xml
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Mon, 18 Aug 2008 15:54:02 +0100
> first thanks for the reply to my problem. But your solution results
> into the next problem:

What problem is that?

> I can not use "copy-of" with output="xml" because "&nbsp" will not be
> displayed.

It's because "copy-of" will copy the _expanded value_ of the entity
from the input tree to the result tree.  You have &nbsp in your input,
which is expanded by the XML parser when the input tree is
constructed.  The XSLT processor operates on that input tree and
creates the result tree.  The serializer then operates on that result
tree to output flat text.

> Instead (before I transformed with jdom, now with xalan) I use
> output="html"
>
> Nice, BUT: the result is invalid html because in empty tags it does not
> close the tag.

No, that would be valid HTML, but invalid XML

> Solution (as suggested in many forums): use output="xml" or output="xhtml"
> for 2.0 which closes the tags - BUT THIS brings me to problem one.

If you can use the XHTML output method - use that, it's the one you need.

> Any workaround - professional solutions for that.

So what is your real problem?  Why do you need &nbsp in the output,
and not just #160?


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

Current Thread