How to escape > in XML/XSL

Discussion in 'XML' started by Niko, Sep 3, 2003.

  1. Niko

    Niko Guest

    I am trying to pass a piece of XMLthat has escaped characters e.g >
    into a new piece of XML. However when I pass it I don't want these
    characters escaped and want them to appear in the XML.

    Any ideas on how to do this.

    TIA
     
    Niko, Sep 3, 2003
    #1
    1. Advertising

  2. Niko

    Mike Brown Guest

    > I am trying to pass a piece of XMLthat has escaped characters e.g >
    > into a new piece of XML. However when I pass it I don't want these
    > characters escaped and want them to appear in the XML.
    >
    > Any ideas on how to do this.


    FAQ.

    You're essentially asking for a way to re-parse something that was
    designated character data in your XML as if it were actually elements and
    other markup. If you want it to be treated as markup, don't put it in your
    original XML as character data. Fix the problem at it's source.

    If you cannot fix the XML, then check your XSLT processor's docs for an
    extension function that can parse an arbitrary string and return a node-set
    or result tree fragment. If there isn't one, then write your own. You'll
    probably need to wrap the string in a dummy element to ensure it's a
    well-formed document entity before you send it to the parser.

    In a controlled environment you may be able to rely on the kludgy
    disable-output-escaping="yes" on xsl:value-of or xsl:text. It's not
    guaranteed to work if the XSLT processor is not in direct control of the
    serializer, if any (e.g. the processor may actually output a DOM object,
    thus rendering d-o-e ineffective... Netscape/Mozilla comes to mind).
     
    Mike Brown, Sep 4, 2003
    #2
    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. Angus Parvis

    XSL: escape ' character

    Angus Parvis, Aug 27, 2004, in forum: XML
    Replies:
    1
    Views:
    4,816
    David Carlisle
    Aug 27, 2004
  2. Replies:
    1
    Views:
    3,613
    A. Bolmarcich
    May 27, 2005
  3. Replies:
    3
    Views:
    1,020
    Joe Kesselman
    Feb 9, 2007
  4. Wizfrog
    Replies:
    1
    Views:
    780
    Martin Honnen
    Jul 25, 2007
  5. slomo
    Replies:
    5
    Views:
    1,546
    Duncan Booth
    Dec 2, 2007
Loading...

Share This Page