|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.idoox.xml.TokenizerResolver
Converts Tokenizer to canonical form according to the Exclusive XML Canonicalization specification. For further detail see http://www.w3.org/TR/xml-exc-c14n/. It is useful e.g. for digital signature over an XML.
Nested Class Summary | |
protected static class |
TokenizerResolver.PrefixesStack
|
Field Summary | |
protected static boolean |
trace
|
Constructor Summary | |
TokenizerResolver()
|
Method Summary | |
protected static java.lang.String |
engineCanonicalizeStartToken(Tokenizer source,
Token token,
TokenizerResolver.PrefixesStack registeredPrefixes,
java.util.Stack tokenNames,
boolean root)
|
static java.lang.String |
normalizeAttr(java.lang.String s)
Normalizes an {link Attr Attribute} value The string value of the node is modified by replacing all ampersands (&) with &
all open angle brackets (<) with <
all quotation mark characters with "
and the whitespace characters #x9 , #xA, and #xD,
with character references. |
static java.lang.String |
normalizeText(java.lang.String text)
Normalizes a Text value. |
static byte[] |
toC14nExcCanonicalForm(Tokenizer source,
java.lang.String prefixList)
Converts tokenizer to c14n exclusive canonical form ( http://www.w3.org/TR/xml-exc-c14n/). |
static byte[] |
toCanonicalForm(Tokenizer source)
Converts tokenizer to canonical form. |
static byte[] |
toCanonicalForm(Tokenizer source,
boolean addAncestorPrefix)
Converts tokenizer to c14n canonical form. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final boolean trace
Constructor Detail |
public TokenizerResolver()
Method Detail |
public static byte[] toCanonicalForm(Tokenizer source) throws TokenizerException, java.io.IOException
toCanonicalForm(source, addAncestorPrefix)
with parameter
addAncestorPrefix = false
.
source
- the tokenizer to resolve
TokenizerException
- Exception
java.io.IOException
- Exceptionpublic static byte[] toCanonicalForm(Tokenizer source, boolean addAncestorPrefix) throws TokenizerException, java.io.IOException
source
- the tokenizer to resolveaddAncestorPrefix
- whether the prefixes of the
ancestors is also added to the output
TokenizerException
- Exception
java.io.IOException
- Exceptionprotected static java.lang.String engineCanonicalizeStartToken(Tokenizer source, Token token, TokenizerResolver.PrefixesStack registeredPrefixes, java.util.Stack tokenNames, boolean root)
public static final java.lang.String normalizeAttr(java.lang.String s)
&
<
"
#x9
, #xA, and #xD,
with character references. The character references are written in
uppercase hexadecimal with no leading zeroes (for example, #xD
is represented by the character reference 
)
s
-
public static final java.lang.String normalizeText(java.lang.String text)
Text Nodes - the string value, except all ampersands (& are replaced by &, all open angle brackets (<) are replaced by <, all closing angle brackets (>) are replaced by >, and all #xD characters are replaced by 
. (See processing model section in the specification )
text
- text to be normalized
public static byte[] toC14nExcCanonicalForm(Tokenizer source, java.lang.String prefixList) throws TokenizerException, java.io.IOException
It is as defined in the Canonical XML Recommendation [XML-C14N] except for the changes summarized as follows: attributes in the XML namespace, such as xml:lang and xml:space are not imported into orphan nodes of the document subset, and namespace nodes that are not on the InclusiveNamespaces PrefixList are expressed only in start tags where they are visible and if they are not in effect from an output ancestor of that tag.
source
- input tokenizerprefixList
- list of the visible prefixes
TokenizerException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |