Hi Jason,

That's an old sample, which doesn't really catch the appropriate
exceptions.  If you want to enter a bug in the database, we can update it,
but I really want to get rid of it.

Try using the SimpleXPathAPI sample, because it will catch the appropriate
exception and not dump.  Also, the APIs used in SimpleXPathAPI are the
official external APIs, and are more stable than the internal ones.

Thanks!



|---------+--------------------------->
|         |           "Jason Jesso"   |
|         |           <[EMAIL PROTECTED]|
|         |           atrix.com>      |
|         |                           |
|         |           01/28/2004 11:36|
|         |           AM              |
|         |           Please respond  |
|         |           to xalan-c-users|
|---------+--------------------------->
  
>------------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                             
                                                                   |
  |        To:      [email protected]                                
                                                                   |
  |        cc:      (bcc: David N Bertoni/Cambridge/IBM)                        
                                                                   |
  |        Subject: XPathWrapper core dump                                      
                                                                   |
  
>------------------------------------------------------------------------------------------------------------------------------------------------|



Hi:

I am using the latest Xalan for AIX.

I run the sample program like:

xml-xalan/c/bin/XPathWrapper ./foo.xml /doc "/doc/name/text()"

the result set has 10 strings
item 1= "Mr. Marston"
item 2= "Mr. Bertoni"
item 3= "Mr. Leslie"
item 4= "Ms. Farmer"
item 5= "Ms. Midy"
item 6= "Mr. Dick"
item 7= "Mr. Boag"
item 8= "Mr. Curcuru"
item 9= "Mr. Kesselman"
item 10= "Mr. Auriemma"



With no problems.

If I try running it with an invalid XPath expression, the program core
dumps.

Like:

xml-xalan/c/bin/XPathWrapper ./foo.xml /doc "/doc/name/txt()"
Abort(coredump)

In the C++ sample code, is there a way to check to see if the XPath
expression is valid?

It core dumps on:

line 243 of XPathWrapper.cpp

theXPathProcessor.initXPath(*xpath,
                                    theXPathConstructionContext,
                                    TranscodeFromLocalCodePage(expr),
                                    ElementPrefixResolverProxy(rootElem,
theEnvSupport, theDOMSupport));

If I follow this example code,  I don't want my code to just crash like
this.

Thanks for any help.




Reply via email to