public class StylesheetModule
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.List<ComponentDeclaration> |
topLevel |
Constructor and Description |
---|
StylesheetModule(StyleElement rootElement,
int precedence) |
Modifier and Type | Method and Description |
---|---|
static javax.xml.transform.Source |
getAssociatedStylesheet(Configuration config,
javax.xml.transform.URIResolver resolver,
javax.xml.transform.Source source,
java.lang.String media,
java.lang.String title,
java.lang.String charset)
Get the stylesheet specification(s) associated
via the xml-stylesheet processing instruction (see
http://www.w3.org/TR/xml-stylesheet/) with the document
document specified in the source parameter, and that match
the given criteria.
|
Configuration |
getConfiguration() |
StylesheetModule |
getImporter() |
int |
getInputTypeAnnotations()
Get the value of the input-type-annotations attribute, for this module combined with that
of all included/imported modules.
|
int |
getMinImportPrecedence()
Get the minimum import precedence of this module, that is, the lowest import precedence of the modules
that it imports.
|
int |
getPrecedence() |
PrincipalStylesheetModule |
getPrincipalStylesheetModule() |
StyleElement |
getRootElement() |
XSLModuleRoot |
getStylesheetElement() |
static PreparedStylesheet |
loadStylesheet(javax.xml.transform.Source styleSource,
Compilation compilation)
Build the tree representation of a stylesheet module
|
static DocumentImpl |
loadStylesheetModule(javax.xml.transform.Source styleSource,
boolean topLevelModule,
Compilation compilation,
NestedIntegerValue precedence)
Build the tree representation of a stylesheet module
|
void |
setImporter(StylesheetModule importer) |
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 min)
Set the minimum import precedence of this module, that is, the lowest import precedence of the modules
that it imports.
|
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.
|
protected java.util.List<ComponentDeclaration> topLevel
public StylesheetModule(StyleElement rootElement, int precedence)
public static DocumentImpl loadStylesheetModule(javax.xml.transform.Source styleSource, boolean topLevelModule, Compilation compilation, NestedIntegerValue precedence) throws XPathException
styleSource
- the source of the moduletopLevelModule
- true if this module is the outermost module of a packagecompilation
- the XSLT compilation episodeprecedence
- the import precedence for static variables declared
in the module. (This is handled differently from the precedence of other components
because it needs to be allocated purely sequentially).XPathException
- if XML parsing or tree
construction failspublic static PreparedStylesheet loadStylesheet(javax.xml.transform.Source styleSource, Compilation compilation) throws XPathException
styleSource
- the source of the module. This must contain either XSLT source code
of a top-level module (which may contains xsl:include, xsl:import, or
xsl:use-package), or it must contain a package in export format. This method
is not used when compiling subsidiary modules or library packages.compilation
- the XSLT compilation episodeXPathException
- if XML parsing or tree
construction failspublic static javax.xml.transform.Source getAssociatedStylesheet(Configuration config, javax.xml.transform.URIResolver resolver, javax.xml.transform.Source source, java.lang.String media, java.lang.String title, java.lang.String charset) throws XPathException
config
- The Saxon Configurationsource
- The XML source document.media
- The media attribute to be matched. May be null, in which
case the prefered templates will be used (i.e. alternate = no).
Note that Saxon does not implement the complex CSS3-based syntax for
media queries. By default, the media value is simply ignored. An algorithm for
comparing the requested media with the declared media can be defined using
the method Configuration.setMediaQueryEvaluator(Comparator)
.title
- The value of the title attribute to match. May be null.charset
- The value of the charset attribute to match. May be null.XPathException
- if any problems occurpublic void setImporter(StylesheetModule importer)
public StylesheetModule getImporter()
public PrincipalStylesheetModule getPrincipalStylesheetModule()
public StyleElement getRootElement()
public XSLModuleRoot getStylesheetElement()
public Configuration getConfiguration()
public int getPrecedence()
public void setWasIncluded()
public void setMinImportPrecedence(int min)
min
- the minimum import precedencepublic int getMinImportPrecedence()
public void spliceIncludes() throws XPathException
XPathException
- if the included/imported module is invalidpublic int getInputTypeAnnotations()
XSLModuleRoot.ANNOTATION_STRIP
and XSLModuleRoot.ANNOTATION_PRESERVE
public void setInputTypeAnnotations(int annotations) throws XPathException
XSLModuleRoot.ANNOTATION_STRIP
and XSLModuleRoot.ANNOTATION_PRESERVE
annotations
- the value of the input-type-annotations attribute, for this module combined with that
of all included/imported modules.XPathException
- if the values of the attribute in different modules are inconsistentCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.