org.neuclear.xml.c14
Class Canonicalizer

java.lang.Object
  extended by org.neuclear.xml.AbstractElementProxy
      extended by org.neuclear.xml.xmlsec.AbstractXMLSigElement
          extended by org.neuclear.xml.transforms.Transform
              extended by org.neuclear.xml.transforms.XPathTransform
                  extended by org.neuclear.xml.c14.Canonicalizer
All Implemented Interfaces:
ElementProxy
Direct Known Subclasses:
CanonicalizerWithComments, CanonicalizerWithoutSignature

public class Canonicalizer
extends XPathTransform

XML Canonicalizer. This "mostly" supports the W3C Canonical XML standard.

Usage:

Canonicalizer canon=new Canonicalizer(writer);//writer is a preinitialized instance of a java.io.Writer
 canon.canonicalize(doc); // Canonicalizes the document or element and outputs it to the writer
 


Field Summary
static java.lang.String ALGORITHM
           
static int C14NTYPE_NORMAL
           
static int C14NTYPE_WITH_COMMENTS
           
static java.lang.String LF
           
static java.lang.String XPATH_WO_COMMENTS
           
 
Constructor Summary
  Canonicalizer()
           
protected Canonicalizer(java.lang.String algorithm, java.lang.String xpath)
           
 
Method Summary
 byte[] canonicalize(java.lang.Object node)
          Canonicalizes a node and outputs it to the writer
 byte[] canonicalizeSubset(org.dom4j.Node node, java.lang.String xpath)
          Creates a subset of a node based on it's xpath and outputs it to the writer Note, for this to return wellformed xml the xpath most be formatted to produce it.
 
Methods inherited from class org.neuclear.xml.transforms.XPathTransform
matches, transformNode
 
Methods inherited from class org.neuclear.xml.AbstractElementProxy
addElement, addElement, addElement, addElement, addElement, addLineBreak, asXML, canonicalize, createAttribute, createQName, getElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XPATH_WO_COMMENTS

public static final java.lang.String XPATH_WO_COMMENTS
See Also:
Constant Field Values

LF

public static final java.lang.String LF

C14NTYPE_NORMAL

public static final int C14NTYPE_NORMAL
See Also:
Constant Field Values

C14NTYPE_WITH_COMMENTS

public static final int C14NTYPE_WITH_COMMENTS
See Also:
Constant Field Values

ALGORITHM

public static final java.lang.String ALGORITHM
See Also:
Constant Field Values
Constructor Detail

Canonicalizer

public Canonicalizer()

Canonicalizer

protected Canonicalizer(java.lang.String algorithm,
                        java.lang.String xpath)
Method Detail

canonicalize

public final byte[] canonicalize(java.lang.Object node)
                          throws XMLSecurityException
Canonicalizes a node and outputs it to the writer

Parameters:
node -
Throws:
XMLSecurityException

canonicalizeSubset

public final byte[] canonicalizeSubset(org.dom4j.Node node,
                                       java.lang.String xpath)
                                throws java.io.IOException
Creates a subset of a node based on it's xpath and outputs it to the writer Note, for this to return wellformed xml the xpath most be formatted to produce it.

Parameters:
node - node
xpath - subset expression
Throws:
java.io.IOException


Copyright © 2002-2004 Antilles Software Ventures SA. All Rights Reserved.