I ‘m no using a work-around :

 

Instead evaluate() method I’m using selectSingleNode() & selectNodeList(), respectively for XPath context and for context – dependant XPath Pattern…

 

 

 

-----Message d'origine-----
De : Fabrice Laborde [mailto:[EMAIL PROTECTED]
Envoyé : jeudi 11 août 2005 18:44
À : xalan-c-users@xml.apache.org
Objet : Assertion on Evaluate() call with special context node

 

Hi,


When calling evaluate() on a XPathEvaluator instance I got an assertion as following

 

Code:

Assertion failed: m_referenceCount == 0, file C:\BuildClient\xalanc_root\Xalan-C
_1_9_0-win32-msvc_60\c\src\xalanc\PlatformSupport\XalanReferenceCountedObject.cp
p, line 43

abnormal program termination
Press any key to continue



This code works fine when context_node handle root document node ( XPath "." ).

In this case, context node does not handle “.” But an other XPath query which is valid … in following lines I can access Node Name … etc

Code:

std::string TTransformerFile::EvalPattern(const std::string& pattern,
                                     XalanNode* context_node,
                                     XalanDocument* ptr_doc,
                                     const XalanDocumentPrefixResolver& resolver,
                                     const std::ofstream& logger,
                                     int n_line){


   XalanDOMString      str = context_node->getNodeName() ;
   std::string result ;
   std::string msg = std::string(" Pattern ") + pattern + std::string(" Using prefix : ") + this->toLocalCodePageString(str);


   /*

   // evaluate the context prefix _expression_...
   const XObjectPtr   XObjResult(
            exprEvaluator.evaluate(
                  DOMSupport,
                  context_node,
                  XalanDOMString(pattern.c_str()).c_str(),
                  resolver));

  */
   const XObjectPtr   XObjResult(
            this->exprEvaluator.evaluate(
                  DOMSupport,
                  context_node,
                  XalanDOMString(pattern.c_str()).c_str())
                  );

....
}



The other call I try is the commented code of evaluate() with resolver use, but with no success


Thanks for your help

Reply via email to