Java Reference
In-Depth Information
result.getWriter().close();
} catch (XPathExpressionException xpee) {
out.println(xpee);
throw new IOException("Cannot parse XPath.", xpee);
} catch (DOMException dome) {
out.println(dome);
throw new IOException("Cannot create DOM tree", dome);
} catch (TransformerConfigurationException tce) {
out.println(tce);
throw new IOException("Cannot create transformer.",
tce);
} catch (IllegalArgumentException iae) {
out.println(iae);
throw new IOException("Illegal Argument.", iae);
} catch (ParserConfigurationException pce) {
out.println(pce);
throw new IOException("Cannot create parser.", pce);
} catch (SAXException saxe) {
out.println(saxe);
throw new IOException("Error reading XML document.",
saxe);
} catch (TransformerFactoryConfigurationError tfce) {
out.println(tfce);
throw new IOException("Cannot create trx factory.",
tfce);
} catch (TransformerException te) {
out.println(te);
throw new IOException("Cannot write values.", te);
}
}
}
This might not be suitable for very large documents, but will quickly and easily plug into a
program that requires you to update values on the fly for a physical file.
Search WWH ::




Custom Search