|
Oracle® Fusion Middleware Java API Reference for Oracle WebCenter Content Remote Intradoc Client (RIDC) 11g Release 1 (11.1) E17274-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.stellent.ridc.common.xml.XMLHelper
public class XMLHelper
XML Helper methods for working with DOM structures
Field Summary | |
---|---|
protected static String |
AMP_REF |
protected static String |
APOS_REF |
protected static String |
CHAR_REF_START |
protected static String |
GT_REF |
protected static String |
LT_REF |
protected static String |
QUOT_REF |
Constructor Summary | |
---|---|
XMLHelper() |
Method Summary | |
---|---|
static Transformer |
createPrettyPrintTransformer() Create a transformer class with the pretty print flags |
static String |
encodeXml(String text) Encode the string for XML. |
static int |
getAttributeAsInt(Element element, String name, int defaultValue) Retrieve the attribute value as an integer |
static long |
getAttributeAsLong(Element element, String name, long defaultValue) Retrieve the attribute value as a long |
static Map<String,String> |
getAttributes(Element element) Retrieve the attributes from the given element as a mapping of String name to String value |
static Document |
parseXML(InputSource xmlSource, boolean validating, boolean namespaceAware) Parse xml from InputSource. |
static Document |
parseXML(InputStream xmlStream, boolean validating, boolean namespaceAware) Parse xml from the inputstream. |
static Document |
parseXML(Reader xmlReader, boolean validating, boolean namespaceAware) Parse xml from the Reader. |
static void |
serialize(Node rootNode, OutputStream out) Pretty prints the XML to the specified output stream |
static void |
serialize(Node rootNode, Writer out) Pretty prints the XML to the specified output stream |
static String |
toString(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 String AMP_REF
protected static final String APOS_REF
protected static final String GT_REF
protected static final String LT_REF
protected static final String QUOT_REF
protected static final String CHAR_REF_START
Constructor Detail |
---|
public XMLHelper()
Method Detail |
---|
public static Map<String,String> getAttributes(Element element)
element
- the elementpublic static int getAttributeAsInt(Element element, String name, int defaultValue)
element
- the elementname
- the attribute namedefaultValue
- the default valuepublic static long getAttributeAsLong(Element element, String name, long defaultValue)
element
- the elementname
- the attribute namedefaultValue
- the default valuepublic static String toString(Node rootNode) throws TransformerException
rootNode
- the root node of the XML document to displayTransformerException
public static String encodeXml(String text)
text
- the unencoded textpublic static Document parseXML(InputStream xmlStream, boolean validating, boolean namespaceAware) throws IOException, ParserConfigurationException, SAXException
xmlStream
- the stream to the XML contentvalidating
- true to validate the XMLnamespaceAware
- true to make the parser namespace awareIOException
ParserConfigurationException
SAXException
public static Document parseXML(Reader xmlReader, boolean validating, boolean namespaceAware) throws IOException, ParserConfigurationException, SAXException
xmlReader
- the reader to the XML contentvalidating
- true to validate the XMLnamespaceAware
- true to make the parser namespace awareIOException
ParserConfigurationException
SAXException
public static Document parseXML(InputSource xmlSource, boolean validating, boolean namespaceAware) throws IOException, ParserConfigurationException, SAXException
xmlSource
- the inputSource to the XML contentvalidating
- true to validate the XMLnamespaceAware
- true to make the parser namespace awareIOException
ParserConfigurationException
SAXException
public static void serialize(Node rootNode, OutputStream out) throws TransformerException
rootNode
- the root node of the XML document to displayout
- the output streamTransformerException
public static void serialize(Node rootNode, Writer out) throws TransformerException
rootNode
- the root node of the XML document to displayout
- the output streamTransformerException
public static Transformer createPrettyPrintTransformer() throws TransformerException
TransformerException
|
Oracle® Fusion Middleware Java API Reference for Oracle WebCenter Content Remote Intradoc Client (RIDC) 11g Release 1 (11.1) E17274-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |