Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Page 5 of 5
import org.apache.xalan.xslt.*;
...
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
processor.process(new XSLTInputSource(sourceDoc.getDocumentElement(),
new XSLTInputsource("http://mymachine.com/updateAddress.xsl"),
new XSLTResultTarget(newDoc.getDocumentElement());
sourceDoc = newDoc;
...
To many of us Java programmers, XML is a relatively new technology that we need to master. This article shows that the manual parsing and processing of an XML document is only one option, and that we may be able to use of XPath expressions and XSL stylesheets to avoid a lot of parsing and iterating, thus reducing the amount of code that we need to write. Moreover, under this system the information about how the data is processed is stored externally and can be changed without recompiling the application. The mechanisms described here can be used for the creation of presentation data for a Web application, but can also be applied in all cases in which XML data needs to be processed.
Read more about Core Java in JavaWorld's Core Java section.