org.deegree.feature.xpath
Class FeatureXPath

java.lang.Object
  extended by org.jaxen.BaseXPath
      extended by org.deegree.feature.xpath.FeatureXPath
All Implemented Interfaces:
Serializable, org.jaxen.XPath

public class FeatureXPath
extends org.jaxen.BaseXPath

Jaxen XPath implementation for Feature objects.

This is the entry point for matching an XPath expression against a Feature. Let fc be a FeatureCollection that you want to match against. Create a compiled XPath object, then match it against one or more context nodes using the BaseXPath.selectNodes(Object) method, as in the following example (which features the infamous Philosoper feature type):

 XPath xpath = new FeatureXPath( "gml:featureMember/app:Philosopher/app:friend/app:Philosopher//app:name" );
 xpath.setNamespaceContext( nsContext );
 List<?> selectedNodes = xpath.selectNodes( new FeatureNode( null, fc ) );
 

Version:
$Revision:$, $Date:$
Author:
Markus Schneider , last edited by: $Author:$
See Also:
GMLObjectNode, Serialized Form

Constructor Summary
FeatureXPath(String xpathExpr, Feature rootFeature, GMLVersion version)
          Create a new FeatureXPath from an XPath expression string.
 
Method Summary
 
Methods inherited from class org.jaxen.BaseXPath
addNamespace, booleanValueOf, createFunctionContext, createNamespaceContext, createVariableContext, debug, evaluate, getContext, getContextSupport, getFunctionContext, getNamespaceContext, getNavigator, getRootExpr, getVariableContext, numberValueOf, selectNodes, selectNodesForContext, selectSingleNode, selectSingleNodeForContext, setFunctionContext, setNamespaceContext, setVariableContext, stringValueOf, toString, valueOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FeatureXPath

public FeatureXPath(String xpathExpr,
                    Feature rootFeature,
                    GMLVersion version)
             throws org.jaxen.JaxenException
Create a new FeatureXPath from an XPath expression string.

Parameters:
xpathExpr - the XPath expression
rootFeature - root of the navigation hierarchy (document node)
version - determines the names and types of the standard GML properties, can be null (if no properties such as "gml:name" are used)
Throws:
org.jaxen.JaxenException - if there is a syntax error in the expression


Copyright © 2011. All Rights Reserved.