Generating entities from XSLT

A

Andy Dingley

I have some (somewhat ragged) HTML, and I wish to pre-process it with
XSLT before putting it back onto the server. Throughout this HTML are
many character entity references, such as "&ecaute;".

After the XSLT process, I _must_ preserve these character entity
references, i.e. I can't let them turn into "é".


Is there any way to do this ? Every combination of processor, XSLT
coding and sundry DTD and schema reference juggling causes the
processor to spit out "é" rather than "&ecaute;". I know this is
valid in context, but when I put it back into the rest of my system it
won't be.

So far the only reliable way I've found to reliably produce an entity
reference is like this:
<xsl:text disable-output-escaping="yes" >&amp;eacute;</xsl:text>

Obviously this is inflexible, and as <xsl:text> doesn't let me have
any child elements I can't do this dynamically, even by hairy
string-mangling.


Thanks for any assistance.
 
J

Johannes Koch

Andy said:
I have some (somewhat ragged) HTML, and I wish to pre-process it with
XSLT before putting it back onto the server. Throughout this HTML are
many character entity references, such as "&ecaute;".

After the XSLT process, I _must_ preserve these character entity
references, i.e. I can't let them turn into "é".


Is there any way to do this ?

encoding="us-ascii"?

xpost and f'up2 comp.text.xml
 
A

Andy Dingley

Johannes Koch said:
encoding="us-ascii"?

Sadly no (with the XSLT processors I've tested so far, anyway) - that
generates an entity, but it's a numeric entity rather than a character
reference. As the output from this goes back to manual editors, I'd
really like to preserve them in the "more readable" form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,278
Latest member
BuzzDefenderpro

Latest Threads

Top