Code example for DOMException

0
        	throw new DOMException((short) 0, "exception caught while munching XML document: " + e.getMessage());
		} finally { 
				try { 
					pool.returnObject(saxParser);
				} catch (Exception e) {
					throw new DOMException((short) 0, "exception caught while munching XML document: " + e.getMessage());
				} 
		} 
    } 
 
    /** 
     * This method takes a given document path and localizes - i.e. truncates - 
     * it to the suffix left over when matching the given XPath expression 
     * against the path. 
     * 
     * @param xpathExpression the XPath expression translated to a regular expression 
     * @param path            the path to localize 
     * @return <code>null</code>, if the XPath expression does not match the 
     *         given path, the localized path suffix otherwise. Note that 
     *         <code>""</code> is returned as a suffix when the XPath expression 
     *         fully matches the path.