org.apache.xml.security.c14n.helper
Class C14nHelper

java.lang.Object
  |
  +--org.apache.xml.security.c14n.helper.C14nHelper

public class C14nHelper
extends java.lang.Object

Temporary swapped static functions from the normalizer Section

Author:
Christian Geuer-Pollmann

Method Summary
static void assertNotRelativeNS(org.w3c.dom.Attr attr)
          This method throws an exception if the Attribute value contains a relative URI.
static void checkForRelativeNamespace(org.w3c.dom.Element ctxNode)
          This method throws a CanonicalizationException if the supplied Element contains any relative namespaces.
static void checkTraversability(org.w3c.dom.Document document)
          This method throws a CanonicalizationException if the supplied Document is not able to be traversed using a TreeWalker.
static boolean namespaceIsAbsolute(org.w3c.dom.Attr namespace)
          Method namespaceIsAbsolute
static boolean namespaceIsAbsolute(java.lang.String namespaceValue)
          Method namespaceIsAbsolute
static boolean namespaceIsRelative(org.w3c.dom.Attr namespace)
          Method namespaceIsRelative
static boolean namespaceIsRelative(java.lang.String namespaceValue)
          Method namespaceIsRelative
static java.lang.String normalizeAttr(java.lang.String s)
          Normalizes an Attribute value The string value of the node is modified by replacing all ampersands (&) with &amp; all open angle brackets (<) with &lt; all quotation mark characters with &quot; and the whitespace characters #x9, #xA, and #xD, with character references.
static java.lang.String normalizeComment(java.lang.String s)
          Normalizes a Comment value
static java.lang.String normalizeProcessingInstruction(java.lang.String s)
          Normalizes a ProcessingInstruction value
static java.lang.String normalizeText(java.lang.String s)
          Normalizes a Text value Text Nodes - the string value, except all ampersands (& are replaced by &amp;, all open angle brackets (<) are replaced by &lt;, all closing angle brackets (>) are replaced by &gt;, and all #xD characters are replaced by &#xD;.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

normalizeAttr

public static final java.lang.String normalizeAttr(java.lang.String s)
Normalizes an Attribute value The string value of the node is modified by replacing

Parameters:
s -
Returns:
the normalized Attribute value (((String)

normalizeComment

public static final java.lang.String normalizeComment(java.lang.String s)
Normalizes a Comment value

Parameters:
s -
Returns:
the normalized Comment value (((String)

normalizeProcessingInstruction

public static final java.lang.String normalizeProcessingInstruction(java.lang.String s)
Normalizes a ProcessingInstruction value

Parameters:
s -
Returns:
the normalized ProcessingInstruction value (((String)

normalizeText

public static final java.lang.String normalizeText(java.lang.String s)
Normalizes a Text value

Text Nodes - the string value, except all ampersands (& are replaced by &amp;, all open angle brackets (<) are replaced by &lt;, all closing angle brackets (>) are replaced by &gt;, and all #xD characters are replaced by &#xD;. (See processing model section in the specification)

Parameters:
s -
Returns:
the normalized Text value (((String)

namespaceIsRelative

public static boolean namespaceIsRelative(org.w3c.dom.Attr namespace)
Method namespaceIsRelative

Parameters:
namespace -
Returns:

namespaceIsRelative

public static boolean namespaceIsRelative(java.lang.String namespaceValue)
Method namespaceIsRelative

Parameters:
namespaceValue -
Returns:

namespaceIsAbsolute

public static boolean namespaceIsAbsolute(org.w3c.dom.Attr namespace)
Method namespaceIsAbsolute

Parameters:
namespace -
Returns:

namespaceIsAbsolute

public static boolean namespaceIsAbsolute(java.lang.String namespaceValue)
Method namespaceIsAbsolute

Parameters:
namespaceValue -
Returns:

assertNotRelativeNS

public static void assertNotRelativeNS(org.w3c.dom.Attr attr)
                                throws CanonicalizationException
This method throws an exception if the Attribute value contains a relative URI.

Parameters:
attr -
Throws:
CanonicalizationException

checkTraversability

public static void checkTraversability(org.w3c.dom.Document document)
                                throws CanonicalizationException
This method throws a CanonicalizationException if the supplied Document is not able to be traversed using a TreeWalker.

Parameters:
document -
Throws:
CanonicalizationException

checkForRelativeNamespace

public static void checkForRelativeNamespace(org.w3c.dom.Element ctxNode)
                                      throws CanonicalizationException
This method throws a CanonicalizationException if the supplied Element contains any relative namespaces.

Parameters:
ctxNode -
Throws:
CanonicalizationException
See Also:
assertNotRelativeNS(Attr)