|
|||||||||
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.ParentNodeImpl
net.sf.saxon.tree.ElementImpl
net.sf.saxon.style.StyleElement
net.sf.saxon.style.XSLStylesheet
public class XSLStylesheet
An xsl:stylesheet or xsl:transform element in the stylesheet.
Note this element represents a stylesheet module, not necessarily
the whole stylesheet. However, much of the functionality (and the fields)
are relevant only to the top-level module.
Field Summary | |
---|---|
static int |
ANNOTATION_PRESERVE
|
static int |
ANNOTATION_STRIP
|
(package private) Executable |
exec
|
Fields inherited from class net.sf.saxon.style.StyleElement |
---|
defaultCollationName, defaultXPathNamespace, extensionNamespaces, REPORT_ALWAYS, REPORT_IF_INSTANTIATED, REPORT_UNLESS_FALLBACK_AVAILABLE, REPORT_UNLESS_FORWARDS_COMPATIBLE, reportingCircumstances, staticContext, validationError, version |
Fields inherited from class net.sf.saxon.tree.ElementImpl |
---|
attributeList, nameCode, namespaceList, typeCode |
Fields inherited from class net.sf.saxon.tree.ParentNodeImpl |
---|
children, sequence |
Fields inherited from class net.sf.saxon.tree.NodeImpl |
---|
index, NODE_LETTER, parent |
Fields inherited from interface net.sf.saxon.om.NodeInfo |
---|
ALL_NAMESPACES, EMPTY_NAMESPACE_LIST, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACES |
Constructor Summary | |
---|---|
XSLStylesheet()
|
Method Summary | |
---|---|
protected void |
addImportedSchema(java.lang.String targetNamespace)
|
protected void |
addNamespaceAlias(XSLNamespaceAlias node)
|
int |
allocateGlobalSlot(StructuredQName qName)
Allocate a slot number for a global variable or parameter |
void |
allocatePatternSlots(int n)
Ensure there is enough space for local variables or parameters when evaluating the match pattern of template rules |
int |
allocateUniqueParameterNumber(StructuredQName qName)
Allocate a unique number to a local parameter name. |
Expression |
compile(Executable exec)
Dummy compile() method to satisfy the interface |
void |
compileStylesheet()
Compile the stylesheet to create an executable. |
void |
declareXQueryFunction(XQueryFunction function)
Declare an imported XQuery function |
protected StringCollator |
findCollation(java.lang.String name)
Find a named collation. |
java.util.Properties |
gatherOutputProperties(StructuredQName formatQName)
Create an output properties object representing the xsl:output elements in the stylesheet. |
XSLCharacterMap |
getCharacterMap(StructuredQName name)
Get a character map, identified by the fingerprint of its name. |
CollationMap |
getCollationMap()
Get the collation map |
int |
getDefaultValidation()
Get the value of the default validation attribute |
Executable |
getExecutable()
Get the run-time Executable object |
FunctionLibrary |
getFunctionLibrary()
Get the function library. |
XSLVariableDeclaration |
getGlobalVariable(StructuredQName qName)
Get the global variable or parameter with a given name (taking precedence rules into account) |
protected java.util.HashSet<java.lang.String> |
getImportedSchemaTable()
|
XSLStylesheet |
getImporter()
Get the StyleSheet that included or imported this one. |
int |
getInputTypeAnnotations()
Get the value of the input-type-annotations attribute, for this module combined with that of all included/imported modules. |
int |
getInputTypeAnnotationsAttribute()
Get the value of the input-type-annotations attribute, for this module alone. |
KeyManager |
getKeyManager()
Get the KeyManager which handles key definitions |
LocationMap |
getLocationMap()
Get the locationMap object |
int |
getMinImportPrecedence()
Get the minimum import precedence of this stylesheet, that is, the lowest precedence of any stylesheet imported by this one |
protected int |
getNamespaceAlias(short uriCode)
Get the declared namespace alias for a given namespace URI code if there is one. |
int |
getPrecedence()
Get the import precedence of this stylesheet |
PreparedStylesheet |
getPreparedStylesheet()
Get the owning PreparedStylesheet object |
RuleManager |
getRuleManager()
Get the RuleManager which handles template rules |
protected Mode |
getStripperRules()
Get the rules determining which nodes are to be stripped from the tree |
java.util.List |
getTopLevel()
Get the top level elements in this stylesheet, after applying include/import |
protected boolean |
hasNamespaceAliases()
|
protected void |
indexNamedTemplate(XSLTemplate template)
Add a named template to the index |
protected void |
indexVariableDeclaration(XSLVariableDeclaration var)
Index a global xsl:variable or xsl:param element |
protected boolean |
isAliasResultNamespace(short uriCode)
Determine if a namespace is included in the result-prefix of a namespace-alias |
protected boolean |
isImportedSchema(java.lang.String targetNamespace)
Get an imported schema with a given namespace |
protected boolean |
mayContainParam(java.lang.String attName)
Determine whether this type of element is allowed to contain an xsl:param element |
void |
prepareAttributes()
Prepare the attributes on the stylesheet element |
void |
preprocess()
Preprocess does all the processing possible before the source document is available. |
void |
processAllAttributes()
Process the attributes of every node in the stylesheet |
void |
setCollation(java.lang.String name,
StringCollator collation)
Register a named collation (actually a StringCollator) |
void |
setImporter(XSLStylesheet importer)
Set the StyleSheet that included or imported this one. |
void |
setInputTypeAnnotations(int annotations)
Set the value of the input-type-annotations attribute, for this module combined with that of all included/imported modules. |
void |
setMinImportPrecedence(int precedence)
Set the minimum import precedence of this stylesheet, that is, the lowest precedence of any stylesheet imported by this one |
void |
setNeedsDynamicOutputProperties(boolean b)
Set that this stylesheet needs dynamic output properties |
void |
setPrecedence(int prec)
Set the import precedence of this stylesheet |
void |
setPreparedStylesheet(PreparedStylesheet sheet)
Create link to the owning PreparedStylesheet object |
void |
setWasIncluded()
Indicate that this stylesheet was included (by its "importer") using an xsl:include statement as distinct from xsl:import |
void |
spliceIncludes()
Process xsl:include and xsl:import elements. |
boolean |
stripsWhitespace()
Determine whether this stylesheet does any whitespace stripping |
void |
validate()
Validate this element |
Methods inherited from class net.sf.saxon.tree.ParentNodeImpl |
---|
addChild, compact, enumerateChildren, getFirstChild, getLastChild, getNthChild, getNumberOfChildren, getSequenceNumber, getStringValue, getStringValueCS, hasChildNodes, insertChildren, insertChildrenAt, removeChild, replaceChildrenAt, useChildrenArray |
Methods inherited from class net.sf.saxon.tree.NodeImpl |
---|
atomize, compareOrder, equals, getConfiguration, getDisplayName, getDocumentNumber, getFingerprint, getLineNumber, getLocalPart, getNamePool, getNextInDocument, getNextSibling, getParent, getPhysicalRoot, getPrefix, getPreviousInDocument, getPreviousSibling, getPublicId, getSiblingPosition, getSystemId, getTypedValue, getURI, insertSiblings, isDeleted, isIdref, isSameNodeInfo, iterateAxis, iterateAxis, newBuilder, replace |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.saxon.trace.InstructionInfo |
---|
getLineNumber, getSystemId |
Methods inherited from interface org.xml.sax.Locator |
---|
getColumnNumber, getPublicId |
Methods inherited from interface javax.xml.transform.SourceLocator |
---|
getColumnNumber, getPublicId |
Methods inherited from interface net.sf.saxon.om.NodeInfo |
---|
hashCode |
Field Detail |
---|
Executable exec
public static final int ANNOTATION_STRIP
public static final int ANNOTATION_PRESERVE
Constructor Detail |
---|
public XSLStylesheet()
Method Detail |
---|
public void setPreparedStylesheet(PreparedStylesheet sheet)
sheet
- the PreparedStylesheetpublic PreparedStylesheet getPreparedStylesheet()
getPreparedStylesheet
in class StyleElement
public Executable getExecutable()
getExecutable
in interface Container
getExecutable
in class StyleElement
protected boolean mayContainParam(java.lang.String attName)
StyleElement
mayContainParam
in class StyleElement
attName
- if null, the method tests whether an xsl:param child is allowed.
If non-null, it tests whether an xsl:param child with the given attribute name is allowed
public FunctionLibrary getFunctionLibrary()
public LocationMap getLocationMap()
public RuleManager getRuleManager()
protected Mode getStripperRules()
public boolean stripsWhitespace()
public KeyManager getKeyManager()
public CollationMap getCollationMap()
public void setCollation(java.lang.String name, StringCollator collation)
name
- the name of the collationcollation
- the StringCollator that implements this collationprotected StringCollator findCollation(java.lang.String name)
name
- identifies the name of the collation required
public XSLCharacterMap getCharacterMap(StructuredQName name)
name
- The character map name being sought
public void setPrecedence(int prec)
prec
- the import precedence. Higher numbers indicate higher precedence, but the actual
number has no significancepublic int getPrecedence()
getPrecedence
in class StyleElement
public int getMinImportPrecedence()
public void setMinImportPrecedence(int precedence)
precedence
- the precedence of the first stylesheet module that this one importspublic void setImporter(XSLStylesheet importer)
importer
- the stylesheet module that included or imported this modulepublic XSLStylesheet getImporter()
public void setWasIncluded()
public java.util.List getTopLevel()
public int allocateGlobalSlot(StructuredQName qName)
qName
- the name of the variable or parameter
public void allocatePatternSlots(int n)
allocatePatternSlots
in class StyleElement
n
- the number of slots to be allocatedpublic void prepareAttributes() throws XPathException
prepareAttributes
in class StyleElement
XPathException
public int getDefaultValidation()
Validation.STRIP
public int getInputTypeAnnotationsAttribute() throws XPathException
ANNOTATION_STRIP
and ANNOTATION_PRESERVE
XPathException
public int getInputTypeAnnotations()
ANNOTATION_STRIP
and ANNOTATION_PRESERVE
public void setInputTypeAnnotations(int annotations) throws XPathException
ANNOTATION_STRIP
and ANNOTATION_PRESERVE
annotations
- the value of the input-type-annotations attribute, for this module combined with that
of all included/imported modules.
XPathException
protected int getNamespaceAlias(short uriCode)
uriCode
- The code of the uri used in the stylesheet.
protected boolean isAliasResultNamespace(short uriCode)
uriCode
- the namepool code of the URI
public void validate() throws XPathException
validate
in class StyleElement
XPathException
public void preprocess() throws XPathException
XPathException
public void spliceIncludes() throws XPathException
XPathException
protected void addNamespaceAlias(XSLNamespaceAlias node)
protected void indexVariableDeclaration(XSLVariableDeclaration var) throws XPathException
var
- The XSLVariable or XSLParam element
XPathException
protected void indexNamedTemplate(XSLTemplate template) throws XPathException
template
- The Template object
XPathException
protected boolean hasNamespaceAliases()
public void processAllAttributes() throws XPathException
processAllAttributes
in class StyleElement
XPathException
- in the event of a static error being detectedpublic XSLVariableDeclaration getGlobalVariable(StructuredQName qName)
qName
- name of the global variable or parameter
public void setNeedsDynamicOutputProperties(boolean b)
b
- true if this stylesheet needs dynamic output propertiespublic java.util.Properties gatherOutputProperties(StructuredQName formatQName) throws XPathException
formatQName
- The name of the output format required. If set to null, gathers
information for the unnamed output format
XPathException
- if a named output format does not exist in
the stylesheetpublic void declareXQueryFunction(XQueryFunction function) throws XPathException
function
- the imported function
XPathException
protected boolean isImportedSchema(java.lang.String targetNamespace)
targetNamespace
- The target namespace of the required schema.
Supply an empty string for the default namespace
protected void addImportedSchema(java.lang.String targetNamespace)
protected java.util.HashSet<java.lang.String> getImportedSchemaTable()
public void compileStylesheet() throws XPathException
XPathException
public Expression compile(Executable exec)
compile
in class StyleElement
exec
- the Executable
public int allocateUniqueParameterNumber(StructuredQName qName)
qName
- the local parameter name
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |