Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

XSECNameSpaceExpander Class Reference
[Main Signature API]

Class to "expand" name spaces. More...

#include <XSECNameSpaceExpander.hpp>

Collaboration diagram for XSECNameSpaceExpander:

Collaboration graph
[legend]
List of all members.

Public Methods

void expandNameSpaces (void)
 Expand namespaces. More...

void deleteAddedNamespaces (void)
 Collapse name-spaces. More...

bool nodeWasAdded (DOMNode *n)
Constructors and Destructors
 XSECNameSpaceExpander (DOMDocument *d)
 Main constructure. More...

 XSECNameSpaceExpander (DOMElement *f)
 Fragment constructor. More...

 ~XSECNameSpaceExpander ()

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).


Constructor & Destructor Documentation

XSECNameSpaceExpander::XSECNameSpaceExpander DOMDocument *    d
 

Main constructure.

Use this constructor to expand namespaces through an entire document.

Parameters:
d  The DOM document to be expanded.

XSECNameSpaceExpander::XSECNameSpaceExpander 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 DOMNode *    n
 


The documentation for this class was generated from the following file:
Generated on Thu May 8 20:17:41 2003 for XML-Security-C by doxygen1.2.15