com.icl.saxon.pattern
Class DocumentPattern

java.lang.Object
  |
  +--com.icl.saxon.pattern.Pattern
        |
        +--com.icl.saxon.pattern.DocumentPattern

public class DocumentPattern
extends Pattern

A DocumentPattern is a pattern that matches only the root node of a document


Fields inherited from class com.icl.saxon.pattern.Pattern
staticContext
 
Constructor Summary
DocumentPattern()
           
 
Method Summary
 Name getName()
          If this pattern will match only nodes of a single name, return the relevant node name.
 int getType()
          Determine the type of nodes to which this pattern applies.
 boolean isRelative()
          Determine if the pattern uses positional filters
 boolean matches(NodeInfo node, Context c)
          Determine whether a node matches the pattern
 java.lang.String toString()
          Return the pattern as a string
 
Methods inherited from class com.icl.saxon.pattern.Pattern
getDefaultPriority, getNameTest, getStaticContext, make, make, setStaticContext, simplify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DocumentPattern

public DocumentPattern()
Method Detail

matches

public boolean matches(NodeInfo node,
                       Context c)
                throws org.xml.sax.SAXException
Determine whether a node matches the pattern
Overrides:
matches in class Pattern
Following copied from class: com.icl.saxon.pattern.Pattern
Parameters:
node - The NodeInfo representing the Element or other node to be tested against the Pattern
context - The context in which the match is to take place. Only relevant if the pattern uses variables.
Returns:
true if the node matches the Pattern, false otherwise

getType

public int getType()
Determine the type of nodes to which this pattern applies.
Overrides:
getType in class Pattern
Returns:
NodeInfo.DOCUMENT

getName

public Name getName()
If this pattern will match only nodes of a single name, return the relevant node name. This is used for quick elimination of patterns that will never match.
Overrides:
getName in class Pattern
Following copied from class: com.icl.saxon.pattern.Pattern
Returns:
A Name that the nodes must possess, or null Otherwise return null.

toString

public java.lang.String toString()
Return the pattern as a string
Overrides:
toString in class java.lang.Object

isRelative

public boolean isRelative()
Determine if the pattern uses positional filters
Overrides:
isRelative in class Pattern
Returns:
false always