[OT] XHTML -> XHTML: How can entities preserved?
fgeiger at datec.at
Wed Oct 9 19:54:55 CEST 2002
Thank you, Harvey,
this doesn't quite do the trick.
'&nbsp;' in the DTD transforms ' ' into '&nbsp;', which shows
up as ' ' in the browser.
I could do a replacement of all 'ö' etc. into 'ö' etc. after the XSLT
processor has done its job. The '&nbsp;' could then be replaced into
' '. Weird...
Thanks again and best regards
"Harvey Thomas" <hst at empolis.co.uk> schrieb im Newsbeitrag
news:mailman.1034156489.26032.python-list at python.org...
F. GEIGER wrote
> I do process XHTML files with a Python app, that calls a couple of
> processing objects.
> One of them is a class called Shaper. The Shaper takes an
> XHTML file as
> input, processes all H1, H2, etc. elements and outputs it
> again into an
> XHTML file. It does so by calling an XSLT processor.
> The problem here is, that entities are converted, e.g.
> ' ' becomes ' '.
> This is not what I want. I want all entities being preserved for the
> client's browser.
> As my app runs on a W2k box, I use the MS XSL processor. In
> their help they
> show a method to preserve entities: cdata-section-elements.
> Actually all
> data defined by cdata-section-elements are put into CDATA
> sections. But this
> is not for HTML output: "HTML does not recognize CDATA
> sections. Do not use
> this option when generating HTML."
> I guess this not an MS XSL issue but a general XML/XSL issue, right?
> Any idea?
> Many thanks and best regards
> Franz GEIGER
This is an XML issue.
The creators of XML decided in their wisdom that amongst the facilities of
SGML they would drop was SDATA entities. This causes the type of problem you
have when you don't want entities resolved to something other than
is not really an entity, it is a character reference
I suspect that in you DTD you have
<!ENTITY nbsp " ">
Try replacing this and similar declarations in the DTD with
<!ENTITY nbsp "&nbsp;">
This message has been checked for all known viruses by the MessageLabs Virus
More information about the Python-list