Package net.sf.saxon.trans
Class PackageLoaderHE
- java.lang.Object
-
- net.sf.saxon.trans.PackageLoaderHE
-
- All Implemented Interfaces:
IPackageLoader
public class PackageLoaderHE extends Object implements IPackageLoader
This class reads the XML exported form of a package and reconstructs the package object in memory.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
PackageLoaderHE.ExpressionLoader
static interface
PackageLoaderHE.PatternLoader
-
Field Summary
Fields Modifier and Type Field Description Map<String,StylesheetPackage>
allPackages
List<Action>
completionActions
protected static Map<String,PackageLoaderHE.ExpressionLoader>
eMap
Stack<List<ComponentInvocation>>
fixups
protected static Map<String,String>
licensableConstructs
Stack<LocalBinding>
localBindings
protected Stack<StylesheetPackage>
packStack
(package private) static Map<String,PackageLoaderHE.PatternLoader>
pMap
StylesheetPackage
topLevelPackage
Map<SymbolicName,UserFunction>
userFunctions
-
Constructor Summary
Constructors Constructor Description PackageLoaderHE(Configuration config)
-
Method Summary
-
-
-
Field Detail
-
packStack
protected final Stack<StylesheetPackage> packStack
-
fixups
public final Stack<List<ComponentInvocation>> fixups
-
topLevelPackage
public StylesheetPackage topLevelPackage
-
allPackages
public final Map<String,StylesheetPackage> allPackages
-
localBindings
public Stack<LocalBinding> localBindings
-
userFunctions
public final Map<SymbolicName,UserFunction> userFunctions
-
eMap
protected static final Map<String,PackageLoaderHE.ExpressionLoader> eMap
-
pMap
static final Map<String,PackageLoaderHE.PatternLoader> pMap
-
-
Constructor Detail
-
PackageLoaderHE
public PackageLoaderHE(Configuration config)
-
-
Method Detail
-
processAccumulatorList
public static void processAccumulatorList(PackageLoaderHE loader, SourceDocument inst, String accumulatorNames)
-
getConfiguration
public Configuration getConfiguration()
-
getTopLevelPackage
public StylesheetPackage getTopLevelPackage()
-
getPackage
public StylesheetPackage getPackage(String key)
-
getPackStack
public Stack<StylesheetPackage> getPackStack()
-
addCompletionAction
public void addCompletionAction(Action action)
-
loadPackage
public StylesheetPackage loadPackage(Source source) throws XPathException
- Specified by:
loadPackage
in interfaceIPackageLoader
- Throws:
XPathException
-
loadPackageDoc
public StylesheetPackage loadPackageDoc(NodeInfo doc) throws XPathException
- Specified by:
loadPackageDoc
in interfaceIPackageLoader
- Throws:
XPathException
-
needsPELicense
public void needsPELicense(String name)
-
needsEELicense
public void needsEELicense(String name)
-
loadPackageElement
public void loadPackageElement(NodeInfo packageElement, StylesheetPackage pack) throws XPathException
- Throws:
XPathException
-
addVendorFunctionLibrary
protected void addVendorFunctionLibrary(FunctionLibraryList targetList, Configuration config)
-
readSchemaNamespaces
protected void readSchemaNamespaces(NodeInfo packageElement) throws XPathException
- Throws:
XPathException
-
readFunction
public UserFunction readFunction(NodeInfo functionElement) throws XPathException
- Throws:
XPathException
-
makeFunction
protected UserFunction makeFunction(String flags)
-
getChild
public NodeInfo getChild(NodeInfo parent, int n)
Get the n'th element child of an element (zero-based)- Parameters:
parent
- the parent elementn
- which child to get (zero-based)- Returns:
- the n'th child, or null if not available
-
getFirstChildExpression
public Expression getFirstChildExpression(NodeInfo parent) throws XPathException
- Throws:
XPathException
-
getSecondChildExpression
public Expression getSecondChildExpression(NodeInfo parent) throws XPathException
- Throws:
XPathException
-
getNthChildExpression
public Expression getNthChildExpression(NodeInfo parent, int n) throws XPathException
- Throws:
XPathException
-
getExpressionWithRole
public Expression getExpressionWithRole(NodeInfo parent, String role) throws XPathException
- Throws:
XPathException
-
loadExpression
public Expression loadExpression(NodeInfo element) throws XPathException
- Throws:
XPathException
-
makeRetainedStaticContext
public RetainedStaticContext makeRetainedStaticContext(NodeInfo element)
-
fromExportedNamespaces
public static NamespaceMap fromExportedNamespaces(String nsAtt)
-
getPatternWithRole
public Pattern getPatternWithRole(NodeInfo parent, String role) throws XPathException
- Throws:
XPathException
-
getTypeAttribute
public SchemaType getTypeAttribute(NodeInfo element, String attName)
-
getQNameAttribute
public StructuredQName getQNameAttribute(NodeInfo element, String localName)
-
getListOfQNameAttribute
public List<StructuredQName> getListOfQNameAttribute(NodeInfo element, String localName) throws XPathException
- Throws:
XPathException
-
getIntegerAttribute
public int getIntegerAttribute(NodeInfo element, String localName) throws XPathException
Read an integer-valued attribute- Parameters:
element
- the element on which the attribute appearslocalName
- the name of the attribute- Returns:
- the integer value of the attribute if present and correct; or Integer.MIN_VALUE if absent
- Throws:
XPathException
- if the attribute is present but not integer-valued.
-
parseSequenceType
public SequenceType parseSequenceType(NodeInfo element, String name) throws XPathException
Parse the SequenceType whose value is held in the attribute named "name"- Parameters:
element
- the element containing this attributename
- the local name of the attribute- Returns:
- the SequenceType held in the content of the attribute, or "item()*" if the attribute is absent
- Throws:
XPathException
- if the sequence type is invalid
-
parseAlphaCode
public SequenceType parseAlphaCode(NodeInfo element, String name) throws XPathException
Parse the SequenceType whose value is held in the attribute named "name", as an alphacode- Parameters:
element
- the element containing this attributename
- the local name of the attribute- Returns:
- the SequenceType held in the content of the attribute, or "item()*" if the attribute is absent
- Throws:
XPathException
- if the sequence type is invalid
-
parseAlphaCodeForItemType
public ItemType parseAlphaCodeForItemType(NodeInfo element, String name) throws XPathException
- Throws:
XPathException
-
parseItemTypeAttribute
public ItemType parseItemTypeAttribute(NodeInfo element, String attName) throws XPathException
Parse the ItemType whose value is held in the attribute named "name"- Parameters:
element
- the element containing this attributeattName
- the local name of the attribute- Returns:
- the SequenceType held in the content of the attribute, or "item()" if the attribute is absent
- Throws:
XPathException
- if the item type is invalid
-
makeAtomicComparer
public AtomicComparer makeAtomicComparer(String name, NodeInfo element) throws XPathException
- Throws:
XPathException
-
getChildExpressionList
protected static List<Expression> getChildExpressionList(PackageLoaderHE loader, NodeInfo element) throws XPathException
- Throws:
XPathException
-
getChildExpressionArray
protected static Expression[] getChildExpressionArray(PackageLoaderHE loader, NodeInfo element) throws XPathException
- Throws:
XPathException
-
getOperator
protected static int getOperator(String opAtt)
-
processComponentReference
protected boolean processComponentReference(StylesheetPackage pack, ComponentInvocation call) throws XPathException
- Throws:
XPathException
-
-