Re: includes in xml-files?
On 11/4/2011 8:14 PM, Arne Vajh?j wrote:
On 11/4/2011 1:12 AM, Magnus Warker wrote:
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?
XML is more a family of languages than it is a language.
So I would expect includes to be done using an element
specific for the particular XML dialect.
This also means that the XML parser itself can not do
the processing, but the application will need to handle
that.
XML schemas use:
http://www.w3schools.com/schema/el_include.asp
JSP pages use:
http://java.sun.com/products/jsp/tags/12/syntaxref1214.html
Facelets use:
http://www.jsftoolbox.com/documentation/facelets/10-TagReference/facelets-ui-include.html
etc..
Arne