[jdom-interest] multiple xml files - one Document object

Ian Lea ian.lea at blackwell.co.uk
Tue Nov 27 06:34:09 PST 2001


Something like this might do the trick:

Document d0 new Document(new Element("allSQL"));
d0.addContent(getSQL("sql1.xml"));
d0.addContent(getSQL("sql2.xml"));
...

Element getSQL(String name) {
  Document d = new SaxBuilder().build(name);
  return d.getRootElement().detach();
}



--
Ian.
ian.lea at blackwell.co.uk

> Carey Boldenow wrote:
> 
> In our application, we have many xml documents that contain our SQL
> statements. However, upon application initialization, we would like to parse
> all these files and then store all the elements in one Document instance. If
> it matters, each of the xml files has the same DTD. Is there anyway to do this
> using JDOM along with the Parsers to do this?
> 
> Thanks for any help!
> 
> Carey Boldenow



More information about the jdom-interest mailing list