Class SaxonParam

  • All Implemented Interfaces:
    javax.xml.transform.Source, javax.xml.transform.SourceLocator, ActiveSource, GroundedValue, Item, MutableNodeInfo, NamespaceResolver, NodeInfo, Sequence, Location, SteppingNode, SiblingCountingNode, org.xml.sax.Locator

    public class SaxonParam
    extends AnnotationParent
    This object represents a saxon:param element in a schema document. The element may appear only as a child of xs:schema. It permits a validation episode to be parameterized, and thus allows a schema to define different sets of assertions (for example) for use under different circumstances, for example at different stages of the life-cycle of the document being validated.

    The saxon:param element is similar to a stylesheet parameter in XSLT. The permitted attributes are name (the name of the parameter), select (an XPath expression giving a default value for the parameter), as (a SequenceType giving the required type of the parameter).

    The element declares a variable that is in scope for all XPath expressions appearing within the same schema document. It is an error for two schema documents to declare the same variable.

    • Constructor Detail

      • SaxonParam

        public SaxonParam()
    • Method Detail

      • prepareAttributes

        protected void prepareAttributes()
                                  throws SchemaException
        Description copied from class: SchemaElement
        Set the attribute list for the element. This is called to process the attributes (note the distinction from processAttributes in the superclass). Must be supplied in a subclass
        Specified by:
        prepareAttributes in class SchemaElement
        Throws:
        SchemaException
      • makeSequenceType

        public SequenceType makeSequenceType​(java.lang.String sequenceType,
                                             StaticContext env)
                                      throws SchemaException
        Process an attribute whose value is a SequenceType
        Parameters:
        sequenceType - the source text of the attribute
        env - the static context for evaluating the sequence type
        Returns:
        the processed sequence type
        Throws:
        SchemaException - if the syntax is invalid or for example if it refers to a type that is not in the static context
      • makeQName

        public final StructuredQName makeQName​(java.lang.String lexicalQName)
                                        throws SchemaException
        Make a structured QName, using this Element as the context for namespace resolution, and registering the code in the namepool. If the name is unprefixed, the default namespace is not used.
        Parameters:
        lexicalQName - The lexical QName as written, in the form "[prefix:]localname". The name must have already been validated as a syntactically-correct QName. Leading and trailing whitespace will be trimmed
        Returns:
        the StructuredQName representation of this lexical QName
        Throws:
        SchemaException - if the qname is not a lexically-valid QName, or if the name is in a reserved namespace.