[jdom-interest] newbie - help with document level comments (T YPO in orginal message)

philip.nelson at omniresources.com philip.nelson at omniresources.com
Mon May 14 13:42:37 PDT 2001


I think the way is to getMixedContent on the document.  This is a live List
so you can add at a specific indexed location rather than just using
addContent which adds to the list at the end.

> 
> Sorry, but I had a typo in the original message- "root.addContent(..."
> should have been - "xmlDoc.addContent(.....
> 
> I'm creating an XML document using the Beta 6 release.  I create the
> document with - "Document xmlDoc = new Document(root);"
> Interspersed with adding elements to the "root" and children to these
> elements, I add comments at the document level with - 
> "xmlDoc.addContent(new
> Comment("doc level comment"));.  When the process finishes 
> all the document
> level comments appear at the end of the file.   I want the comments to
> appear at the beginning of the document before the "root" 
> element.  Is this
> possible?  I haven't figured out any way to do it.   Thanks 
> in advance for
> any help.
> Frank
> 
> 
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/yo
uraddr at yourhost.com



More information about the jdom-interest mailing list