org.grinvin.xml
Class XMLUtils
public final class XMLUtils
extends java.lang.Object
Helper methods for XML-processing.
static Element | loadFromClassPath(ClassLoader classLoader, String filename) - Converts the given XML file into a JDOM element.
|
static Element | loadFromClassPath(String filename) - Converts the given XML file into a JDOM element.
|
loadFromClassPath
public static Element loadFromClassPath(ClassLoader classLoader,
String filename)
throws IOException
Converts the given XML file into a JDOM element. The file will
be loaded by the given class loader and all external entities (mainly DTDs)
are searched for in the package org.grinvin.dtds
, but
resolved by the class loader of this class.
classLoader
- Class loader to be used for loading the XML file.filename
- Filename relative to the root of the class path, must not start
with a slash (/).
- the JDOM element corresponding to the root of file,
or null if the file did not exist.
loadFromClassPath
public static Element loadFromClassPath(String filename)
throws IOException
Converts the given XML file into a JDOM element. The file should
reside in the class path, and all external entities (mainly DTDs)
are searched for in the package
org.grinvin.dtds
, also
in the class path.
Has the same effect as a call to
loadFromClassPath(ClassLoader,String)
with the class loader of this class as a first parameter.
filename
- Filename relative to the root of the class path, must not start
with a slash (/).
- the JDOM element corresponding to the root of file,
or null if the file did not exist.