Thanks Pavani/Joseph,
Just to confirm..

it's basically the result of the XPath expression.
i mean when we write a simple stylesheet,
it can either return a boolean value like in the
<xsl:if expression, or a nodelist in cases we select nodes.
or say a count() which returns a number
So in this case we supply the select expression in the method
selectSingleNode()/ selectNodeList()

thanks,
karthik.

-----Original Message-----
From: Joseph Kesselman/CAM/Lotus [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 11, 2002 6:15 PM
To: Karthik Gurumurthy
Cc: [EMAIL PROTECTED]
Subject: Re: need some tips on XObject?



As the Javadoc for XObject says,
 * This class represents an XPath object, and is capable of
 * converting the object to various types, such as a string.
 * This class acts as the base class to other XPath type objects,
 * such as XString, and provides polymorphic casting capabilities.

Basically, XObject is the shared superclass of the various objects that the
XPath API may return, and defines the behavior they all share.  For your
purposes, the important calls are:

getType()/getTypeString()     to find out which specific type of value was
returned
num()                   to reduce the returned value to a single number
bool()                        to reduce the returned value to a single
boolean
str()                   to reduce the returned value to a single String
nodeset()               to reduce the returned value to a DOM-like
NodeIterator

... and maybe the comparison methods (lessThan, deepEquals and so on), if
you want to operate on XObjects before extracting their Java values.

Most of the other calls are intended for use inside Xalan, and unless you
have special needs you probably don't need to worry about them.


Reply via email to