Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

XSECNameSpaceExpander Class Reference
[Main Signature API]

#include <XSECNameSpaceExpander.hpp>

Collaboration diagram for XSECNameSpaceExpander:

Collaboration graph
[legend]
List of all members.

Detailed Description

Class to "expand" name spaces.

For most things, a DOM model interoperates well with XPath. Unfortunately, name-spaces are the one main problem. In particular, the XPath spec states that every element node has an attribute node for its own namespaces, and one for namespaces above that are in scope.

In the DOM scheme of things, a namespace is only available in the node in which it is defined. Normally this is not a problem, you can just just refer backwards until you find the namespace you need. However, for XPath expressions that select namespace nodes, we need to actually promulgate the name-spaces down to every node where they are visible so that the XPath selection will work properly.

This is important for Canonicalisation of the found nodes, but we cannot do this only in the canonicaliser as it does not internally understand how to do DSIG style XPath. So the XPath is done externally, and the resultant node set (including any selected "Expanded" attribute nodes). are passed in.

The expander therefore handles the propogation of the namespace nodes, and removes the propogated nodes when it goes out of scope (or when deleteAddedNamespaces() is called).


Public Member Functions

void expandNameSpaces (void)
 Expand namespaces.
void deleteAddedNamespaces (void)
 Collapse name-spaces.
bool nodeWasAdded (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *n)
Constructors and Destructors
 XSECNameSpaceExpander (XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *d)
 Main constructure.
 XSECNameSpaceExpander (XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *f)
 Fragment constructor.
 ~XSECNameSpaceExpander ()


Constructor & Destructor Documentation

XSECNameSpaceExpander::XSECNameSpaceExpander XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *  d  ) 
 

Main constructure.

Use this constructor to expand namespaces through an entire document.

Parameters:
d The DOM document to be expanded.

XSECNameSpaceExpander::XSECNameSpaceExpander XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *  f  ) 
 

Fragment constructor.

Use this constructor to expand namespaces in a given fragment only.

Note:
The fragment does not need to be rooted in an actual document.
Parameters:
f The starting element of the fragment to be expanded.

XSECNameSpaceExpander::~XSECNameSpaceExpander  ) 
 


Member Function Documentation

void XSECNameSpaceExpander::deleteAddedNamespaces void   ) 
 

Collapse name-spaces.

Delete all namespaces added in exandNameSpaces() (using the list that was created at that time

void XSECNameSpaceExpander::expandNameSpaces void   ) 
 

Expand namespaces.

Perform the expansion operation and create a list of all added nodes.

bool XSECNameSpaceExpander::nodeWasAdded XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *  n  ) 
 


The documentation for this class was generated from the following file:
Generated on Sun Jul 3 17:45:47 2005 for XML-Security-C by  doxygen 1.4.2