public class StylesheetPackage extends PackageData
Modifier and Type | Field and Description |
---|---|
protected java.util.Properties |
defaultOutputProperties |
protected GlobalContextRequirement |
globalContextRequirement |
protected java.util.List<Component> |
hiddenComponents |
protected java.util.Map<StructuredQName,java.util.Properties> |
namedOutputProperties |
protected java.util.HashMap<SymbolicName,Component> |
overriddenComponents |
protected java.util.Set<java.lang.String> |
schemaIndex |
protected SpaceStrippingRule |
stripperRules |
config, keyManager
Constructor and Description |
---|
StylesheetPackage(Configuration config)
Create a stylesheet package
|
Modifier and Type | Method and Description |
---|---|
void |
addCompletionAction(Action action)
Register a callback action to be performed during the completion phase of building the package
|
void |
addComponent(Component component)
Add a component to the package
|
void |
addComponentsFromUsedPackage(StylesheetPackage usedPackage,
java.util.List<XSLAccept> acceptors,
java.util.Set<SymbolicName> overrides)
Add modified copies of components from a package that is referenced from this one in an xsl:use-package declaration
|
void |
addGlobalVariable(GlobalVariable variable)
Add a global variable to the list of global variables contained in this package
|
void |
addHiddenComponent(Component component) |
protected void |
addIxslFunctionLibrary(FunctionLibraryList functionLibrary) |
void |
addOverriddenComponent(Component comp) |
void |
addUsedPackage(StylesheetPackage pack)
Add a package to the list of packages directly used by this one
|
void |
allocateBinderySlots()
Allocate slots to global variables.
|
void |
checkForAbstractComponents() |
protected void |
complete()
Perform all registered completion actions for the package
|
boolean |
contains(StylesheetPackage pack)
Ask whether a given library package is within the package subtree rooted at this package
|
void |
createFunctionLibrary()
Create the function library containing stylesheet functions declared in this package
|
void |
export(ExpressionPresenter presenter)
Output the abstract expression tree to the supplied destination.
|
java.util.Map<SymbolicName,Component> |
getAbstractComponents() |
CharacterMapIndex |
getCharacterMapIndex()
Get the index of named character maps defined in this package
|
Component |
getComponent(SymbolicName name)
Get the component within this package having a given symbolic name
|
java.util.HashMap<SymbolicName,Component> |
getComponentIndex()
Get a map containing all the components in this package, indexed by symbolic name
|
GlobalContextRequirement |
getContextItemRequirements()
Get the required context item type and other details of the global context item.
|
StructuredQName |
getDefaultMode()
Get the default mode for the package
|
protected UserFunction |
getFunction(SymbolicName.F name)
Get the function with a given name and arity
|
FunctionLibraryList |
getFunctionLibrary()
Get the function library.
|
int |
getMaxFunctionArity()
Get the maximum arity of functions in this package
|
java.util.Properties |
getNamedOutputProperties(StructuredQName name)
Get a set of named output properties
|
Component |
getOverriddenComponent(SymbolicName name)
If this component overrides a component named N, get the component that N overrides (that
is, the component identified by xsl:original appearing within the overriding declaration of N)
|
java.lang.String |
getPackageName()
Get the name identifier of the xsl:package as an absolute URI
|
PackageVersion |
getPackageVersion()
Get the package-version identifier appearing on the xsl:package element
|
RuleManager |
getRuleManager()
Get the rule manager, which knows about all the modes present in the package
|
java.util.Set<java.lang.String> |
getSchemaNamespaces()
Get the set of namespaces of schema declarations imported into this package
|
SpaceStrippingRule |
getSpaceStrippingRule()
Get the whitespace stripping rules for this package
|
SpaceStrippingRule |
getStripperRules()
Get the whitespace stripping rules for source documents loaded from within this package
|
java.lang.Iterable<StylesheetPackage> |
getUsedPackages()
Get the packages referenced from this package in an xsl:use-package declaration
|
int |
getVersion()
Get the version of the XSLT language specification to which the package manifest conforms
|
XQueryFunctionLibrary |
getXQueryFunctionLibrary()
Get the library of functions imported from XQuery
|
boolean |
isCreatesSecondaryResultDocuments()
Ask whether the package contains an xsl:result-document instruction
|
boolean |
isDeclaredModes()
Ask whether it is required that modes be explicitly declared
|
boolean |
isFallbackToNonStreaming()
Ask whether a non-streamable construct has been found, forcing the entire stylesheet
to fall back to unstreamed processing
|
boolean |
isImplicitPackage()
Ask if this is an implicit package (one rooted at xsl:stylesheet or xsl:transform rather than xsl:package
|
boolean |
isJustInTimeCompilation()
Ask whether the package was compiled with just-in-time compilation of template rules enabled
|
boolean |
isRetainUnusedFunctions()
Ask whether private functions for which there are no static references need to be
retained
|
boolean |
isStripsTypeAnnotations()
Ask whether the package defines that type annotations should be stripped from input
documents loaded from within this package
|
boolean |
isStripsWhitespace()
Ask whether there is an xsl:strip-space declaration in the stylesheet package
|
void |
setCharacterMapIndex(CharacterMapIndex characterMapIndex)
Set the index of named character maps defined in this package
|
void |
setContextItemRequirements(GlobalContextRequirement requirement)
Set the required context item type.
|
void |
setCreatesSecondaryResultDocuments(boolean createsSecondaryResultDocuments)
Say whether the package contains an xsl:result-document instruction
|
void |
setDeclaredModes(boolean declared)
Say whether it is required that modes be explicitly declared
|
void |
setDefaultMode(StructuredQName defaultMode)
Set the default mode for the package
|
void |
setDefaultOutputProperties(java.util.Properties props)
Set the default (unnamed) serialization properties to be used for documents output
using xsl:result-document instructions within this package
|
void |
setFallbackToNonStreaming() |
void |
setFunctionLibraryDetails(FunctionLibraryList library,
ExecutableFunctionLibrary overriding,
ExecutableFunctionLibrary underriding)
Set details of functions available for calling anywhere in this package.
|
void |
setImplicitPackage(boolean implicitPackage)
Say whether this is an implicit package (one rooted at xsl:stylesheet or xsl:transform rather than xsl:package
|
void |
setJustInTimeCompilation(boolean justInTimeCompilation)
Say whether the package was compiled with just-in-time compilation of template rules enabled.
|
void |
setNamedOutputProperties(StructuredQName name,
java.util.Properties props)
Define a named set serialization properties to be used for documents output
using xsl:result-document instructions within this package
|
void |
setPackageName(java.lang.String packageName)
Set the name of the package
|
void |
setPackageVersion(PackageVersion version)
Set the package-version identifier appearing on the xsl:package element
|
void |
setRetainUnusedFunctions()
Say that private functions need to be retained, typically because the stylesheet
package uses xsl:evaluate or fn:function-lookup
|
void |
setRuleManager(RuleManager ruleManager)
Set the rule manager, which knows about all the modes present in the package
|
void |
setStripperRules(SpaceStrippingRule stripperRules)
Set the whitespace stripping rules for source documents loaded from within this package
|
void |
setStripsTypeAnnotations(boolean stripsTypeAnnotations)
Say whether the package defines that type annotations should be stripped from input
documents loaded from within this package
|
void |
setStripsWhitespace(boolean strips)
Say whether there is an xsl:strip-space declaration in the stylesheet package
|
void |
setVersion(int version)
Set the version of the XSLT language specification to which the package manifest conforms
|
void |
updatePreparedStylesheet(PreparedStylesheet pss)
Copy information from this package to the PreparedStylesheet.
|
getAccumulatorRegistry, getConfiguration, getDecimalFormatManager, getGlobalSlotManager, getGlobalVariableList, getHostLanguage, getKeyManager, getLocalLicenseId, getTargetEdition, getXPathVersion, isRelocatable, isSchemaAware, obtainTypeAliasManager, setAccumulatorRegistry, setConfiguration, setDecimalFormatManager, setGlobalSlotManager, setHostLanguage, setKeyManager, setLocalLicenseId, setRelocatable, setSchemaAware, setTargetEdition, setTypeAliasManager
protected GlobalContextRequirement globalContextRequirement
protected SpaceStrippingRule stripperRules
protected java.util.Properties defaultOutputProperties
protected java.util.Map<StructuredQName,java.util.Properties> namedOutputProperties
protected java.util.Set<java.lang.String> schemaIndex
protected java.util.List<Component> hiddenComponents
protected java.util.HashMap<SymbolicName,Component> overriddenComponents
public StylesheetPackage(Configuration config)
config
- the Saxon Configurationpublic java.util.HashMap<SymbolicName,Component> getComponentIndex()
public java.lang.Iterable<StylesheetPackage> getUsedPackages()
public void addUsedPackage(StylesheetPackage pack)
pack
- the used packagepublic boolean contains(StylesheetPackage pack)
pack
- the library packagepublic void setVersion(int version)
version
- the version (times ten) as an integerpublic void setPackageName(java.lang.String packageName)
packageName
- the name of the package. This is supposed to be an absolute URI, but Saxon accepts any string.public int getVersion()
public PackageVersion getPackageVersion()
public void setPackageVersion(PackageVersion version)
version
- the version identifier as a structured entitypublic java.lang.String getPackageName()
public boolean isImplicitPackage()
public void setImplicitPackage(boolean implicitPackage)
implicitPackage
- true if this package was rooted at an xsl:stylesheet or xsl:transform elementpublic boolean isJustInTimeCompilation()
public void setJustInTimeCompilation(boolean justInTimeCompilation)
justInTimeCompilation
- set to true if just-in-time compilation was enabled when the package was compiledpublic RuleManager getRuleManager()
public void setRuleManager(RuleManager ruleManager)
ruleManager
- the rule managerpublic StructuredQName getDefaultMode()
public void setDefaultMode(StructuredQName defaultMode)
defaultMode
- the default mode for the packagepublic void setDeclaredModes(boolean declared)
declared
- true if modes referenced within this package must be explicitly declaredpublic boolean isDeclaredModes()
public SpaceStrippingRule getSpaceStrippingRule()
public CharacterMapIndex getCharacterMapIndex()
public void setCharacterMapIndex(CharacterMapIndex characterMapIndex)
characterMapIndex
- the index of named character mapspublic boolean isCreatesSecondaryResultDocuments()
public void setCreatesSecondaryResultDocuments(boolean createsSecondaryResultDocuments)
createsSecondaryResultDocuments
- true if the package contains an xsl:result-document instructionpublic boolean isStripsTypeAnnotations()
public void setStripsTypeAnnotations(boolean stripsTypeAnnotations)
stripsTypeAnnotations
- set to true if documents loaded by this package
should have any type annotations stripped.public SpaceStrippingRule getStripperRules()
public void setStripperRules(SpaceStrippingRule stripperRules)
stripperRules
- the whitespace stripping rules for this packagepublic void setDefaultOutputProperties(java.util.Properties props)
props
- the default serialization properties for this packagepublic void setNamedOutputProperties(StructuredQName name, java.util.Properties props)
name
- the name of the serialization property setprops
- the serialization propertiespublic java.util.Properties getNamedOutputProperties(StructuredQName name)
name
- the output declaration namepublic java.util.Set<java.lang.String> getSchemaNamespaces()
public void setContextItemRequirements(GlobalContextRequirement requirement) throws XPathException
requirement
- details of the requirement for the global context itemXPathException
public GlobalContextRequirement getContextItemRequirements()
public void setStripsWhitespace(boolean strips)
strips
- true if an xsl:strip-space declaration has been foundpublic boolean isStripsWhitespace()
public void addCompletionAction(Action action)
action
- the callback actionprotected void complete() throws XPathException
XPathException
- if any of these completion actions failspublic void allocateBinderySlots()
public void addComponent(Component component)
component
- the component to be addedpublic void addGlobalVariable(GlobalVariable variable)
PackageData
addGlobalVariable
in class PackageData
variable
- the global variable to be addedpublic int getMaxFunctionArity()
public Component getComponent(SymbolicName name)
name
- the symbolic name of the required componentpublic void addHiddenComponent(Component component)
public Component getOverriddenComponent(SymbolicName name)
name
- the name Npublic void addOverriddenComponent(Component comp)
public void addComponentsFromUsedPackage(StylesheetPackage usedPackage, java.util.List<XSLAccept> acceptors, java.util.Set<SymbolicName> overrides) throws XPathException
usedPackage
- the used packageacceptors
- abstraction of a list of xsl:accept declarations, which can modify the visibility of accepted componentsoverrides
- the set of names of components from the used package that are overridden in the using packageXPathException
- if duplicate components are foundpublic void createFunctionLibrary()
protected void addIxslFunctionLibrary(FunctionLibraryList functionLibrary)
public FunctionLibraryList getFunctionLibrary()
public XQueryFunctionLibrary getXQueryFunctionLibrary()
public void setFunctionLibraryDetails(FunctionLibraryList library, ExecutableFunctionLibrary overriding, ExecutableFunctionLibrary underriding)
overriding
- library of stylesheet functions declared with override=yesunderriding
- library of stylesheet functions declared with override=noprotected UserFunction getFunction(SymbolicName.F name)
name
- the symbolic name of the function (QName plus arity)public boolean isRetainUnusedFunctions()
public void setRetainUnusedFunctions()
public void updatePreparedStylesheet(PreparedStylesheet pss) throws XPathException
pss
- the PreparedStylesheet to be updatedXPathException
- if the PreparedStylesheet cannot be updatedpublic java.util.Map<SymbolicName,Component> getAbstractComponents()
public void export(ExpressionPresenter presenter) throws XPathException
presenter
- the expression presenter used to display the structureXPathException
public void checkForAbstractComponents() throws XPathException
XPathException
public boolean isFallbackToNonStreaming()
public void setFallbackToNonStreaming()
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.