|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsamples.transform.XMLToFastInfosetSAXSerializer
public class XMLToFastInfosetSAXSerializer
Serializes an XML input stream into FI document using SAXDocumentSerializer defined in the fastinfoset.sax package.
The sample demonstrates how to use SAXDocumentSerializer as a SAX handler and JAXP transformer to convert an XML file into a FI document. As shown in the sample, transforming a DOM source to SAX Result involves very little coding. However, the process may not be efficient due to the construction of DOM source. In the sample, a DOMSource is constructed out of an XML file input (see method getDOMSource) and a SAXResult instantiated using an instance of SAXDocumentSerializer as the handler which takes a FI document as OutputStream (see method getSAXResult). The sample then calls transformer's tranform method to convert the XML file into the FI document.
| Constructor Summary | |
|---|---|
XMLToFastInfosetSAXSerializer()
Creates a new instance of FISerializer |
|
| Method Summary | |
|---|---|
static void |
main(String[] args)
Starts the sample |
void |
write(File input,
File output)
Transform an XML file into a FI document. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLToFastInfosetSAXSerializer()
| Method Detail |
|---|
public void write(File input,
File output)
input - an XML file inputoutput - the FI document outputpublic static void main(String[] args)
args - XML input file name and FI output document name
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||