Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Jeff Higgins Newsgroups: comp.lang.java.programmer Subject: Re: includes in xml-files? Date: Fri, 04 Nov 2011 20:41:13 -0400 Organization: A noiseless patient Spider Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 5 Nov 2011 00:41:01 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="LeYHhbGybw/UJKDU4EuZlA"; logging-data="27124"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/55aeo0xhHq0uZ2a0HI7Q7JYJ7qV6Y+so=" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20111004 Icedove/3.0.11 In-Reply-To: Cancel-Lock: sha1:QOsDdxOoRGZnyeBdLVEFEdmzqFc= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9545 On 11/04/2011 01:12 AM, Magnus Warker wrote: > Hi, > > I have an XML-File in the classpath and I read it in with > getResourceAsStream (Pseudocode): > > InputStream stm = class.getResourceAsStream (...); > DocumentBuilderFactory ftr = DocumentBuilderFactory.newInstance (); > ftr.setIgnoringComments (true); > DocumentBuilder bld = ftr.newDocumentBuilder(); > Document doc = bld.parse (stm); > > Now I would like to source out some of the contents into separate > xml-files and include them into the main file. > > Is this possible, in particular when the files are loaded as resource > stream? > > How can I do that? WhatÄs the syntax for the include directives? > XInclude? I haven't used it, so I don't know how well it's supported. I think JAXP has some support.