[OT] XHTML -> XHTML: How can entities preserved?

F. GEIGER fgeiger at datec.at
Wed Oct 9 13:54:55 EDT 2002


Thank you, Harvey,

this doesn't quite do the trick.

' ' in the DTD transforms ' ' into ' ', 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 ' ' could then be replaced into
' '. Weird...

Thanks again and best regards
Franz GEIGER


"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.
<rant>
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
themselves.
</rant>
  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;">

Harvey

_____________________________________________________________________
This message has been checked for all known viruses by the MessageLabs Virus
Scanning Service.






More information about the Python-list mailing list