*/
public class JDOMParser extends XMLParser2 {
public Object parseXML(InputStream stream) {
if (!isNamespaceAware()) {
throw new JXPathException("JDOM parser configuration error. JDOM "
+ "does not support the namespaceAware=false setting.");
}
try {
SAXBuilder builder = new SAXBuilder();
builder.setExpandEntities(isExpandEntityReferences());
builder.setIgnoringElementContentWhitespace(
isIgnoringElementContentWhitespace());
builder.setValidation(isValidating());
return builder.build(stream);
}
catch (Exception ex) {
throw new JXPathException("JDOM parser error", ex);
}
}