org.apache.wss4j.common.util
Class XMLUtils

java.lang.Object
  extended by org.apache.wss4j.common.util.XMLUtils

public final class XMLUtils
extends Object


Field Summary
static String XML_NS
           
static String XMLNS_NS
           
 
Method Summary
static void ElementToStream(Element element, OutputStream out)
           
static Element getDirectChildElement(Node parentNode, String localName, String namespace)
          Gets a direct child with specified localname and namespace.
static InputSource getInputSourceFromURI(String uri)
          Utility to get the bytes uri.
static String getNamespace(String prefix, Node e)
           
static String PrettyDocumentToString(Document doc)
           
static InputSource sourceToInputSource(Source source)
          Utility to get the bytes uri
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XMLNS_NS

public static final String XMLNS_NS
See Also:
Constant Field Values

XML_NS

public static final String XML_NS
See Also:
Constant Field Values
Method Detail

getDirectChildElement

public static Element getDirectChildElement(Node parentNode,
                                            String localName,
                                            String namespace)
Gets a direct child with specified localname and namespace.

Parameters:
parentNode - the node where to start the search
localName - local name of the child to get
namespace - the namespace of the child to get
Returns:
the node or null if not such node found

getNamespace

public static String getNamespace(String prefix,
                                  Node e)

PrettyDocumentToString

public static String PrettyDocumentToString(Document doc)
                                     throws TransformerException
Throws:
TransformerException

ElementToStream

public static void ElementToStream(Element element,
                                   OutputStream out)
                            throws TransformerException
Throws:
TransformerException

sourceToInputSource

public static InputSource sourceToInputSource(Source source)
                                       throws TransformerException
Utility to get the bytes uri

Parameters:
source - the resource to get
Throws:
TransformerException

getInputSourceFromURI

public static InputSource getInputSourceFromURI(String uri)
Utility to get the bytes uri. Does NOT handle authenticated URLs, use getInputSourceFromURI(uri, username, password)

Parameters:
uri - the resource to get


Copyright © 2004–2015 The Apache Software Foundation. All rights reserved.