jcreek.cke.importexport.xml
Class DOMdocumentSerializer

java.lang.Object
  extended byorg.apache.xml.serialize.BaseMarkupSerializer
      extended byorg.apache.xml.serialize.XMLSerializer
          extended byjcreek.cke.importexport.xml.DOMdocumentSerializer
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.ext.DeclHandler, org.xml.sax.DocumentHandler, org.apache.xml.serialize.DOMSerializer, org.xml.sax.DTDHandler, org.xml.sax.ext.LexicalHandler, org.apache.xml.serialize.Serializer

public class DOMdocumentSerializer
extends org.apache.xml.serialize.XMLSerializer

The intention of this class is to gather methods for serialization of DOM documents to various output formats.

Author:
Stein L. Tomassen, NTNU 2002

Field Summary
 
Fields inherited from class org.apache.xml.serialize.BaseMarkupSerializer
_docTypePublicId, _docTypeSystemId, _format, _indenting, _prefixes, _printer, _started
 
Constructor Summary
DOMdocumentSerializer()
           
 
Method Summary
 void saveToFile(java.lang.String doc, java.lang.String filename)
          Saves the specified document to a specified file.
 void serializeToFile(org.w3c.dom.Document doc, java.lang.String filename)
          Serializes the specified DOM document to a specified file.
 java.lang.String serializeToString(org.w3c.dom.Document doc)
          Serializes the specified DOM document to a String.
 java.io.StringReader serializeToStringReader(org.w3c.dom.Document doc)
          Serializes the specified DOM document to a String Reader.
 
Methods inherited from class org.apache.xml.serialize.XMLSerializer
endElement, endElement, getEntityRef, serializeElement, setOutputFormat, startDocument, startElement, startElement
 
Methods inherited from class org.apache.xml.serialize.BaseMarkupSerializer
asContentHandler, asDocumentHandler, asDOMSerializer, attributeDecl, characters, characters, comment, comment, content, elementDecl, endCDATA, endDocument, endDTD, endEntity, endNonEscaping, endPrefixMapping, endPreserving, enterElementState, externalEntityDecl, getElementState, getPrefix, ignorableWhitespace, internalEntityDecl, isDocumentState, leaveElementState, notationDecl, prepare, printDoctypeURL, printEscaped, printEscaped, printText, printText, processingInstruction, reset, serialize, serialize, serialize, serializeNode, serializePreRoot, setDocumentLocator, setOutputByteStream, setOutputCharStream, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startNonEscaping, startPrefixMapping, startPreserving, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMdocumentSerializer

public DOMdocumentSerializer()
Method Detail

serializeToFile

public void serializeToFile(org.w3c.dom.Document doc,
                            java.lang.String filename)
Serializes the specified DOM document to a specified file.

Parameters:
doc - the DOM document to serialize.
filename - the filename to serialize to.

saveToFile

public void saveToFile(java.lang.String doc,
                       java.lang.String filename)
Saves the specified document to a specified file.

Parameters:
doc - the document to save.
filename - the filename to serialize to.

serializeToStringReader

public java.io.StringReader serializeToStringReader(org.w3c.dom.Document doc)
Serializes the specified DOM document to a String Reader.

Parameters:
doc - the DOM document to serialize.
Returns:
the serialized DOM document as a String Reader if everything goes well, does otherwise return null.
See Also:
StringReader

serializeToString

public java.lang.String serializeToString(org.w3c.dom.Document doc)
Serializes the specified DOM document to a String.

Parameters:
doc - the DOM document to serialize.
Returns:
the serialized DOM document as a String if everything goes well, does otherwise return null.


Created at IDI, NTNU by the Artificial Intelligence and Learning group