Generating entities from XSLT

Discussion in 'XML' started by Andy Dingley, Jun 4, 2004.

  1. Andy Dingley

    Andy Dingley Guest

    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.
    Andy Dingley, Jun 4, 2004
    #1
    1. Advertising

  2. Andy Dingley wrote:
    > 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
    --
    Johannes Koch
    In te domine speravi; non confundar in aeternum.
    (Te Deum, 4th cent.)
    Johannes Koch, Jun 4, 2004
    #2
    1. Advertising

  3. Andy Dingley

    Andy Dingley Guest

    Johannes Koch <> wrote in message news:<>...

    > 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.
    Andy Dingley, Jun 7, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Romeo Disca

    XSLT: need some help on entities

    Romeo Disca, Jul 29, 2003, in forum: XML
    Replies:
    1
    Views:
    360
    Mike Brown
    Aug 3, 2003
  2. Iain

    Entities and XSLT

    Iain, Mar 4, 2004, in forum: XML
    Replies:
    2
    Views:
    365
  3. T. Sander
    Replies:
    2
    Views:
    654
    William Park
    Aug 20, 2004
  4. Brent
    Replies:
    3
    Views:
    758
    Peter Flynn
    Mar 22, 2005
  5. Jim Higson
    Replies:
    3
    Views:
    214
    Eric Amick
    Jul 25, 2004
Loading...

Share This Page