[jdom-interest] How would I generate this XML

tsasala at hifusion.com tsasala at hifusion.com
Fri Jul 14 04:09:16 PDT 2000


	This sounds reasonable to me.  Rather than check for one element, 
can't you designate one element as the root.  I remember seeing
a setRoot method at one point (or something similar). 

	-Tom

Jason Hunter wrote:
> 
> > his samples. Whilst playing around with it, I found it difficult to
> > generate the following XML
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <!-- Yusuf's first comment -->
> >
> > <GREETING>
> >   Hello JDOM!
> > </GREETING>
> 
> Yes, it's tricky to create this document.  You have to be sneaky and
> pass in a null root element to the constructor, then add the comment,
> then set the real root element.  One method that was unintentionally
> left out of the API is a Document.setMixedContent() method.  That would
> make this possible without being sneaky.  Apparently this method doesn't
> get much use since no one mentioned anything and I only realized it was
> missing two days ago.  :-)  It's something to fix before beta5.
> 
> BTW, on setMixedContent() I'm suspect we should verify there's only
> *one* Element present in the specified list to keep a document from
> having two root elements, and we should throw an IllegalAddException or
> something similar if necessary.  Anyone see a reason not to?  And no,
> it's not enough to return null in this case!  :-)
> 
> -jh-
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



More information about the jdom-interest mailing list