BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
XALAN
org.apache.xpath.CachedXPathAPI Class
org.apache.xml.serializer.Serializer Interface
org.apache.xml.serializer.Encodings Class
org.apache.xml.serializer.DOMSerializer Interface
org.apache.xml.dtm.DTMManager Class
org.apache.xalan.xslt.Process Class
org.apache.xalan.xslt.EnvironmentCheck Class
org.apache.xalan.xsltc.trax.TransformerFactoryImpl Class
org.apache.xalan.xsltc.trax.TemplatesImpl Class
org.apache.xalan.xsltc.trax.SmartTransformerFactoryImpl Class
org.apache.xalan.xsltc.trax.DOM2SAX Class
org.apache.xalan.transformer.XalanProperties Class
org.apache.xalan.transformer.TrAXFilter Class
org.apache.xalan.transformer.TransformerIdentityImpl Class
org.apache.xalan.processor.TransformerFactoryImpl Class
org.apache.xalan.lib.sql.XConnection Class
javax.xml.transform.sax.TemplatesHandler Class
XALAN Getting Started with XSLTC
The Usage of XALAN
Overview of XALAN - Java
<< WCF, WS, SOAP
XHTML >>

By :Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :03/24/2008
Times viewed :1867

 

Xalan: The org.apache.xpath.XPathAPI Class

Extends: java.lang.Object

Members

Signature

Public methods

static XObject

eval(Node contextNode, java.lang.String str)

static XObject

eval(Node contextNode, java.lang.String str, Node namespaceNode)

static XObject

eval(Node contextNode, java.lang.String str, PrefixResolver prefixResolver)

static NodeIterator

selectNodeIterator(Node contextNode, java.lang.String str)

static NodeIterator

selectNodeIterator(Node contextNode, java.lang.String str, Node namespaceNode)

static NodeList

selectNodeList(Node contextNode, java.lang.String str)

static NodeList

selectNodeList(Node contextNode, java.lang.String str, Node namespaceNode)

static Node

selectSingleNode(Node contextNode, java.lang.String str)

static Node

selectSingleNode(Node contextNode, java.lang.String str, Node namespaceNode)

Overview

This class provides methods to implement low-level XPath API. This is the best class to be used for one time use. As most of the methods in this class are static so you can use it by applying on the context node. In my application, most of the time, I have used methods when I need to use XPath to instead of doing DOM manipulation.

The methods in this class are convenience methods into the low-level XPath API. These functions tend to be a little slow, since a number of objects must be created for each evaluation. A faster way is to precompile the XPaths using the low-level API, and then just use the XPaths over and over. NOTE: In particular, each call to this method will create a new XPathContext, a new DTMManager... and thus a new DTM. That's very safe, since it guarantees that you're always processing against a fully up-to-date view of your document. But it's also portentially very expensive, since you're rebuilding the DTM every time. You should consider using an instance of CachedXPathAPI rather than these static methods.

Method Overviews

The methods in this class are convenience methods into the low-level XPath API. These functions tend to be a little slow, since a number of objects must be created for each evaluation.

When performance is a issue, then better to use precompile the XPaths using the low-level API, and then just use the XPaths over and over.

NOTE: In particular, each call to this method will create a new XPathContext, a new DTMManager... and thus a new DTM. That's very safe, since it guarantees that you're always processing against a fully up-to-date view of your document. But it's also portentially very expensive, since you're rebuilding the DTM every time. You should consider using an instance of CachedXPathAPI rather than these static methods.

Example of selectNodeIterator(Node contextNode, java.lang.String str)

selectNodeIterator() is used to used to get a nodelist in the form of NodeIterator by applying an XPath on contextNode.

NodeIterator iterator = XPathAPI.selectNodeIterator(doc,"//person");//Instead of person you can provide a string representation of XPath.

Example of selectNodeList(Node contextNode, java.lang.String str)

selectNodeList() is used to get a NodeList by applying XPath on the context node.

NodeIterator iterator = XPathAPI.selectNodeList(doc,"//person");//Instead of person you can provide a string representation of XPath.


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

Integration Specialist Needed - Wor
Virtualization Server Infrastructur
A great opportunity to Digital Vide
here is a greate opportunity as a S
A great opportunity as a Network En

View all Jobs (Add yours)
View all CV (Add yours)




swimming pool contractor
chicago web site design
international conference call
Web Hosting
it help desk
Christian Dior sunglasses
answering service


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP