Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Java and JDOM2

  1. #1
    Junior Member
    Join Date
    Dec 2017
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Java and JDOM2

    Hi,

    I'm new to these forums so I hope I put this post in the right spot. I have an application I'm developing using JDOM2. I read in an XML file, convert it to a scene graph, and then take that scene graph and write it out as a different XML document. My problem is, all of the things in the first document I don't' necessarily want in the output document. I want to essentially prune the tree that's created when I read in the first XML document and write out the remaining nodes to the output XML document. Right now what is going on is it is reading the XML document correctly, but outputting the document with the tags out of order and it is keeping the tags that I thought I removed from the first document.

  2. #2

    Default Re: Java and JDOM2

    JDOM is an in-memory XML model that can be used to read, write, create and modify XML Documents. JDOM is designed only for Java and uses the natural Java-specific features that the DOM model avoids.

  3. #3
    Junior Member
    Join Date
    Sep 2018
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Java and JDOM2

    Java is one of the most popular and widely used programming language and platform. A platform is an environment that helps to develop and run programs written in any programming language.
    Java is fast, reliable and secure. From desktop to web applications, scientific supercomputers to gaming consoles, cell phones to the Internet, Java is used in every nook and corner.

    JDOM parser can be used to read XML, parse xml and write XML file after updating content of it. It stores JDOM2 document in memory to read and modify it’s values.

    After loading XML document into memory, JDOM2 maintains a strict parent-child type relationship. Parent-type JDOM instances (Parent) have methods to access their content, and Child-type JDOM instances (Content) have methods to access their Parent.

Similar Threads

  1. [Asking JDOM2] Save List in XML
    By ardisamudra in forum Java Theory & Questions
    Replies: 2
    Last Post: December 1st, 2012, 06:11 PM