jlibs.xml.sax
Class XMLDocument

java.lang.Object
  extended by jlibs.xml.sax.XMLDocument

public class XMLDocument
extends Object

This class is used to write xml documents

Author:
Santhosh Kumar T

Constructor Summary
XMLDocument(Result result, boolean omitXMLDeclaration, int indentAmount, String encoding)
           
XMLDocument(SAXDelegate xml)
           
 
Method Summary
 XMLDocument add(SAXProducer saxProducer)
           
 XMLDocument add(SAXProducer saxProducer, QName qname)
           
 XMLDocument add(SAXProducer saxProducer, String name)
           
 XMLDocument add(SAXProducer saxProducer, String uri, String name)
           
 XMLDocument addAttribute(String name, String value)
           
 XMLDocument addAttribute(String uri, String name, String value)
           
 XMLDocument addCDATA(String text)
           
 XMLDocument addCDATAElement(String name, String text)
           
 XMLDocument addCDATAElement(String uri, String name, String text)
           
 XMLDocument addComment(String text)
           
 XMLDocument addElement(String name, String text)
           
 XMLDocument addElement(String name, String text, boolean cdata)
           
 XMLDocument addElement(String uri, String name, String text)
           
 XMLDocument addElement(String uri, String name, String text, boolean cdata)
           
 XMLDocument addProcessingInstruction(String target, String data)
           
 XMLDocument addPublicDTD(String name, String publicId, String systemID)
           
 XMLDocument addSystemDTD(String name, String systemId)
           
 XMLDocument addText(String text)
           
 XMLDocument addXML(InputSource is, boolean excludeRoot)
           
 XMLDocument addXML(String xmlString, boolean excludeRoot)
           
 String declarePrefix(String uri)
           
 boolean declarePrefix(String prefix, String uri)
           
 XMLDocument endDocument()
           
 XMLDocument endElement()
           
 XMLDocument endElement(String name)
           
 XMLDocument endElement(String uri, String name)
           
 XMLDocument endElements()
           
 XMLDocument endElements(String name)
           
 XMLDocument endElements(String uri, String name)
           
 void error(String msg, Exception ex)
           
 void fatalError(String msg, Exception ex)
           
 int getDepth()
           
 MyNamespaceSupport getNamespaceSupport()
           
static void main(String[] args)
           
 int mark()
           
 int release()
           
 void release(int mark)
           
 XMLDocument startDocument()
           
 XMLDocument startElement(String name)
           
 XMLDocument startElement(String uri, String name)
           
 void suggestPrefix(String prefix, String uri)
           
 String toAttrQName(String uri, String localPart)
           
 String toQName(String uri, String localPart)
           
 void warning(String msg, Exception ex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLDocument

public XMLDocument(SAXDelegate xml)

XMLDocument

public XMLDocument(Result result,
                   boolean omitXMLDeclaration,
                   int indentAmount,
                   String encoding)
            throws TransformerConfigurationException
Throws:
TransformerConfigurationException
Method Detail

startDocument

public XMLDocument startDocument()
                          throws SAXException
Throws:
SAXException

endDocument

public XMLDocument endDocument()
                        throws SAXException
Throws:
SAXException

getNamespaceSupport

public MyNamespaceSupport getNamespaceSupport()

suggestPrefix

public void suggestPrefix(String prefix,
                          String uri)

declarePrefix

public String declarePrefix(String uri)

declarePrefix

public boolean declarePrefix(String prefix,
                             String uri)

toQName

public String toQName(String uri,
                      String localPart)

toAttrQName

public String toAttrQName(String uri,
                          String localPart)

getDepth

public int getDepth()

mark

public int mark()
         throws SAXException
Throws:
SAXException

release

public int release()
            throws SAXException
Throws:
SAXException

release

public void release(int mark)
             throws SAXException
Throws:
SAXException

startElement

public XMLDocument startElement(String name)
                         throws SAXException
Throws:
SAXException

startElement

public XMLDocument startElement(String uri,
                                String name)
                         throws SAXException
Throws:
SAXException

addElement

public XMLDocument addElement(String name,
                              String text,
                              boolean cdata)
                       throws SAXException
Throws:
SAXException

addElement

public XMLDocument addElement(String uri,
                              String name,
                              String text,
                              boolean cdata)
                       throws SAXException
Throws:
SAXException

addElement

public XMLDocument addElement(String name,
                              String text)
                       throws SAXException
Throws:
SAXException

addElement

public XMLDocument addElement(String uri,
                              String name,
                              String text)
                       throws SAXException
Throws:
SAXException

addCDATAElement

public XMLDocument addCDATAElement(String name,
                                   String text)
                            throws SAXException
Throws:
SAXException

addCDATAElement

public XMLDocument addCDATAElement(String uri,
                                   String name,
                                   String text)
                            throws SAXException
Throws:
SAXException

addAttribute

public XMLDocument addAttribute(String name,
                                String value)
                         throws SAXException
Throws:
SAXException

addAttribute

public XMLDocument addAttribute(String uri,
                                String name,
                                String value)
                         throws SAXException
Throws:
SAXException

addText

public XMLDocument addText(String text)
                    throws SAXException
Throws:
SAXException

addCDATA

public XMLDocument addCDATA(String text)
                     throws SAXException
Throws:
SAXException

endElement

public XMLDocument endElement(String uri,
                              String name)
                       throws SAXException
Throws:
SAXException

endElement

public XMLDocument endElement(String name)
                       throws SAXException
Throws:
SAXException

endElement

public XMLDocument endElement()
                       throws SAXException
Throws:
SAXException

endElements

public XMLDocument endElements(String uri,
                               String name)
                        throws SAXException
Throws:
SAXException

endElements

public XMLDocument endElements(String name)
                        throws SAXException
Throws:
SAXException

endElements

public XMLDocument endElements()
                        throws SAXException
Throws:
SAXException

warning

public void warning(String msg,
                    Exception ex)
             throws SAXException
Throws:
SAXException

error

public void error(String msg,
                  Exception ex)
           throws SAXException
Throws:
SAXException

fatalError

public void fatalError(String msg,
                       Exception ex)
                throws SAXException
Throws:
SAXException

addXML

public XMLDocument addXML(String xmlString,
                          boolean excludeRoot)
                   throws SAXException
Throws:
SAXException

addXML

public XMLDocument addXML(InputSource is,
                          boolean excludeRoot)
                   throws SAXException
Throws:
SAXException

addProcessingInstruction

public XMLDocument addProcessingInstruction(String target,
                                            String data)
                                     throws SAXException
Throws:
SAXException

addComment

public XMLDocument addComment(String text)
                       throws SAXException
Throws:
SAXException

add

public XMLDocument add(SAXProducer saxProducer)
                throws SAXException
Throws:
SAXException

add

public XMLDocument add(SAXProducer saxProducer,
                       String name)
                throws SAXException
Throws:
SAXException

add

public XMLDocument add(SAXProducer saxProducer,
                       String uri,
                       String name)
                throws SAXException
Throws:
SAXException

add

public XMLDocument add(SAXProducer saxProducer,
                       QName qname)
                throws SAXException
Throws:
SAXException

addPublicDTD

public XMLDocument addPublicDTD(String name,
                                String publicId,
                                String systemID)
                         throws SAXException
Throws:
SAXException

addSystemDTD

public XMLDocument addSystemDTD(String name,
                                String systemId)
                         throws SAXException
Throws:
SAXException

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 2015. All rights reserved.