#include <XSECNameSpaceExpander.hpp>
Collaboration diagram for XSECNameSpaceExpander:
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 () |
|
Main constructure. Use this constructor to expand namespaces through an entire document.
|
|
Fragment constructor. Use this constructor to expand namespaces in a given fragment only.
|
|
|
|
Collapse name-spaces. Delete all namespaces added in exandNameSpaces() (using the list that was created at that time |
|
Expand namespaces. Perform the expansion operation and create a list of all added nodes. |
|
|