The two files are then parsed into memory using an XML parser such as Xerces or Crimson, and the transformation is performed.But when the XSLT processor is invoked programmatically, you are not limited to using static files.A program listening to those SAX events will not realize that the data file is CSV rather than XML; it sees only the events. In this model, the XSLT processor interprets the SAX events as XML data and uses a normal stylesheet to perform the transformation.The interesting aspect of this model is that we can easily write custom SAX parsers for other file formats, making XSLT a useful transformation language for just about any legacy application data.* @param schema Location * @throws SAXException */ public CCRV1Schema Validator(String schema Location) throws SAXException /** * Writes a document using its DOM representation.* @param document the document * @param file the file, on the local file system.
Embedding the processor into a Java application is generally a matter of including one or two JAR files on the CLASSPATH and then invoking the appropriate methods.
This chapter is devoted to Java and XSLT programming techniques that work for both standalone applications as well as servlets, with a particular emphasis on Sun's Java API for XML Processing (JAXP) API.
In Chapter 6, we will apply these techniques to servlets, taking into account issues such as concurrency, deployment, and performance.
* @param xml File Name The name of an XML input file.
* @param xslt File Name The name of an XSLT stylesheet.