SAP NetWeaver '04

com.sapportals.wcm.util.xml
Class SAXSerializer

[contained in: com.sap.netweaver.bc.util.par - bc.util.public_api.jar]
com.sapportals.wcm.util.xml.SAXSerializer

public final class SAXSerializer

Simple DOM serializer. Only supports UTF-8 encoding and simple indentation (whitespace preservation not implemented - if whitespace preservation is required simply do not indent).

Copyright (c) SAP AG 2003


Field Summary
static java.lang.String NS_XML
          Namespace name for the namespace hardwired to the prefix "xml:"
static java.lang.String NS_XMLNS
          Namespace name for the namespace hardwired to the prefix "xmlns:"
 
Method Summary
 void characters(char[] chars, int offset, int length)
           
 void endDocument()
           
 void endElement(java.lang.String namespace, java.lang.String localname, java.lang.String qname)
           
 void endPrefixMapping(java.lang.String prefix)
           
static java.lang.String escape(java.lang.String s, boolean escapeQuoteChar)
          Escape characters in a string for inclusion into XML text content.
static SAXSerializer getInstance(java.io.OutputStream out, java.lang.String encoding, boolean indent)
           
static SAXSerializer getInstance(java.io.Writer writer, boolean indent)
           
 void ignorableWhitespace(char[] chars, int i, int i1)
           
 void processingInstruction(java.lang.String target, java.lang.String data)
           
 void setDocumentLocator(org.xml.sax.Locator locator)
           
 void skippedEntity(java.lang.String s)
           
 void startDocument()
           
 void startElement(java.lang.String namespace, java.lang.String localname, java.lang.String qname, org.xml.sax.Attributes attributes)
           
 void startPrefixMapping(java.lang.String prefix, java.lang.String namespace)
           
 

Field Detail

NS_XML

public static final java.lang.String NS_XML
Namespace name for the namespace hardwired to the prefix "xml:"

NS_XMLNS

public static final java.lang.String NS_XMLNS
Namespace name for the namespace hardwired to the prefix "xmlns:"
Method Detail

getInstance

public static SAXSerializer getInstance(java.io.Writer writer,
                                        boolean indent)

getInstance

public static SAXSerializer getInstance(java.io.OutputStream out,
                                        java.lang.String encoding,
                                        boolean indent)
                                 throws java.io.UnsupportedEncodingException

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String namespace)
                        throws org.xml.sax.SAXException

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws org.xml.sax.SAXException

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException

startElement

public void startElement(java.lang.String namespace,
                         java.lang.String localname,
                         java.lang.String qname,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException

endElement

public void endElement(java.lang.String namespace,
                       java.lang.String localname,
                       java.lang.String qname)
                throws org.xml.sax.SAXException

characters

public void characters(char[] chars,
                       int offset,
                       int length)
                throws org.xml.sax.SAXException

ignorableWhitespace

public void ignorableWhitespace(char[] chars,
                                int i,
                                int i1)
                         throws org.xml.sax.SAXException

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)

skippedEntity

public void skippedEntity(java.lang.String s)
                   throws org.xml.sax.SAXException

escape

public static java.lang.String escape(java.lang.String s,
                                      boolean escapeQuoteChar)
                               throws org.xml.sax.SAXException
Escape characters in a string for inclusion into XML text content. The generated string is guaranteed to only contain characters from the US-ASCII character set.
Parameters:
s - un-escaped string
escapeQuoteChar - whether to escape the quote character or not (for attribute values). Note that attributes are supposed to be quoted using double quotes, so apostroph characters are not replaced.
Returns:
escaped string
Throws:
SAXException - Exception raised in failure situation

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.