Generating entities from XSLT

Andy Dingley

Usenet Archive
Joined
Feb 23, 2000
Messages
3,303
Reaction score
0
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.
 

Johannes Koch

Usenet Archive
Joined
Nov 14, 2000
Messages
801
Reaction score
0
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
 

Andy Dingley

Usenet Archive
Joined
Feb 23, 2000
Messages
3,303
Reaction score
0
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

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,224
Members
248,132
Latest member
henrywalsh

Latest Threads

Top