what's wrong with Xerces Parser????

Discussion in 'Java' started by Elhanan, Mar 8, 2005.

  1. Elhanan

    Elhanan Guest

    it took me hours to figure out, i tested on ecplise a small java
    application, that builds an XML dom, it returned the string using the
    toStrimg method, however when i turned it into a Web Service under
    tomcat 4.24 it returned null!! only then i noticed i was using
    different parsers, the first, crimson (i think it came with axis)
    worked find while the second (tomcat's) returned null, why??
    Elhanan, Mar 8, 2005
    #1
    1. Advertising

  2. Elhanan

    Daniel Tryba Guest

    Elhanan <> wrote:
    > it took me hours to figure out, i tested on ecplise a small java
    > application, that builds an XML dom, it returned the string using the
    > toStrimg method, however when i turned it into a Web Service under
    > tomcat 4.24 it returned null!! only then i noticed i was using
    > different parsers, the first, crimson (i think it came with axis)
    > worked find while the second (tomcat's) returned null, why??


    Been there, done that, found the answer by searching in xerces docs for
    deferred node implementations.
    Daniel Tryba, Mar 8, 2005
    #2
    1. Advertising

  3. Elhanan

    Elhanan Guest

    u mean by setting this:
    http://apache.org/xml/features/dom/defer-node-expansion
    to false?

    but in order to change it to false
    i'll need to change
    http://apache.org/xml/properties/dom/document-class-name

    to some other class (will is till work under tomcat?)

    Daniel Tryba wrote:
    > Elhanan <> wrote:
    > > it took me hours to figure out, i tested on ecplise a small java
    > > application, that builds an XML dom, it returned the string using

    the
    > > toStrimg method, however when i turned it into a Web Service under
    > > tomcat 4.24 it returned null!! only then i noticed i was using
    > > different parsers, the first, crimson (i think it came with axis)
    > > worked find while the second (tomcat's) returned null, why??

    >
    > Been there, done that, found the answer by searching in xerces docs

    for
    > deferred node implementations.
    Elhanan, Mar 9, 2005
    #3
  4. Elhanan

    Daniel Tryba Guest

    Elhanan <> wrote:

    Please don't TOFU

    > u mean by setting this:
    > http://apache.org/xml/features/dom/defer-node-expansion
    > to false?


    No. There are good reasons to use defered nodes (although I can't
    remember which :)

    > to some other class (will is till work under tomcat?)


    If you want the xml as a string you should use a Transformer don't have
    to know anything about the actual xml implementation, somthing like:

    factory=TransformerFactory.newInstance();
    transformer=factory.newTransformer();
    transformer.transform(xmlSource, new StreamResult(out));
    Daniel Tryba, Mar 9, 2005
    #4
    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. Andy Fish
    Replies:
    3
    Views:
    352
    Andy Fish
    Nov 19, 2003
  2. Helen
    Replies:
    0
    Views:
    810
    Helen
    Mar 2, 2004
  3. Daniel Ng
    Replies:
    0
    Views:
    1,392
    Daniel Ng
    Jul 8, 2003
  4. Sylwester Ba³a

    Xerces parser XML and Visual C++ 6.0

    Sylwester Ba³a, Jul 22, 2003, in forum: XML
    Replies:
    2
    Views:
    951
    Sylwester Ba³a
    Jul 23, 2003
  5. cvissy
    Replies:
    0
    Views:
    601
    cvissy
    Nov 16, 2004
Loading...

Share This Page