Digester and illegal characters

Discussion in 'Java' started by Markos Charatzas, Mar 5, 2004.

  1. Hello all,

    I'm using digester to parse a dynamically generated xml document.
    The problem is that some text content contains some *illegal* characters
    that cause digester to complain (e.g. '&').

    I'm not sure whether or not there is some sort of setting so as to make
    digester ignore such characters, or another workaround.

    Since the xml file is generated dynamically and from many different
    sources, I need to encode each of these texts prior to feeding them to
    digester, and also once the digester is done parsing I also need to go
    through every object and decode the text back again which leads to
    all sorts of problems.

    E.g.
    Every time a new text is introduced which is involved in the xml file
    generation it needs to be encoded.
    An interface needs to be provided for all of the objects generated so as
    to decode each of their details back.

    Any help much appreciated.

    Thanks in advance,
    Markos Charatzas
     
    Markos Charatzas, Mar 5, 2004
    #1
    1. Advertising

  2. Markos Charatzas

    Sudsy Guest

    Markos Charatzas wrote:
    > Hello all,
    >
    > I'm using digester to parse a dynamically generated xml document.
    > The problem is that some text content contains some *illegal* characters
    > that cause digester to complain (e.g. '&').


    You might want to use CDATA. See
    <http://www.w3.org/TR/2004/REC-xml-20040204/#sec-cdata-sect>
     
    Sudsy, Mar 5, 2004
    #2
    1. Advertising

  3. From a quick look it seems like it works!

    You are a life saviour!

    Thanks a million.

    On Fri, 05 Mar 2004 03:13:12 -0500, Sudsy <> wrote:

    >
    > Markos Charatzas wrote:
    >> Hello all,
    >>
    >> I'm using digester to parse a dynamically generated xml document.
    >> The problem is that some text content contains some *illegal*
    >> characters that cause digester to complain (e.g. '&').

    >
    > You might want to use CDATA. See
    > <http://www.w3.org/TR/2004/REC-xml-20040204/#sec-cdata-sect>
    >
     
    Markos Charatzas, Mar 5, 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. Ruben Stranders

    Parsing a composite pattern with Digester

    Ruben Stranders, Jul 17, 2003, in forum: Java
    Replies:
    0
    Views:
    528
    Ruben Stranders
    Jul 17, 2003
  2. CG

    Digester package

    CG, Sep 16, 2003, in forum: Java
    Replies:
    0
    Views:
    503
  3. marcelino
    Replies:
    0
    Views:
    499
    marcelino
    Jan 26, 2004
  4. Vincent Fuchs

    can't make addSetTop work with Digester

    Vincent Fuchs, Dec 21, 2004, in forum: Java
    Replies:
    2
    Views:
    568
  5. Replies:
    3
    Views:
    179
Loading...

Share This Page