Hi Alice,
If your XPath expression selects a node set, you will get an empty node set
if nothing was selected. If there is a syntactic or semantic error in your
expression, you will get an exception.
Dave
[EMAIL PROTECTED]
k To:
[email protected]
cc: (bcc: David N
Bertoni/Cambridge/IBM)
12/09/2003 05:37 Subject: Re: Begginer question:
Xalan XObjectPtr and evaluate
AM
Thanks for the reply!
But for the second part of my question...
How can i know the xpath i'm evaluting has 'failed'?
Great Day :)
>
> Hi Alice,
>
> There is no "standard solution," because it depends on what kind of
object
> your XPath expression returns. If it's node set, the set will contain
> nodes in the source tree you passed into the evalution. All you need to
> do
> in that case is copy the node set, or copy the pointers out of the node
> set. If your expression evaluates to a boolean, string, or number, you
> can
> just make a copy of the value.
>
> NodeRefList nodeSet = xobjectPtr.nodeset();
> XalanDOMString str = xobjectPtr.str();
> ...
>
> At any rate, you must make sure the XObjectPtr instance is not in scope
> when the XPathEvaluator instance is destroyed, or when the next
evaluation
> occurs.
>
> Dave
>
>
>
>
> [EMAIL PROTECTED]
> k To:
> [email protected]
> cc: (bcc: David N
> Bertoni/Cambridge/IBM)
> 12/06/2003 11:30 Subject: Begginer
question:
> Xalan XObjectPtr and evaluate
> PM
>
>
>
>
> Hi,
> I'm new to Xalan and this list...
>
> I am using xalan's xpath api, and i want to return a XObjectPtr from my
> function, but then, when i evaluate again, the app crashes, I read
> somewhere that the XObjectPtr should not exist if the XPathEvaluator
> doesn't exist anymore, or a new evaluation accurs, but what should i do
in
> this case? Is there a 'standart solution'?
>
> And another question is what should i excpect to get from evaluate if the
> evaluated xpath doesn't exist in a doc (or simply, how can i check if
> something exists in my xml document?)
>
> Thanks.
> Alice.
>
>
>
>