Free Trial - Stylus Studio, The World's Best XML IDE!


com.saxonica.schema
Class PathSelection

java.lang.Object
  |
  +--com.saxonica.schema.PathSelection
All Implemented Interfaces:
Selection

public class PathSelection
extends java.lang.Object
implements Selection

A PathSelection is a Selection that applies a NodeTest to each element between the context element and the node being tested, and returns true if they all match. This class is used internally in the validation of instance documents against uniqueness and identity constraints; it is not intended for use by user applications.


Constructor Summary
PathSelection(NodeTest[] tests, boolean anchored, NodeTest attributeTest)
           
 
Method Summary
 boolean canMatchAttributes()
          Determine whether the selection can match attribute nodes
 boolean canMatchElementContent()
          Determin whether the selection can match element content
 NodeTest getAttributeTest()
           
 boolean matchesAttribute(int fingerprint)
          Determine whether a given attribute matches the Selection
 boolean matchesElement(int[] stack, int contextPosition, int length)
          Determine whether the selector matches a given element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathSelection

public PathSelection(NodeTest[] tests,
                     boolean anchored,
                     NodeTest attributeTest)
Method Detail

matchesElement

public boolean matchesElement(int[] stack,
                              int contextPosition,
                              int length)
Determine whether the selector matches a given element. The element is identified by an array of integers representing the fingerprints of the names of this element and each of its ancestors, in document order (i.e., root element first, matched element last).

Specified by:
matchesElement in interface Selection
Parameters:
stack - the array of name fingerprints
contextPosition - the position in this array of the context element for the selection.
length - the effective length of the array; any items beyond this position are ignored
Returns:
true if the element matches

getAttributeTest

public NodeTest getAttributeTest()

matchesAttribute

public boolean matchesAttribute(int fingerprint)
Determine whether a given attribute matches the Selection

Specified by:
matchesAttribute in interface Selection
Returns:
true if it matches, false if it does not match

canMatchAttributes

public boolean canMatchAttributes()
Determine whether the selection can match attribute nodes

Specified by:
canMatchAttributes in interface Selection

canMatchElementContent

public boolean canMatchElementContent()
Determin whether the selection can match element content

Specified by:
canMatchElementContent in interface Selection


Stylus Studio features integrated development and debugging support for Saxon in the XQuery editor and XSLT editor.