|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectnet.sf.saxon.tree.NodeImpl
net.sf.saxon.tree.ElementImpl
net.sf.saxon.tree.ElementWithAttributes
net.sf.saxon.style.StyleElement
public abstract class StyleElement
Abstract superclass for all element nodes in the stylesheet.
Note: this class implements Locator. The element
retains information about its own location in the stylesheet, which is useful when
an XSL error is found.
| Field Summary | |
|---|---|
static int |
REPORT_ALWAYS
|
static int |
REPORT_IF_INSTANTIATED
|
static int |
REPORT_UNLESS_FALLBACK_AVAILABLE
|
static int |
REPORT_UNLESS_FORWARDS_COMPATIBLE
|
| Fields inherited from class net.sf.saxon.tree.NodeImpl |
|---|
NODE_LETTER |
| Fields inherited from interface net.sf.saxon.om.NodeInfo |
|---|
ALL_NAMESPACES, EMPTY_NAMESPACE_LIST, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACES |
| Fields inherited from interface net.sf.saxon.om.ValueRepresentation |
|---|
EMPTY_VALUE_ARRAY |
| Constructor Summary | |
|---|---|
StyleElement()
Constructor |
|
| Method Summary | |
|---|---|
void |
addChild(NodeImpl node,
int index)
Add a child node to this node. |
int |
allocateLocationId(String systemId,
int lineNumber)
Allocate a location identifier |
void |
allocatePatternSlots(Pattern match,
SlotManager frame)
Allocate space for range variables within predicates in the match pattern. |
void |
allocateSlots(Expression exp)
Allocate slots in the local stack frame to range variables used in an XPath expression |
void |
allocateSlots(Pattern pattern)
Allocate slots to any variables used within a pattern. |
boolean |
backwardsCompatibleModeIsEnabled()
Determine whether backwards-compatible mode is enabled for this element |
XSLVariableDeclaration |
bindVariable(int fingerprint)
Bind a variable used in this element to the compiled form of the XSLVariable element in which it is declared |
void |
checkEmpty()
Convenience method to check that the stylesheet element is empty |
void |
checkTopLevel(String errorCode)
Convenience method to check that the stylesheet element is at the top level |
void |
checkWithinTemplate()
Check that the stylesheet element is within a sequence constructor |
void |
compact(int size)
Compact the space used by this node |
abstract Expression |
compile(Executable exec)
Compile the instruction on the stylesheet tree into an executable instruction for use at run-time. |
Expression |
compileSequenceConstructor(Executable exec,
AxisIterator iter,
boolean includeParams)
Compile the children of this instruction on the stylesheet tree, adding the subordinate instructions to the parent instruction on the execution tree. |
AxisIterator |
enumerateChildren(NodeTest test)
Get an enumeration of the children of this node |
void |
fixupReferences()
Fix up references from XPath expressions. |
boolean |
forwardsCompatibleModeIsEnabled()
Determine whether forwards-compatible mode is enabled for this element |
String |
getAttributeValue(String clarkName)
Get an attribute value given the Clark name of the attribute (that is, the name in {uri}local format). |
int |
getConstructType()
Get the type of construct. |
SlotManager |
getContainingSlotManager()
Get the SlotManager for the containing Procedure definition |
XSLStylesheet |
getContainingStylesheet()
Get the containing XSLStylesheet element |
Executable |
getExecutable()
Get the Executable (representing a complete stylesheet or query) of which this Container forms part |
NodeInfo |
getFirstChild()
Get the first child node of the element |
int |
getHostLanguage()
Get the host language (XSLT, XQuery, XPath) used to implement the code in this container |
NodeInfo |
getLastChild()
Get the last child node of the element |
int |
getLineNumber()
Get the line number of the node within its source document entity |
int |
getLineNumber(int locationId)
Get the line number within the document or module containing a particular location |
LocationProvider |
getLocationProvider()
Get the LocationProvider allowing location identifiers to be resolved. |
NamespaceResolver |
getNamespaceResolver()
Get the namespace context of the instruction. |
int |
getObjectFingerprint()
Get a fingerprint identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc. |
int |
getObjectNameCode()
Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc. |
int |
getPrecedence()
Get the import precedence of this stylesheet element. |
PreparedStylesheet |
getPreparedStylesheet()
Get the PreparedStylesheet object. |
Iterator |
getProperties()
Get an iterator over all the properties available. |
Object |
getProperty(String name)
Get the value of a particular property of the instruction. |
SchemaType |
getSchemaType(String typeAtt)
Get the Schema type definition for a type named in the stylesheet (in a "type" attribute). |
StaticContext |
getStaticContext()
Get the static context for expressions on this element |
String |
getStringValue()
Return the string-value of the node, that is, the concatenation of the character content of all descendent elements and text nodes. |
CharSequence |
getStringValueCS()
Get the value of the item as a CharSequence. |
XSLFunction |
getStylesheetFunction(int fingerprint,
int arity)
Get a FunctionCall declared using an xsl:function element in the stylesheet |
String |
getSystemId(int locationId)
Get the URI of the document or module containing a particular location |
NamePool |
getTargetNamePool()
Get the namepool to be used at run-time, this namepool holds the names used in all XPath expressions and patterns |
int |
getTypeAnnotation(SchemaType schemaType)
Get the type annotation to use for a given schema type |
BigDecimal |
getVersion()
Get the numeric value of the version number on this element, or inherited from its ancestors |
boolean |
hasChildNodes()
Determine if the node has any children. |
boolean |
isExcludedNamespace(short uriCode)
Check whether a namespace uri defines an namespace excluded from the result. |
boolean |
isExtensionNamespace(short uriCode)
Check whether a namespace uri defines an extension element. |
boolean |
isInstruction()
Determine whether this node is an instruction. |
boolean |
isTopLevel()
Test whether this is a top-level element |
Expression |
makeAttributeValueTemplate(String expression)
Make an attribute value template in the context of this stylesheet element |
Expression |
makeExpression(String expression)
Make an expression in the context of this stylesheet element |
int |
makeNameCode(String qname)
Make a NameCode, using this Element as the context for namespace resolution, and registering the code in the namepool. |
SavedNamespaceContext |
makeNamespaceContext()
Make a NamespaceContext object representing the list of in-scope namespaces. |
Pattern |
makePattern(String pattern)
Make a pattern in the context of this stylesheet element |
SequenceType |
makeSequenceType(String sequenceType)
Process an attribute whose value is a SequenceType |
void |
markTailCalls()
Mark tail-recursive calls on templates and functions. |
boolean |
mayContainFallback()
Determine whether this type of element is allowed to contain an xsl:fallback instruction |
boolean |
mayContainSequenceConstructor()
Determine whether this type of element is allowed to contain a sequence constructor |
void |
postValidate()
Hook to allow additional validation of a parent element immediately after its children have been validated. |
abstract void |
prepareAttributes()
Set the attribute list for the element. |
void |
processAllAttributes()
Process the attributes of this element and all its children |
void |
processAttributes()
Process the attribute list for the element. |
boolean |
replaceSubExpression(Expression original,
Expression replacement)
Replace one subexpression by a replacement subexpression |
void |
reportAbsence(String attribute)
Convenience method to report the absence of a mandatory attribute |
void |
setLineNumber(int lineNumber)
Set the line number of the element within its source document entity |
void |
setObjectNameCode(int nameCode)
Set the object name code |
void |
substituteFor(StyleElement temp)
Make this node a substitute for a temporary one previously added to the tree. |
Expression |
typeCheck(String name,
Expression exp)
Type-check an expression. |
Pattern |
typeCheck(String name,
Pattern pattern)
Type-check a pattern. |
void |
useChildrenArray(NodeImpl[] array)
Supply an array to be used for the array of children. |
void |
validate()
Check that the stylesheet element is valid. |
void |
validateSubtree()
Recursive walk through the stylesheet to validate all nodes |
| Methods inherited from class net.sf.saxon.tree.ElementWithAttributes |
|---|
copy, getAttributeList, getAttributeValue, getDeclaredNamespaces, getInScopeNamespaceCodes, getPrefixForURI, getURICodeForPrefix, getURIForPrefix, initialise, iteratePrefixes, sendNamespaceDeclarations, setNamespaceDeclarations |
| Methods inherited from class net.sf.saxon.tree.ElementImpl |
|---|
generateId, getBaseURI, getDocumentRoot, getNameCode, getNodeKind, getRoot, getSystemId, setNameCode, setSystemId |
| Methods inherited from class net.sf.saxon.tree.NodeImpl |
|---|
atomize, compareOrder, equals, getColumnNumber, getConfiguration, getDisplayName, getDocumentNumber, getFingerprint, getLocalPart, getNamePool, getNextInDocument, getNextSibling, getParent, getPrefix, getPreviousInDocument, getPreviousSibling, getPublicId, getTypeAnnotation, getTypedValue, getURI, hashCode, isSameNodeInfo, iterateAxis, iterateAxis |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sf.saxon.trace.InstructionInfo |
|---|
getSystemId |
| Field Detail |
|---|
public static final int REPORT_ALWAYS
public static final int REPORT_UNLESS_FORWARDS_COMPATIBLE
public static final int REPORT_IF_INSTANTIATED
public static final int REPORT_UNLESS_FALLBACK_AVAILABLE
| Constructor Detail |
|---|
public StyleElement()
| Method Detail |
|---|
public Executable getExecutable()
Container
getExecutable in interface Containerpublic LocationProvider getLocationProvider()
getLocationProvider in interface Containerpublic NamePool getTargetNamePool()
public StaticContext getStaticContext()
public int getLineNumber()
ElementImpl
getLineNumber in interface SourceLocatorgetLineNumber in interface NodeInfogetLineNumber in interface InstructionInfogetLineNumber in interface LocatorgetLineNumber in class ElementImplpublic void setLineNumber(int lineNumber)
ElementImpl
setLineNumber in class ElementImplpublic void substituteFor(StyleElement temp)
public boolean isInstruction()
public void markTailCalls()
public boolean mayContainSequenceConstructor()
public boolean mayContainFallback()
public XSLStylesheet getContainingStylesheet()
public int getPrecedence()
public final int makeNameCode(String qname)
throws XPathException,
NamespaceException
qname - The name as written, in the form "[prefix:]localname". The name must have
already been validated as a syntactically-correct QName.
XPathException - if the qname is not a lexically-valid QName, or if the name
is in a reserved namespace.
NamespaceException - if the prefix of the qname has not been declaredpublic SavedNamespaceContext makeNamespaceContext()
public void processAllAttributes()
throws XPathException
XPathExceptionpublic String getAttributeValue(String clarkName)
public final void processAttributes()
throws XPathException
XPathException
public abstract void prepareAttributes()
throws XPathException
XPathException
public Expression makeExpression(String expression)
throws XPathException
XPathException
public Pattern makePattern(String pattern)
throws XPathException
XPathException
public Expression makeAttributeValueTemplate(String expression)
throws XPathException
XPathException
public SequenceType makeSequenceType(String sequenceType)
throws XPathException
XPathExceptionpublic BigDecimal getVersion()
public boolean forwardsCompatibleModeIsEnabled()
public boolean backwardsCompatibleModeIsEnabled()
public boolean isExtensionNamespace(short uriCode)
uriCode - the namespace URI code being testedpublic boolean isExcludedNamespace(short uriCode)
uriCode - the code of the namespace URI being tested
public SchemaType getSchemaType(String typeAtt)
throws XPathException
XPathException - if the type is not declared in an
imported schema, or is not a built-in typepublic int getTypeAnnotation(SchemaType schemaType)
public void validate()
throws XPathException
XPathException
public void postValidate()
throws XPathException
XPathException
public Expression typeCheck(String name,
Expression exp)
throws XPathException
XPathExceptionpublic void allocateSlots(Expression exp)
exp - the XPath expression for which slots are to be allocatedpublic void allocateSlots(Pattern pattern)
public void allocatePatternSlots(Pattern match,
SlotManager frame)
public Pattern typeCheck(String name,
Pattern pattern)
throws XPathException
XPathException
public void fixupReferences()
throws XPathException
XPathExceptionpublic SlotManager getContainingSlotManager()
public void validateSubtree()
throws XPathException
XPathExceptionpublic PreparedStylesheet getPreparedStylesheet()
public void checkWithinTemplate()
throws XPathException
XPathException - if not within a sequence constructor
public void checkTopLevel(String errorCode)
throws XPathException
XPathException - if not at top level
public void checkEmpty()
throws XPathException
XPathException - if it is not empty
public void reportAbsence(String attribute)
throws XPathException
XPathException - if the attribute is missing
public abstract Expression compile(Executable exec)
throws XPathException
XPathException
public Expression compileSequenceConstructor(Executable exec,
AxisIterator iter,
boolean includeParams)
throws XPathException
XPathException
public int allocateLocationId(String systemId,
int lineNumber)
public boolean isTopLevel()
public XSLVariableDeclaration bindVariable(int fingerprint)
throws StaticError
fingerprint - The fingerprint of the name of the variable
StaticError - if the variable has not been declared
public XSLFunction getStylesheetFunction(int fingerprint,
int arity)
fingerprint - the fingerprint of the name of the functionarity - the number of arguments in the function call. The value -1
indicates that any arity will do (this is used to support the function-available() function).
public int getConstructType()
Location. This method is part of the InstructionInfo interface
getConstructType in interface InstructionInfopublic int getObjectNameCode()
getObjectNameCode in interface InstructionInfopublic int getObjectFingerprint()
public void setObjectNameCode(int nameCode)
public NamespaceResolver getNamespaceResolver()
getNamespaceResolver in interface InstructionInfopublic Object getProperty(String name)
InstructionInfo interface for run-time tracing and debugging. The properties
available include all the attributes of the source instruction (named by the attribute name):
these are all provided as string values.
getProperty in interface InstructionInfoname - The name of the required property
public Iterator getProperties()
getProperties in interface InstructionInfopublic String getSystemId(int locationId)
LocationProvider
getSystemId in interface LocationProviderlocationId - identifier of the location in question (as passed down the Receiver pipeline)
public int getLineNumber(int locationId)
LocationProvider
getLineNumber in interface LocationProviderlocationId - identifier of the location in question (as passed down the Receiver pipeline)
public int getHostLanguage()
getHostLanguage in interface ContainerConfiguration.XSLT or Configuration.XQUERY
public boolean replaceSubExpression(Expression original,
Expression replacement)
replaceSubExpression in interface Containeroriginal - the original subexpressionreplacement - the replacement subexpression
public final boolean hasChildNodes()
hasChildNodes in interface NodeInfohasChildNodes in class NodeImpltrue if the node has any children,
false if the node has no children.public final AxisIterator enumerateChildren(NodeTest test)
test - A NodeTest to be satisfied by the child nodes, or null
if all child node are to be returnedpublic final NodeInfo getFirstChild()
getFirstChild in class NodeImplpublic final NodeInfo getLastChild()
getLastChild in class NodeImplpublic String getStringValue()
Item.getStringValueCS()public CharSequence getStringValueCS()
NodeImpl
getStringValueCS in interface ItemgetStringValueCS in interface ValueRepresentationgetStringValueCS in class NodeImplItem.getStringValue()public void useChildrenArray(NodeImpl[] array)
public void addChild(NodeImpl node,
int index)
public void compact(int size)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||