|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.xml.security.utils.XMLUtils
public class XMLUtils
DOM and XML accessibility and comfort functions.
Method Summary | |
---|---|
static void |
addReturnBeforeChild(org.w3c.dom.Element e,
org.w3c.dom.Node child)
|
static void |
addReturnToElement(org.w3c.dom.Document doc,
HelperNodeList nl)
|
static void |
addReturnToElement(org.w3c.dom.Element e)
Method addReturnToElement |
static void |
circumventBug2650(org.w3c.dom.Document doc)
This method spreads all namespace attributes in a DOM document to their children. |
static java.util.Set<org.w3c.dom.Node> |
convertNodelistToSet(org.w3c.dom.NodeList xpathNodeSet)
Method convertNodelistToSet |
static javax.xml.parsers.DocumentBuilder |
createDocumentBuilder(boolean validating)
|
static javax.xml.parsers.DocumentBuilder |
createDocumentBuilder(boolean validating,
boolean disAllowDocTypeDeclarations)
|
static org.w3c.dom.Element |
createDSctx(org.w3c.dom.Document doc,
java.lang.String prefix,
java.lang.String namespace)
Method createDSctx |
static org.w3c.dom.Element |
createElementInEncryption11Space(org.w3c.dom.Document doc,
java.lang.String elementName)
Creates an Element in the XML Encryption 1.1 specification namespace. |
static org.w3c.dom.Element |
createElementInEncryptionSpace(org.w3c.dom.Document doc,
java.lang.String elementName)
Creates an Element in the XML Encryption specification namespace. |
static org.w3c.dom.Element |
createElementInSignature11Space(org.w3c.dom.Document doc,
java.lang.String elementName)
Creates an Element in the XML Signature 1.1 specification namespace. |
static org.w3c.dom.Element |
createElementInSignatureSpace(org.w3c.dom.Document doc,
java.lang.String elementName)
Creates an Element in the XML Signature specification namespace. |
static boolean |
elementIsInEncryption11Space(org.w3c.dom.Element element,
java.lang.String localName)
Returns true if the element is in XML Encryption 1.1 namespace and the local name equals the supplied one. |
static boolean |
elementIsInEncryptionSpace(org.w3c.dom.Element element,
java.lang.String localName)
Returns true if the element is in XML Encryption namespace and the local name equals the supplied one. |
static boolean |
elementIsInSignature11Space(org.w3c.dom.Element element,
java.lang.String localName)
Returns true if the element is in XML Signature 1.1 namespace and the local name equals the supplied one. |
static boolean |
elementIsInSignatureSpace(org.w3c.dom.Element element,
java.lang.String localName)
Returns true if the element is in XML Signature namespace and the local name equals the supplied one. |
static java.util.Set<org.w3c.dom.Node> |
excludeNodeFromSet(org.w3c.dom.Node signatureElement,
java.util.Set<org.w3c.dom.Node> inputSet)
|
static java.lang.String |
getAttributeValue(org.w3c.dom.Element elem,
java.lang.String name)
Returns the attribute value for the attribute with the specified name. |
static java.lang.String |
getFullTextChildrenFromElement(org.w3c.dom.Element element)
Method getFullTextChildrenFromElement |
static org.w3c.dom.Element |
getNextElement(org.w3c.dom.Node el)
|
static org.w3c.dom.Document |
getOwnerDocument(org.w3c.dom.Node node)
This method returns the owner document of a particular node. |
static org.w3c.dom.Document |
getOwnerDocument(java.util.Set<org.w3c.dom.Node> xpathNodeSet)
This method returns the first non-null owner document of the Nodes in this Set. |
static void |
getSet(org.w3c.dom.Node rootNode,
java.util.Set<org.w3c.dom.Node> result,
org.w3c.dom.Node exclude,
boolean com)
|
static java.lang.String |
getStrFromNode(org.w3c.dom.Node xpathnode)
Method getStrFromNode |
static boolean |
ignoreLineBreaks()
|
static boolean |
isDescendantOrSelf(org.w3c.dom.Node ctx,
org.w3c.dom.Node descendantOrSelf)
Returns true if the descendantOrSelf is on the descendant-or-self axis of the context node. |
static void |
outputDOM(org.w3c.dom.Node contextNode,
java.io.OutputStream os)
Outputs a DOM tree to an OutputStream . |
static void |
outputDOM(org.w3c.dom.Node contextNode,
java.io.OutputStream os,
boolean addPreamble)
Outputs a DOM tree to an OutputStream . |
static void |
outputDOMc14nWithComments(org.w3c.dom.Node contextNode,
java.io.OutputStream os)
Serializes the contextNode into the OutputStream, but
suppresses all Exceptions. |
static boolean |
protectAgainstWrappingAttack(org.w3c.dom.Node startNode,
org.w3c.dom.Element knownElement,
java.lang.String value)
This method is a tree-search to help prevent against wrapping attacks. |
static boolean |
protectAgainstWrappingAttack(org.w3c.dom.Node startNode,
java.lang.String value)
This method is a tree-search to help prevent against wrapping attacks. |
static org.w3c.dom.Element |
selectDs11Node(org.w3c.dom.Node sibling,
java.lang.String nodeName,
int number)
|
static org.w3c.dom.Element[] |
selectDs11Nodes(org.w3c.dom.Node sibling,
java.lang.String nodeName)
|
static org.w3c.dom.Text |
selectDs11NodeText(org.w3c.dom.Node sibling,
java.lang.String nodeName,
int number)
|
static org.w3c.dom.Element |
selectDsNode(org.w3c.dom.Node sibling,
java.lang.String nodeName,
int number)
|
static org.w3c.dom.Element[] |
selectDsNodes(org.w3c.dom.Node sibling,
java.lang.String nodeName)
|
static org.w3c.dom.Text |
selectDsNodeText(org.w3c.dom.Node sibling,
java.lang.String nodeName,
int number)
|
static org.w3c.dom.Element |
selectNode(org.w3c.dom.Node sibling,
java.lang.String uri,
java.lang.String nodeName,
int number)
|
static org.w3c.dom.Element[] |
selectNodes(org.w3c.dom.Node sibling,
java.lang.String uri,
java.lang.String nodeName)
|
static org.w3c.dom.Text |
selectNodeText(org.w3c.dom.Node sibling,
java.lang.String uri,
java.lang.String nodeName,
int number)
|
static org.w3c.dom.Element |
selectXencNode(org.w3c.dom.Node sibling,
java.lang.String nodeName,
int number)
|
static void |
setDs11Prefix(java.lang.String prefix)
Set the prefix for the digital signature 1.1 namespace |
static void |
setDsPrefix(java.lang.String prefix)
Set the prefix for the digital signature namespace |
static void |
setXenc11Prefix(java.lang.String prefix)
Set the prefix for the encryption namespace 1.1 |
static void |
setXencPrefix(java.lang.String prefix)
Set the prefix for the encryption namespace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void setDsPrefix(java.lang.String prefix)
prefix
- the new prefix for the digital signature namespacepublic static void setDs11Prefix(java.lang.String prefix)
prefix
- the new prefix for the digital signature 1.1 namespacepublic static void setXencPrefix(java.lang.String prefix)
prefix
- the new prefix for the encryption namespacepublic static void setXenc11Prefix(java.lang.String prefix)
prefix
- the new prefix for the encryption namespace 1.1public static org.w3c.dom.Element getNextElement(org.w3c.dom.Node el)
public static void getSet(org.w3c.dom.Node rootNode, java.util.Set<org.w3c.dom.Node> result, org.w3c.dom.Node exclude, boolean com)
rootNode
- result
- exclude
- com
- whether comments or notpublic static void outputDOM(org.w3c.dom.Node contextNode, java.io.OutputStream os)
OutputStream
.
contextNode
- root node of the DOM treeos
- the OutputStream
public static void outputDOM(org.w3c.dom.Node contextNode, java.io.OutputStream os, boolean addPreamble)
OutputStream
. If an Exception is
thrown during execution, it's StackTrace is output to System.out, but the
Exception is not re-thrown.
contextNode
- root node of the DOM treeos
- the OutputStream
addPreamble
- public static void outputDOMc14nWithComments(org.w3c.dom.Node contextNode, java.io.OutputStream os)
contextNode
into the OutputStream, but
suppresses all Exceptions.
try{}
statement, but handle the Exceptions appropriately.
contextNode
- os
- public static java.lang.String getFullTextChildrenFromElement(org.w3c.dom.Element element)
element
-
public static org.w3c.dom.Element createElementInSignatureSpace(org.w3c.dom.Document doc, java.lang.String elementName)
doc
- the factory DocumentelementName
- the local name of the Element
public static org.w3c.dom.Element createElementInSignature11Space(org.w3c.dom.Document doc, java.lang.String elementName)
doc
- the factory DocumentelementName
- the local name of the Element
public static org.w3c.dom.Element createElementInEncryptionSpace(org.w3c.dom.Document doc, java.lang.String elementName)
doc
- the factory DocumentelementName
- the local name of the Element
public static org.w3c.dom.Element createElementInEncryption11Space(org.w3c.dom.Document doc, java.lang.String elementName)
doc
- the factory DocumentelementName
- the local name of the Element
public static boolean elementIsInSignatureSpace(org.w3c.dom.Element element, java.lang.String localName)
element
- localName
-
public static boolean elementIsInSignature11Space(org.w3c.dom.Element element, java.lang.String localName)
element
- localName
-
public static boolean elementIsInEncryptionSpace(org.w3c.dom.Element element, java.lang.String localName)
element
- localName
-
public static boolean elementIsInEncryption11Space(org.w3c.dom.Element element, java.lang.String localName)
element
- localName
-
public static org.w3c.dom.Document getOwnerDocument(org.w3c.dom.Node node)
Document
. Node.getOwnerDocument()
returns null
if the Node
is a Document
.
node
-
public static org.w3c.dom.Document getOwnerDocument(java.util.Set<org.w3c.dom.Node> xpathNodeSet)
Document
. Node.getOwnerDocument()
returns null
if the Node
is a Document
.
xpathNodeSet
-
public static org.w3c.dom.Element createDSctx(org.w3c.dom.Document doc, java.lang.String prefix, java.lang.String namespace)
doc
- prefix
- namespace
-
public static void addReturnToElement(org.w3c.dom.Element e)
e
- public static void addReturnToElement(org.w3c.dom.Document doc, HelperNodeList nl)
public static void addReturnBeforeChild(org.w3c.dom.Element e, org.w3c.dom.Node child)
public static java.util.Set<org.w3c.dom.Node> convertNodelistToSet(org.w3c.dom.NodeList xpathNodeSet)
xpathNodeSet
-
public static void circumventBug2650(org.w3c.dom.Document doc)
doc
- public static org.w3c.dom.Element selectDsNode(org.w3c.dom.Node sibling, java.lang.String nodeName, int number)
sibling
- nodeName
- number
-
public static org.w3c.dom.Element selectDs11Node(org.w3c.dom.Node sibling, java.lang.String nodeName, int number)
sibling
- nodeName
- number
-
public static org.w3c.dom.Element selectXencNode(org.w3c.dom.Node sibling, java.lang.String nodeName, int number)
sibling
- nodeName
- number
-
public static org.w3c.dom.Text selectDsNodeText(org.w3c.dom.Node sibling, java.lang.String nodeName, int number)
sibling
- nodeName
- number
-
public static org.w3c.dom.Text selectDs11NodeText(org.w3c.dom.Node sibling, java.lang.String nodeName, int number)
sibling
- nodeName
- number
-
public static org.w3c.dom.Text selectNodeText(org.w3c.dom.Node sibling, java.lang.String uri, java.lang.String nodeName, int number)
sibling
- uri
- nodeName
- number
-
public static org.w3c.dom.Element selectNode(org.w3c.dom.Node sibling, java.lang.String uri, java.lang.String nodeName, int number)
sibling
- uri
- nodeName
- number
-
public static org.w3c.dom.Element[] selectDsNodes(org.w3c.dom.Node sibling, java.lang.String nodeName)
sibling
- nodeName
-
public static org.w3c.dom.Element[] selectDs11Nodes(org.w3c.dom.Node sibling, java.lang.String nodeName)
sibling
- nodeName
-
public static org.w3c.dom.Element[] selectNodes(org.w3c.dom.Node sibling, java.lang.String uri, java.lang.String nodeName)
sibling
- uri
- nodeName
-
public static java.util.Set<org.w3c.dom.Node> excludeNodeFromSet(org.w3c.dom.Node signatureElement, java.util.Set<org.w3c.dom.Node> inputSet)
signatureElement
- inputSet
-
public static java.lang.String getStrFromNode(org.w3c.dom.Node xpathnode)
xpathnode
-
public static boolean isDescendantOrSelf(org.w3c.dom.Node ctx, org.w3c.dom.Node descendantOrSelf)
ctx
- descendantOrSelf
-
public static boolean ignoreLineBreaks()
public static java.lang.String getAttributeValue(org.w3c.dom.Element elem, java.lang.String name)
This works around a limitation of the DOM
Element.getAttributeNode
method, which does not distinguish
between an unspecified attribute and an attribute with a value of
"" (it returns "" for both cases).
elem
- the element containing the attributename
- the name of the attribute
public static boolean protectAgainstWrappingAttack(org.w3c.dom.Node startNode, java.lang.String value)
public static boolean protectAgainstWrappingAttack(org.w3c.dom.Node startNode, org.w3c.dom.Element knownElement, java.lang.String value)
public static javax.xml.parsers.DocumentBuilder createDocumentBuilder(boolean validating) throws javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.ParserConfigurationException
public static javax.xml.parsers.DocumentBuilder createDocumentBuilder(boolean validating, boolean disAllowDocTypeDeclarations) throws javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.ParserConfigurationException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |