This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: XPath and XSLT processor


>   Can you give me an example of using XPath with Saxon. There 
> was no example with the code I download.

There are some simple examples in the ShowBooks.java program, but for more
complex things, such as setting the namespace context, you'll need to scout
around the API documentation. To get you started:

Expression exp = Expression.make(xpath)
turns a string containing an XPath expression into an Expression object

Expression exp = Expression.make(xpath, staticContext)
allows you to supply a staticContext object which is capable of resolving
namespaces, variable references, etc

Value v = exp.evaluate(context)

evaluates an expression in a specific run-time context. The run-time context
defines the context node, etc.

Mike Kay 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]