|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.style.StylesheetModule net.sf.saxon.style.PrincipalStylesheetModule
public class PrincipalStylesheetModule
Represents the stylesheet module at the root of the import tree, that is, the module that includes or imports all the others. Note that this object is present at compile time only, unlike the Executable, which also exists at run-time.
Field Summary |
---|
Fields inherited from class net.sf.saxon.style.StylesheetModule |
---|
topLevel |
Constructor Summary | |
---|---|
PrincipalStylesheetModule(XSLStylesheet sourceElement,
int precedence)
|
Method Summary | |
---|---|
protected void |
addImportedSchema(String targetNamespace)
|
protected void |
addNamespaceAlias(Declaration node)
|
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. |
protected void |
compileError(String message,
String errorCode)
Compile time error, specifying an error code |
protected void |
compileError(XPathException error)
Report an error with diagnostic information |
void |
compileStylesheet()
Compile the stylesheet to create an executable. |
FunctionLibraryList |
createFunctionLibrary(CompilerInfo info)
Create the function library |
void |
declareXQueryFunction(XQueryFunction function)
Declare an imported XQuery function |
StringCollator |
findCollation(String name,
String baseURI)
Find a named collation. |
Properties |
gatherOutputProperties(StructuredQName formatQName)
Create an output properties object representing the xsl:output elements in the stylesheet. |
protected boolean |
getAttributeSets(StructuredQName name,
List<Declaration> list)
Get the list of attribute-set declarations associated with a given QName. |
Declaration |
getCharacterMap(StructuredQName name)
Get a character map, identified by the fingerprint of its name. |
CollationMap |
getCollationMap()
Get the collation map |
protected XSLFunction |
getFunction(StructuredQName name,
int arity)
Get the function with a given name and arity |
protected Declaration |
getFunctionDeclaration(StructuredQName name,
int arity)
|
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 HashSet<String> |
getImportedSchemaTable()
|
XSLTemplate |
getNamedTemplate(StructuredQName name)
Get the named template with a given name |
protected NamespaceBinding |
getNamespaceAlias(String uri)
Get the declared namespace alias for a given namespace URI code if there is one. |
PreparedStylesheet |
getPreparedStylesheet()
|
PrincipalStylesheetModule |
getPrincipalStylesheetModule()
|
XSLStylesheet |
getStylesheetDocument(DocumentURI key)
Get a module from the cache |
String |
getVersion()
Get the value of the version attribute on the xsl:stylesheet element of the principal stylesheet module |
protected boolean |
hasNamespaceAliases()
|
protected void |
indexFunction(Declaration decl)
Add a stylesheet function to the index |
protected void |
indexNamedTemplate(Declaration decl)
Add a named template to the index |
protected void |
indexVariableDeclaration(Declaration decl)
Index a global xsl:variable or xsl:param element |
protected boolean |
isAliasResultNamespace(String uri)
Determine if a namespace is included in the result-prefix of a namespace-alias |
protected boolean |
isImportedSchema(String targetNamespace)
Get an imported schema with a given namespace |
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 |
protected void |
putFunction(Declaration decl)
|
void |
putStylesheetDocument(DocumentURI key,
XSLStylesheet module)
Add a module to the cache |
void |
setCollation(String name,
StringCollator collation)
Register a named collation (actually a StringCollator) |
void |
setNeedsDynamicOutputProperties(boolean b)
Say that this stylesheet needs dynamic output properties |
void |
setPreparedStylesheet(PreparedStylesheet preparedStylesheet)
|
void |
setVersion(String version)
Set the value of the version attribute on the xsl:stylesheet element of the principal stylesheet module |
boolean |
stripsWhitespace()
Determine whether this stylesheet does any whitespace stripping |
Methods inherited from class net.sf.saxon.style.StylesheetModule |
---|
getImporter, getInputTypeAnnotations, getMinImportPrecedence, getPrecedence, getSourceElement, setImporter, setInputTypeAnnotations, setMinImportPrecedence, setWasIncluded, spliceIncludes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrincipalStylesheetModule(XSLStylesheet sourceElement, int precedence)
Method Detail |
---|
public void setPreparedStylesheet(PreparedStylesheet preparedStylesheet)
public PreparedStylesheet getPreparedStylesheet()
public PrincipalStylesheetModule getPrincipalStylesheetModule()
getPrincipalStylesheetModule
in class StylesheetModule
public FunctionLibraryList createFunctionLibrary(CompilerInfo info)
public FunctionLibrary getFunctionLibrary()
public void declareXQueryFunction(XQueryFunction function) throws XPathException
function
- the imported function
XPathException
- if an error occurspublic void putStylesheetDocument(DocumentURI key, XSLStylesheet module)
key
- the key to be used (based on the absolute URI)module
- the stylesheet document tree corresponding to this absolute URIpublic XSLStylesheet getStylesheetDocument(DocumentURI key)
key
- the key to be used (based on the absolute URI)
public void preprocess() throws XPathException
XPathException
- if errors are found in the stylesheetpublic void processAllAttributes() throws XPathException
XPathException
- if static errors are found in the stylesheetprotected void indexFunction(Declaration decl) throws XPathException
decl
- The declaration wrapping an XSLFunction object
XPathException
- if errors are foundprotected Declaration getFunctionDeclaration(StructuredQName name, int arity)
protected XSLFunction getFunction(StructuredQName name, int arity)
name
- the name of the functionarity
- the arity of the function, or -1 if any arity will do
protected void putFunction(Declaration decl)
protected void indexVariableDeclaration(Declaration decl) throws XPathException
decl
- The Declaration referencing the XSLVariable or XSLParam element
XPathException
- if an error occurspublic XSLVariableDeclaration getGlobalVariable(StructuredQName qName)
qName
- name of the global variable or parameter
public int allocateUniqueParameterNumber(StructuredQName qName)
qName
- the local parameter name
protected void indexNamedTemplate(Declaration decl) throws XPathException
decl
- the declaration of the Template object
XPathException
- if an error occurspublic XSLTemplate getNamedTemplate(StructuredQName name)
name
- the name of the required template
protected void addNamespaceAlias(Declaration node)
protected NamespaceBinding getNamespaceAlias(String uri)
uri
- The uri used in the stylesheet.
protected boolean isAliasResultNamespace(String uri)
uri
- the namespace URI
protected boolean hasNamespaceAliases()
public CollationMap getCollationMap()
public void setCollation(String name, StringCollator collation)
name
- the name of the collationcollation
- the StringCollator that implements this collationpublic StringCollator findCollation(String name, String baseURI)
name
- identifies the name of the collation requiredbaseURI
- the base URI to be used for resolving the collation name if it is relative
public 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 compileStylesheet() throws XPathException
XPathException
- if compilation fails for any reasonprotected boolean isImportedSchema(String targetNamespace)
targetNamespace
- The target namespace of the required schema.
Supply an empty string for the default namespace
protected void addImportedSchema(String targetNamespace)
protected HashSet<String> getImportedSchemaTable()
protected boolean getAttributeSets(StructuredQName name, List<Declaration> list) throws XPathException
name
- the name of the required attribute setlist
- a list to hold the list of XSLAttributeSet elements in the stylesheet tree.
XPathException
- if an error occurspublic boolean stripsWhitespace()
public void setVersion(String version)
version
- the value of the version attributepublic String getVersion()
public void setNeedsDynamicOutputProperties(boolean b)
b
- true if this stylesheet needs dynamic output propertiespublic Declaration getCharacterMap(StructuredQName name)
name
- The character map name being sought
public void allocatePatternSlots(int n)
n
- the number of slots to be allocatedprotected void compileError(String message, String errorCode) throws XPathException
message
- the error messageerrorCode
- the error code. May be null if not known or not defined
XPathException
- unconditionallyprotected void compileError(XPathException error) throws XPathException
error
- contains information about the error
XPathException
- unconditionally, after reporting the error to the ErrorListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |