Ignoring ampersand characters

Discussion in 'XML' started by Andy Coleman, Sep 24, 2004.

  1. Andy Coleman

    Andy Coleman Guest


    I am trying to pasrse an XML message fed from another system. It is
    not forming the XML correctly and is modifying '&' characters in the
    text. So when it has text such as 'this&that' it does not generate
    'this&that' but leaves it as 'this&that'.

    I have asked the people who generate the xml message to change their
    software to work correctly but is there a way I can get around this in
    the meantime.

    I am using xerces SAX parser version 2.6.2

    Thanks for the help.

    Andy Coleman, Sep 24, 2004
    1. Advertisements

  2. Not from inside the XML code. But you could run it through something
    first to convert the ampersands. On a unix system

    sed 's/&/\&/g'

    will do it.

    -- Richard
    Richard Tobin, Sep 24, 2004
    1. Advertisements

  3. Andy Coleman

    Andy Coleman Guest

    Thanks Richard, I had come to the same conclusion myself.

    Andy Coleman, Sep 25, 2004
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.