You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by 장승필 <fr...@iasecurity.com> on 2002/06/28 08:42:37 UTC

David, I don't get that element.

I modify my xml file.

<?xml .... ?>
<dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
 <dsig:SignedInfo xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
  ....
</dsig:Signature>

But, I don't get 'Signature' element
I use the xpath expression, "/descendant-or-self::dsig:Signature"
This throws exception.

My code...
---------------------------------------------
char* strSchema = "http://www.w3.org/2000/09/xmldsig# D:\\xmldsig.xsd" ;
DOMParser* parser = new DOMParser;
DOMParser::ValSchemes    valScheme = DOMParser::Val_Always;
bool                     doNamespaces       = true;
bool                     doSchema           = true;
bool                     schemaFullChecking = true;

parser->setValidationScheme(valScheme);
parser->setDoNamespaces(doNamespaces);
parser->setDoSchema(doSchema);
parser->setExternalSchemaLocation(strSchema) ;
parser->setValidationSchemaFullChecking(schemaFullChecking);

parser->parse(xmlFile);

DOM_Document doc = parser->getDocument() ;
XercesDOMSupport*  support = new XercesDOMSupport() ;
XercesDOMSupport  theDOMSupport ;
XercesParserLiaison  theLiaison(theDOMSupport) ;
XalanDocument*  theDocument = theLiaison.createDocument(doc) ;

XPathEvaluator theEvaluator;
XalanNode* const theContextNode = theDocument->getDocumentElement() ;
const char* xpathstr = "/descendant-or-self::dsig:Signature" ;
const XObjectPtr result = theEvaluator.evaluate(*support, theContextNode, 
                 XalanDOMString(xpathstr).c_str(), theContextNode) ; // <-- throw exception
        .....................