The version is hard to remember. Last year's
+ --Org. JDOM. Input. saxbuilder
Builds a JDOM document From files, streams, readers, URLs, or a sax inputsource instance using a SAX Parser. the builder uses a third-party SAX Parser (chosen by JAXP by default, or you can choose manually) to handle the parsing duties and simply listens to the sax events to construct a document.
+ --Org. JDOM. Input. dombuilder
Builds a JDOM org. JDOM. document from a pre-existing Dom org. W3C. Dom. Document. Also handy for testing builds from files to sanity check saxbuilder.
+ --Org. JDOM. Output. xmloutputter
The outputter can manage styles of document formatting, From untouched to pretty printed. The default is to output the document content exactly as created, but this can be changed by setting a new format object.
VoidOutput(Document DOC, java. Io. outputstream out)
This will print the document to the given output stream.
+ --Org. JDOM .*
Structure
Document
Doctype
Comment
Element
Attribute
Processinginstruction
Data Types
CDATA
Text
Namespace
Entityref
Others
Defaultjdomfactory
Creates the standard top-level JDOM classes (element, document, comment, etc). A subclass of this factory might construct custom classes.
Uncheckedjdomfactory
Special factory for building documents without any content or structure checking.
Verifier
A utility class to handle well-formedness checks on names, data, and other verification tasks for JDOM. The class is final and may not be subclassed.
Content
Superclass for JDOM objects which can be legal child content of parent nodes. Such as comment, doctype, element, entityref, processinginstruction, text
<Maid Index = "6"> 8 </maid>
The first thing that occurs to me is this:
Element element = new element ("maid ");
Element. settext ("8 ");
Element. setattribute ("Index", "6 ");
<Sequence>
<Number> 3 </number>
<Number> 5 </number>
</Sequence>
First you need to create three element objects, two for number elements and one for the sequence element. then you need to add the number elements to the sequence element in the order you want them to appear. for example,
Element element = new element ("sequence ");
Element firstnumber = new element ("Number ");
Element secondnumber = new element ("Number ");
Firstnumber. settext ("3 ");
Secondnumber. settext ("5 ");
Element. addcontent (firstnumber );
Element. addcontent (secondnumber );