|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.axis.utils.XMLUtils
Nested Class Summary | |
static class |
XMLUtils.ParserErrorHandler
|
Field Summary | |
static java.lang.String |
httpAuthCharEncoding
|
Constructor Summary | |
XMLUtils()
|
Method Summary | |
static org.w3c.dom.Element[] |
asElementArray(java.util.List list)
Converts a List with org.w3c.dom.Element objects to an Array with org.w3c.dom.Element objects. |
static java.lang.String |
base64encode(byte[] bytes)
|
static void |
DocumentToStream(org.w3c.dom.Document doc,
java.io.OutputStream out)
|
static java.lang.String |
DocumentToString(org.w3c.dom.Document doc)
turn a whole DOM document into XML |
static void |
DocumentToWriter(org.w3c.dom.Document doc,
java.io.Writer writer)
|
static void |
ElementToStream(org.w3c.dom.Element element,
java.io.OutputStream out)
|
static java.lang.String |
ElementToString(org.w3c.dom.Element element)
turn an element into an XML fragment |
static void |
ElementToWriter(org.w3c.dom.Element element,
java.io.Writer writer)
|
static org.w3c.dom.Node |
findNode(org.w3c.dom.Node node,
QName name)
Find a Node with a given QName |
static java.lang.String |
getChildCharacterData(org.w3c.dom.Element parentEl)
Concat all the text and cdata node children of this elem and return the resulting text. |
static javax.xml.parsers.DocumentBuilder |
getDocumentBuilder()
Gets a DocumentBuilder |
static org.xml.sax.InputSource |
getEmptyInputSource()
|
static java.lang.String |
getEncoding()
Get the current encoding in effect |
static java.lang.String |
getEncoding(MessageContext msgContext)
Get the current encoding in effect |
static java.lang.String |
getEncoding(Message message,
MessageContext msgContext)
|
static java.lang.String |
getEncoding(Message message,
MessageContext msgContext,
org.apache.axis.components.encoding.XMLEncoder defaultEncoder)
|
static QName |
getFullQNameFromString(java.lang.String str,
org.w3c.dom.Node e)
Return a QName when passed a string like "foo:bar" by mapping the "foo" prefix to a namespace in the context of the given Node. |
static java.lang.String |
getInnerXMLString(org.w3c.dom.Element element)
get the inner XML inside an element as a string. |
static org.xml.sax.InputSource |
getInputSourceFromURI(java.lang.String uri)
Utility to get the bytes uri. |
static java.lang.String |
getNamespace(java.lang.String prefix,
org.w3c.dom.Node e)
|
static java.lang.String |
getNamespace(java.lang.String prefix,
org.w3c.dom.Node e,
org.w3c.dom.Node stopNode)
Searches for the namespace URI of the given prefix in the given DOM range. |
static java.lang.String |
getPrefix(java.lang.String uri,
org.w3c.dom.Node e)
|
static QName |
getQNameFromString(java.lang.String str,
org.w3c.dom.Node e)
Return a QName when passed a string like "foo:bar" by mapping the "foo" prefix to a namespace in the context of the given Node. |
static javax.xml.parsers.SAXParser |
getSAXParser()
Get a SAX parser instance from the JAXP factory. |
static java.lang.String |
getStringForQName(QName qname,
org.w3c.dom.Element e)
Return a string for a particular QName, mapping a new prefix if necessary. |
static org.apache.axis.components.encoding.XMLEncoder |
getXMLEncoder(MessageContext msgContext)
Get the current XMLEncoder |
static org.apache.axis.components.encoding.XMLEncoder |
getXMLEncoder(java.lang.String encoding)
Get the XMLEncoder for specific encoding |
static void |
initSAXFactory(java.lang.String factoryClassName,
boolean namespaceAware,
boolean validating)
Initialize the SAX parser factory. |
static org.w3c.dom.Document |
newDocument()
Get an empty new Document |
static org.w3c.dom.Document |
newDocument(org.xml.sax.InputSource inp)
Get a new Document read from the input source |
static org.w3c.dom.Document |
newDocument(java.io.InputStream inp)
Get a new Document read from the input stream |
static org.w3c.dom.Document |
newDocument(java.lang.String uri)
Get a new Document read from the indicated uri |
static org.w3c.dom.Document |
newDocument(java.lang.String uri,
java.lang.String username,
java.lang.String password)
Create a new document from the given URI, use the username and password if the URI requires authentication. |
static void |
normalize(org.w3c.dom.Node node)
Trim all new lines from text nodes. |
static void |
PrettyDocumentToStream(org.w3c.dom.Document doc,
java.io.OutputStream out)
|
static java.lang.String |
PrettyDocumentToString(org.w3c.dom.Document doc)
|
static void |
PrettyDocumentToWriter(org.w3c.dom.Document doc,
java.io.Writer writer)
|
static void |
PrettyElementToStream(org.w3c.dom.Element element,
java.io.OutputStream out)
|
static void |
PrettyElementToWriter(org.w3c.dom.Element element,
java.io.Writer writer)
|
static void |
privateElementToWriter(org.w3c.dom.Element element,
java.io.Writer writer,
boolean omitXMLDecl,
boolean pretty)
|
static void |
releaseDocumentBuilder(javax.xml.parsers.DocumentBuilder db)
Releases a DocumentBuilder |
static void |
releaseSAXParser(javax.xml.parsers.SAXParser parser)
Return a SAX parser for reuse. |
static org.xml.sax.InputSource |
sourceToInputSource(javax.xml.transform.Source source)
Utility to get the bytes uri |
static org.w3c.dom.Element |
StringToElement(java.lang.String namespace,
java.lang.String name,
java.lang.String string)
Convert a simple string to an element with a text node |
static java.lang.String |
trim(java.lang.String str)
|
static java.lang.String |
xmlEncodeString(java.lang.String orig)
Encode a string appropriately for XML. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String httpAuthCharEncoding
Constructor Detail |
public XMLUtils()
Method Detail |
public static java.lang.String xmlEncodeString(java.lang.String orig)
orig
- the String to encode
public static org.apache.axis.components.encoding.XMLEncoder getXMLEncoder(MessageContext msgContext)
public static org.apache.axis.components.encoding.XMLEncoder getXMLEncoder(java.lang.String encoding)
public static java.lang.String getEncoding(MessageContext msgContext)
public static java.lang.String getEncoding()
public static void initSAXFactory(java.lang.String factoryClassName, boolean namespaceAware, boolean validating)
factoryClassName
- The (optional) class name of the desired
SAXParserFactory implementation. Will be
assigned to the system property
javax.xml.parsers.SAXParserFactory
unless this property is already set.
If null
, leaves current setting
alone.namespaceAware
- true if we want a namespace-aware parservalidating
- true if we want a validating parserpublic static javax.xml.parsers.DocumentBuilder getDocumentBuilder() throws javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.ParserConfigurationException
public static void releaseDocumentBuilder(javax.xml.parsers.DocumentBuilder db)
db
- public static javax.xml.parsers.SAXParser getSAXParser()
public static void releaseSAXParser(javax.xml.parsers.SAXParser parser)
parser
- A SAX parser that is available for reusepublic static org.w3c.dom.Document newDocument() throws javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.ParserConfigurationException
- if construction problems occurpublic static org.w3c.dom.Document newDocument(org.xml.sax.InputSource inp) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
javax.xml.parsers.ParserConfigurationException
- if construction problems occur
org.xml.sax.SAXException
- if the document has xml sax problems
java.io.IOException
- if i/o exceptions occurpublic static org.w3c.dom.Document newDocument(java.io.InputStream inp) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
javax.xml.parsers.ParserConfigurationException
- if construction problems occur
org.xml.sax.SAXException
- if the document has xml sax problems
java.io.IOException
- if i/o exceptions occurpublic static org.w3c.dom.Document newDocument(java.lang.String uri) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
javax.xml.parsers.ParserConfigurationException
- if construction problems occur
org.xml.sax.SAXException
- if the document has xml sax problems
java.io.IOException
- if i/o exceptions occurpublic static org.w3c.dom.Document newDocument(java.lang.String uri, java.lang.String username, java.lang.String password) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
uri
- the resource to getusername
- basic auth usernamepassword
- basic auth password
javax.xml.parsers.ParserConfigurationException
- if construction problems occur
org.xml.sax.SAXException
- if the document has xml sax problems
java.io.IOException
- if i/o exceptions occurpublic static java.lang.String ElementToString(org.w3c.dom.Element element)
element
-
public static java.lang.String DocumentToString(org.w3c.dom.Document doc)
doc
- DOM document
public static java.lang.String PrettyDocumentToString(org.w3c.dom.Document doc)
public static void privateElementToWriter(org.w3c.dom.Element element, java.io.Writer writer, boolean omitXMLDecl, boolean pretty)
public static void ElementToStream(org.w3c.dom.Element element, java.io.OutputStream out)
public static void PrettyElementToStream(org.w3c.dom.Element element, java.io.OutputStream out)
public static void ElementToWriter(org.w3c.dom.Element element, java.io.Writer writer)
public static void PrettyElementToWriter(org.w3c.dom.Element element, java.io.Writer writer)
public static void DocumentToStream(org.w3c.dom.Document doc, java.io.OutputStream out)
public static void PrettyDocumentToStream(org.w3c.dom.Document doc, java.io.OutputStream out)
public static void DocumentToWriter(org.w3c.dom.Document doc, java.io.Writer writer)
public static void PrettyDocumentToWriter(org.w3c.dom.Document doc, java.io.Writer writer)
public static org.w3c.dom.Element StringToElement(java.lang.String namespace, java.lang.String name, java.lang.String string)
namespace
- - element namespacename
- - element namestring
- - value of the text node
public static java.lang.String getInnerXMLString(org.w3c.dom.Element element)
element
-
public static java.lang.String getPrefix(java.lang.String uri, org.w3c.dom.Node e)
public static java.lang.String getNamespace(java.lang.String prefix, org.w3c.dom.Node e, org.w3c.dom.Node stopNode)
prefix
- the prefix to finde
- the starting nodestopNode
- null to search in all the document or a parent node where the search must stop.
public static java.lang.String getNamespace(java.lang.String prefix, org.w3c.dom.Node e)
public static QName getQNameFromString(java.lang.String str, org.w3c.dom.Node e)
public static QName getFullQNameFromString(java.lang.String str, org.w3c.dom.Node e)
public static java.lang.String getStringForQName(QName qname, org.w3c.dom.Element e)
public static java.lang.String getChildCharacterData(org.w3c.dom.Element parentEl)
parentEl
- the element whose cdata/text node values are to
be combined.
public static org.xml.sax.InputSource getInputSourceFromURI(java.lang.String uri)
uri
- the resource to get#getInputSourceFromURI(String uri, String username, String password)
public static org.xml.sax.InputSource sourceToInputSource(javax.xml.transform.Source source)
source
- the resource to getpublic static final java.lang.String base64encode(byte[] bytes)
public static org.xml.sax.InputSource getEmptyInputSource()
public static org.w3c.dom.Node findNode(org.w3c.dom.Node node, QName name)
node
- parent nodename
- QName of the child we need to find
public static void normalize(org.w3c.dom.Node node)
node
- public static java.lang.String trim(java.lang.String str)
public static org.w3c.dom.Element[] asElementArray(java.util.List list)
list
- List containing org.w3c.dom.Element objects
public static java.lang.String getEncoding(Message message, MessageContext msgContext)
public static java.lang.String getEncoding(Message message, MessageContext msgContext, org.apache.axis.components.encoding.XMLEncoder defaultEncoder)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |