| 
 | Oracle® WebCenter Content Site Studio for External Applications Java API Reference 11g Release 1 (11.1.1) E17273-03 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
   oracle.stellent.wcm.common.xml.XMLHelper
oracle.stellent.wcm.common.xml.XMLHelper
public class XMLHelper
XML Helper methods for working with DOM structures
| Field Summary | |
|---|---|
| protected static java.lang.String | AMP_REF | 
| protected static java.lang.String | APOS_REF | 
| protected static java.lang.String | CHAR_REF_START | 
| protected static java.lang.String | GT_REF | 
| protected static java.lang.String | LT_REF | 
| protected static java.lang.String | QUOT_REF | 
| Constructor Summary | |
|---|---|
| XMLHelper() | |
| Method Summary | |
|---|---|
| static javax.xml.transform.Transformer | createPrettyPrintTransformer()Create a transformer class with the pretty print flags | 
| static java.lang.String | encodeXml(java.lang.String text)Encode the string for XML. | 
| static java.lang.String | encodeXmlForJson(java.lang.String xmlString)Encode XML string to Json compliant xml string | 
| static int | getAttributeAsInt(org.w3c.dom.Element element, java.lang.String name, int defaultValue)Retrieve the attribute value as an integer | 
| static long | getAttributeAsLong(org.w3c.dom.Element element, java.lang.String name, long defaultValue)Retrieve the attribute value as a long | 
| static java.util.Map<java.lang.String,java.lang.String> | getAttributes(org.w3c.dom.Element element)Retrieve the attributes from the given element as a mapping of String name to String value | 
| static org.w3c.dom.Document | parseXML(org.xml.sax.InputSource xmlSource, boolean validating, boolean namespaceAware)Parse xml from InputSource. | 
| static org.w3c.dom.Document | parseXML(java.io.InputStream xmlStream, boolean validating, boolean namespaceAware)Parse xml from the inputstream. | 
| static org.w3c.dom.Document | parseXML(java.io.Reader xmlReader, boolean validating, boolean namespaceAware)Parse xml from the Reader. | 
| static void | serialize(org.w3c.dom.Node rootNode, java.io.OutputStream out)Pretty prints the XML to the specified output stream | 
| static void | serialize(org.w3c.dom.Node rootNode, java.io.Writer out)Pretty prints the XML to the specified output stream | 
| static java.lang.String | toString(org.w3c.dom.Node rootNode)Pretty prints the XML and returns it as a stream | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected static final java.lang.String AMP_REF
protected static final java.lang.String APOS_REF
protected static final java.lang.String GT_REF
protected static final java.lang.String LT_REF
protected static final java.lang.String QUOT_REF
protected static final java.lang.String CHAR_REF_START
| Constructor Detail | 
|---|
public XMLHelper()
| Method Detail | 
|---|
public static java.util.Map<java.lang.String,java.lang.String> getAttributes(org.w3c.dom.Element element)
element - the element
public static int getAttributeAsInt(org.w3c.dom.Element element,
                                    java.lang.String name,
                                    int defaultValue)
element - the elementname - the attribute namedefaultValue - the default value
public static long getAttributeAsLong(org.w3c.dom.Element element,
                                      java.lang.String name,
                                      long defaultValue)
element - the elementname - the attribute namedefaultValue - the default value
public static java.lang.String toString(org.w3c.dom.Node rootNode)
                                 throws javax.xml.transform.TransformerException
rootNode - the root node of the XML document to displayjavax.xml.transform.TransformerExceptionpublic static java.lang.String encodeXml(java.lang.String text)
text - the unencoded text
public static org.w3c.dom.Document parseXML(java.io.InputStream xmlStream,
                                            boolean validating,
                                            boolean namespaceAware)
                                     throws java.io.IOException,
                                            javax.xml.parsers.ParserConfigurationException,
                                            org.xml.sax.SAXException
xmlStream - the stream to the XML contentvalidating - true to validate the XMLnamespaceAware - true to make the parser namespace awarejava.io.IOExceptionjavax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXException
public static org.w3c.dom.Document parseXML(java.io.Reader xmlReader,
                                            boolean validating,
                                            boolean namespaceAware)
                                     throws java.io.IOException,
                                            javax.xml.parsers.ParserConfigurationException,
                                            org.xml.sax.SAXException
xmlReader - the reader to the XML contentvalidating - true to validate the XMLnamespaceAware - true to make the parser namespace awarejava.io.IOExceptionjavax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXException
public static org.w3c.dom.Document parseXML(org.xml.sax.InputSource xmlSource,
                                            boolean validating,
                                            boolean namespaceAware)
                                     throws java.io.IOException,
                                            javax.xml.parsers.ParserConfigurationException,
                                            org.xml.sax.SAXException
xmlSource - the inputSource to the XML contentvalidating - true to validate the XMLnamespaceAware - true to make the parser namespace awarejava.io.IOExceptionjavax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXException
public static void serialize(org.w3c.dom.Node rootNode,
                             java.io.OutputStream out)
                      throws javax.xml.transform.TransformerException
rootNode - the root node of the XML document to displayout - the output streamjavax.xml.transform.TransformerException
public static void serialize(org.w3c.dom.Node rootNode,
                             java.io.Writer out)
                      throws javax.xml.transform.TransformerException
rootNode - the root node of the XML document to displayout - the output streamjavax.xml.transform.TransformerException
public static javax.xml.transform.Transformer createPrettyPrintTransformer()
                                                                    throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerExceptionpublic static java.lang.String encodeXmlForJson(java.lang.String xmlString)
xmlString - the string to encode| 
 | Oracle® WebCenter Content Site Studio for External Applications Java API Reference 11g Release 1 (11.1.1) E17273-03 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||