Java with xml

Discussion in 'Java' started by glin@tollnz.co.nz, Mar 7, 2005.

  1. Guest

    Hi guys, I am wondering which library to use to manipulate xml files in
    Java.

    Cheers.
     
    , Mar 7, 2005
    #1
    1. Advertising

  2. Dag Sunde Guest

    <> wrote in message
    news:...
    > Hi guys, I am wondering which library to use to manipulate xml files in
    > Java.


    GNU JAXP - The GNU Project
    Lark - Tim Bray
    Piccolo - Yuval Oren
    Xerces Java - The Apache XML Project
    XP - James Clark (Java 1.1)
    XML Pull Parser - Aleksander SlominskiJava and C++
    JDOM
    Crimson
    Ælfred
    ....

    take your pick...

    (At least I've given you some food for Google...)
    (Prefer Xerces myself)

    --
    Dag.
     
    Dag Sunde, Mar 7, 2005
    #2
    1. Advertising

  3. Guest

    cheers.
     
    , Mar 7, 2005
    #3
  4. Wendy S Guest

    <> wrote:
    > Hi guys, I am wondering which library to use to manipulate xml files in
    > Java.


    What do you want to do with the XML?

    I'm having a lot of fun with [Jakarta Commons] Digester. It's a layer on
    top of a SAX parser, originally written to parse config files and create
    objects as it goes along. The possibilities are endless...

    --
    Wendy
     
    Wendy S, Mar 7, 2005
    #4
  5. Fahd Shariff Guest

    There are three main XML parsing techniques:

    - Document Object Model (DOM),
    - Simple API for XML (SAX),
    - Streaming API for XML (StAX) - NEW

    DOM:

    Tree-based parsing technique that builds up an entire parse tree in
    memory.
    - DOM is straightforward.
    - You can access the XML document randomly because the entire tree is
    built in memory.
    - The DOM APIs allow modification of the nodes, such as appending a
    child or updating or deleting a node.

    Loading the whole document and building the entire tree structure in
    memory can be expensive, especially when the document is large. It can
    also consume a lot of memory.

    DOM parsing is appropriate when the application needs to have random
    access to the XML document. Because DOM enables you to update the
    document, it is also convenient for applications, such as XML editors,
    that need to modify data.

    SAX:

    Rather than building a tree representation of an entire document as DOM
    does, a SAX parser fires off a series of events as it reads through the
    document. These events are pushed to event handlers, which provide
    access to the contents of the document.

    The SAX model has the major advantage of low memory consumption,
    because the entire document does not need to be loaded into memory at
    one time, which enables a SAX parser to parse a document larger than
    the system memory. The disadvantages are:
    - need to implement the event handlers to handle all incoming events
    - it does not have built-in document navigation support such as that
    provided by XPath. This, coupled with its one-pass parsing, means there
    is no random access support.
    - poor choice for manipulating or modifying a document

    --
    Fahd Shariff
    http://www.fahdshariff.cjb.net
    "Let the code do the talking... "
     
    Fahd Shariff, Mar 7, 2005
    #5
  6. Intel Inside Guest

    "Wendy S" <> wrote in message
    news:mqPWd.96789$bu.70811@fed1read06...
    > <> wrote:
    >> Hi guys, I am wondering which library to use to manipulate xml files in
    >> Java.

    >
    > What do you want to do with the XML?
    >
    > I'm having a lot of fun with [Jakarta Commons] Digester. It's a layer on
    > top of a SAX parser, originally written to parse config files and create
    > objects as it goes along. The possibilities are endless...
    >
    > --
    > Wendy
    >


    Possibilities?
     
    Intel Inside, Mar 7, 2005
    #6
  7. Edmond wong Guest

    Intel Inside wrote:
    > "Wendy S" <> wrote in message
    > news:mqPWd.96789$bu.70811@fed1read06...
    >
    >><> wrote:
    >>
    >>>Hi guys, I am wondering which library to use to manipulate xml files in
    >>>Java.

    >>
    >>What do you want to do with the XML?
    >>
    >>I'm having a lot of fun with [Jakarta Commons] Digester. It's a layer on
    >>top of a SAX parser, originally written to parse config files and create
    >>objects as it goes along. The possibilities are endless...
    >>
    >>--
    >>Wendy
    >>

    >
    >
    > Possibilities?
    >
    >


    Digester only read xml file into java objects, there is a common.betwixt
    build on top of digester to do java objects to xml. But the 0.6
    has some problem, you will need to download the nightly build. Yet,
    there is another problem if you have a root class with only one
    parameter, and the parameter is a class. You can try castor or jaxb ,
    those may be more stable.

    Edmond
     
    Edmond wong, Apr 23, 2005
    #7
    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. Bomb Diggy
    Replies:
    0
    Views:
    468
    Bomb Diggy
    Jul 28, 2004
  2. Tony Prichard
    Replies:
    0
    Views:
    788
    Tony Prichard
    Dec 12, 2003
  3. Mark Van Orman

    embedding xml in xml as non-xml :)

    Mark Van Orman, Sep 14, 2004, in forum: XML
    Replies:
    5
    Views:
    508
    Patrick TJ McPhee
    Sep 15, 2004
  4. Andy
    Replies:
    0
    Views:
    560
  5. Erik Wasser
    Replies:
    5
    Views:
    518
    Peter J. Holzer
    Mar 5, 2006
Loading...

Share This Page