in xsec/tools/siginf/siginf.cpp [143:244]
void outputTransform(const DSIGTransform * t, unsigned int level) {
if (dynamic_cast<const DSIGTransformBase64*>(t)) {
cout << "Base64 Decode" << endl;
}
else if (dynamic_cast<const DSIGTransformC14n*>(t)) {
const XMLCh* cm = dynamic_cast<const DSIGTransformC14n*>(t)->getCanonicalizationMethod();
if (XMLString::equals(cm, DSIGConstants::s_unicodeStrURIC14N_NOC)) {
cout << "c14n 1.0 canonicalization (without comments)" << endl;
}
else if (XMLString::equals(cm, DSIGConstants::s_unicodeStrURIC14N_COM)) {
cout << "c14n 1.0 canonicalization (with comments)" << endl;
}
else if (XMLString::equals(cm, DSIGConstants::s_unicodeStrURIC14N11_NOC)) {
cout << "c14n 1.1 canonicalization (without comments)" << endl;
}
else if (XMLString::equals(cm, DSIGConstants::s_unicodeStrURIC14N11_COM)) {
cout << "c14n 1.1 canonicalization (with comments)" << endl;
}
else if (XMLString::equals(cm, DSIGConstants::s_unicodeStrURIEXC_C14N_NOC)) {
cout << "Exclusive c14n 1.0 canonicalization (without comments)" << endl;
if (dynamic_cast<const DSIGTransformC14n*>(t)->getPrefixList() != NULL) {
levelSet(level);
cout << "Inclusive prefixes : " <<
X2C(dynamic_cast<const DSIGTransformC14n*>(t)->getPrefixList()).str() << endl;
}
}
else if (XMLString::equals(cm, DSIGConstants::s_unicodeStrURIEXC_C14N_COM)) {
cout << "Exclusive c14n 1.0 canonicalization (with comments)" << endl;
if (dynamic_cast<const DSIGTransformC14n*>(t)->getPrefixList() != NULL) {
levelSet(level);
cout << "Inclusive prefixes : " <<
X2C(dynamic_cast<const DSIGTransformC14n*>(t)->getPrefixList()).str() << endl;
}
}
else {
cout << "Unknown c14n method" << endl;
}
}
else if (dynamic_cast<const DSIGTransformEnvelope*>(t)) {
cout << "enveloped signature" << endl;
}
else if (dynamic_cast<const DSIGTransformXPath*>(t)) {
const DSIGTransformXPath* xp = dynamic_cast<const DSIGTransformXPath*>(t);
cout << "XPath" << endl;
// Check for namespaces
DOMNamedNodeMap* atts = xp->getNamespaces();
if (atts != 0) {
XMLSize_t s = atts->getLength();
for (XMLSize_t i = 0 ; i < s; ++i) {
levelSet(level);
cout << "Namespace : " << X2C(atts->item(i)->getNodeName()).str() <<
"=\"" << X2C(atts->item(i)->getNodeValue()).str() << "\"\n";
}
}
levelSet(level);
// Hmm - this is really a bug. This should return a XMLCh string
cout << "Expr : " << xp->getExpression() << endl;
}
else if (dynamic_cast<const DSIGTransformXPathFilter*>(t)) {
const DSIGTransformXPathFilter * xpf = dynamic_cast<const DSIGTransformXPathFilter*>(t);
cout << "XPath-Filter2" << endl;
unsigned int s = xpf->getExprNum();
for (unsigned int i = 0; i < s; ++i) {
levelSet(level);
cout << "Filter : ";
const DSIGXPathFilterExpr * e = xpf->expr(i);
switch (e->getFilterType()) {
case DSIGXPathFilterExpr::FILTER_UNION :
cout << "union : \"";
break;
case DSIGXPathFilterExpr::FILTER_INTERSECT :
cout << "intersect : \"";
break;
default :
cout << "subtract : \"";
}
// Now the expression
char * str = XMLString::transcode(e->getFilter());
cout << str << "\"" << endl;
XSEC_RELEASE_XMLCH(str);
}
}
else if (dynamic_cast<const DSIGTransformXSL*>(t)) {
cout << "XSLT" << endl;
// Really should serialise and output stylesheet.
}
else {
cout << "unknown transform type" << endl;
}
}