[Up] |
Work in progressThis version may be updated without notice. |
Copyright © INRIA
An Extensible XML Processor (EXP) is a customizable engine that implements the specification. EXP provides tags, attributes, functions and predefined properties to customize such an engine before its invokation, for example by specifying which catalog to use when unmarshalling an active sheet.
EXP allows to define a fine grained control of the behaviour of an engine. Actually, it allows to bypass the modules auto-loading mechanism.
EXP may be applied to the current active sheet or used to invoke an outer active sheet. In this case, EXP may also be used to manage custom modules by defining new tags, functions, properties and providing their implementations. EXP also provide a mechanism to define macros : instead of supplying a dependant implementation, it is possible to define an active tag, an XPath function or a predefined property with other active tags.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
Note that for reasons of style, these words are not capitalized in this document.
The following specifications are part of the technologies.
1 What is EXP ?
2 Processor usage
2.1 Internal tuning3 Module definition
2.2 Invoking
2.3 Bootstraping
2.4 Passing parameters
2.5 Miscellaneous features
3.1 Implementations binding4 EXP module reference3.1.1 Inline implementation (macro definitions)3.2 Versioning
3.1.2 Dynamic content production
3.3 Module resolution
4.1 Elements
4.2 Foreign attributes
4.3 Predefined properties
4.4 Extended XPath functions
4.5 Data types
A Glossary
B Related specifications
C Lists
C.1 Examples listD for EXP
C.2 Figures list
The
specification describes the generic behaviour of an engine that consider tags as actions to perform (such tags are active tags). As tags that are active are bound to a namespace URI, each set of tags that share the same namespace URI are belonging to a module. The specification describes the usual behaviour of an engine, a data model, how tags of different modules may cooperate, and how modules are loaded automatically.However, a user may find necessary to use an engine that doesn't automatically load the modules, or that must deal with specific custom modules. EXP is an
module that groups this kind of features together.This specification describes the EXP module, that act on the engine behaviour. It describes how to invoke a processor, how to define reusable modules declarations and how to use these declarations for bootstrapping.
In addition, this specification explains how modules must define the bindings between the tags and attributes and their concrete implementation, between the predefined properties and their property resolver, and between the extended XPath functions and their implementation.
An engine that has unmarshalled an active sheet with its own settings is called a processor instance.
EXP provides various means to configure a processor for various purpose.
Internal tuning means acting on the actual active sheet.
Tags that are bound to a module are active tags, and automatically unmarshalled to concrete actions when encountered. When such tags need to be inactive, it is necessary to disable the module for the tags that are using a specific prefix. Thus, the module is still available when using another prefix not disabled. Tags, foreign attributes, predefined properties and extended XPath functions that uses a disabled prefix are inactive, and may cause errors, as explained in the section "module resolution".
Two EXP foreign attributes are designed as directives that enable or disable the tags that are active, and another one that allow to specify a catalog :
This attribute contains a list of prefixes used by the tags to disable; prefixes are separated with blanks. The tags bound to a module for which their prefix is not in this list are active tags. The others are handled by the fallback module.
This attribute contains a list of prefixes used by the tags to enable; prefixes are separated with blanks. The tags bound to a module for which their prefix is in this list are active tags. The others are handled by the fallback module.
Each prefix listed in these attributes must be involved in a namespace declaration. The scope of the enable/disable directive is the whole active sheet.
Only one or zero of these attributes may be used within an active sheet. If none is used, each tag bound to a module is an active tag, others are handled by the fallback module. These attributes must be used in the root element of the active sheet.
An active sheet can't act on the EXP module on itself, that is to say on the active sheet that uses this directives. The EXP module is still active even if not specified when using @exp:enabled-prefixes, which automatically enables the prefix used in this attribute It can't be disabled with @exp:disabled-prefixes. Attempting to disable the EXP module cause a fatal error.
Prefix disabling | |
---|---|
When the main logic procedure of the following active sheet is invoked, it is said that XCL is disabled, thus <XCL:active-sheet>, <XCL:logic> and <XCL:set> are taking in charge by the internal fallback module : they are considered as simple litteral elements. On the contrary, <xcl:for-each> is an active tag. <?xml version="1.0" encoding="iso-8859-1"?> Although they are bound to the same namespace URI, the materials bound to the xcl prefix are active and those bound to the XCL prefix are inactive, as specified in the root element. |
These directives should be used for active sheets that will run on a target not known by the user.
This attribute contains an URI reference to the catalog to use by the actual active sheet. If several catalogs must be specified, the user have to create a catalog that refers to all its catalogs and set its URI in the attribute.
This attribute must be specified on the root element of the active sheet.
If the catalog lead to a definition or a redefinition of some materials used at the same place (including the root element), the right implementation will be used, even if the version is specified.
It is very useful to design XML documents that contains
[TODO: snippet code; these XML documents became dynamic, like shown in the example below.XInclude the example]As a single document may be invoked directly, it is necessary to build another active sheet when a collection of dynamic XML documents needs to be performed. This new active sheet would be able to browse the collection and invoke each item as an active sheet, like shown in the example below, where only one dynamic document is invoked.
The <exp:invoke> tag has been designed for this purpose.
[TODO: XInclude the example]When a program needs to be launched with fine grained control of its behaviour, one often uses command line options. For example :
myTool --super-option=on --another-option=useful --more-option=do_it_like_this fileToProcess
EXP allows to express all the options needed by an engine inside another active sheet.
Thus, an engine could be simply launched like this, without options :
myEngine launcher.exp
The launcher.exp file is not really the file to process; it just instanciates another engine (with the real fileToProcess) with the appropriate options thanks to EXP tags and attributes.
However, implementations are still free to provide command line options or not.
To do so, the launcher simply uses the EXP tags, and eventually the XCL tags. Other modules could also be used, but the role of a launcher is just to customize a new engine that will do the job. Another advantage of using a launcher, is that it is able to pass as parameters any object type, whereas a command line could only pass strings.
Particularly, a launcher may register additional modules that are not known by the default implementation. Notice that for this purpose, the implemented engine is free to use any convenient way, such as defining a specific configuration file.
The engine to invoke will have the knowledge of custom module bindings if an that declares these resources has been specified, like shown above. The following example is such a catalog.
Declaring EXP modules with | |||
---|---|---|---|
The following document is a catalog that bind resources (module definitions and schemata) to a namespace URI : <?xml version="1.0" encoding="iso-8859-1"?> The customized processor instance will first registers the modules provided by the default implementation. Then, the additional modules will be registered. Notice that it is possible to override some tags of the modules provided by the default implementation : in fact, another version of the module must be specified (the version is indicated inside the module definition). This catalog file should be placed in a directory where the <exp:unmarshal> element. engine automatically adds the files in its own catalog list, if such feature is provided, or explicitely referenced as a parameter name "use-catalog" of theIf several catalogs have to be used, this parameter can be specified several times, but a master catalog is more appropriate. Please refer to the for further information about XML catalogs. specification
Notice that an active sheet can also self-define a catalog to use, as explained in the "internal tuning" section. |
EXP is the sole module that can't be overriden. Furthermore, to escape EXP in an active sheet, it is mandatory to use a launcher that disables EXP in the outer active sheet.
The only way to act on the EXP module in an active sheet is to use a second active sheet for bootstrapping (see the section about internal tuning).
For this purpose, <exp:unmarshal> uses the following two attributes :
Notice that @exp:disable-prefixes and @exp:enable-prefixes in one hand, and @disable-prefixes and @enable-prefixes of the <exp:unmarshal> element on the other hand are not the same attributes.
The formers (that are foreign attributes) are designed to act on the active sheet they belong (if they are active), the latters (that are not foreign attributes) are designed to act on an external active sheet.
@disable-prefixes and @enable-prefixes are taking precedence on @exp:disable-prefixes and @exp:enable-prefixes.
EXP prefix disabling | |
---|---|
This example shows an active sheet used as an external tuning of the other active sheet of the previous "prefix disabling" example . If the following active sheet was used to invoke the former, exp would be disabled in the invoked active sheet, and all the tags would be active tags. However, this would cause an error due to the XCL specification. <?xml version="1.0" encoding="iso-8859-1"?> |
The <exp:invoke> element uses a context to pass parameters to the data set used by the invoked processor, and the <exp:exports> element to keep return values in the data set used by the invoker.
Passing parameters example | |
---|---|
<exp:invoke processor="{$proc}"> <!-- the target processor will be able to use $boat-name --> <xcl:param name="boat-name" value="titanic"/> <exp:exports> <!-- if the target processor has created the property $captain-age it is reproduced inside this launcher when exiting the target processor --> <exp:export name="captain-age" scope="global" value="{$captain-age}"/> <xcl:if test="{ $boat/@has-sunk }"> <!-- another property is created inside this launcher, but there is a condition --> <exp:export name="casualties" scope="local" value="{ value( $boat/@casualties )}"/> </xcl:if> </exp:exports> </exp:invoke> The <xcl:param> element is a convenient action to pass parameters to the processor instance to invoke. When the invoked process ends, the $captain-age and $casulaties properties are exported to the data set in use when the processor instance was invoked ; notice that the $casulaties are set only if the boat sunk (did it ?). |
EXP allows to tune the logs at runtime. This can be done thanks to the <exp:log> active tag :
Additionally, the log output flow may be specified with the <exp:log-stream> element and its @output attribute. If the value is a string, it denotes a file to write to, otherwise it must be a reference to an output stream. A log output flow may be specified only once on behalf of a processor instance.
When unmarshalling, the engine usually use schemata to check the validity of tags unmarshalled by the engine. When a constraint violation is encountered, the engine must go on to report other errors. The @fail-fast attribute of the <exp:unmarshal> element is a directive that allows to stop the unmarshall phase as soon as an error occurs.
Notice that validity checking may also be turned off.
This chapter introduces the structure that allows to map foreign attributes, predefined properties and extended XPath functions) with their concrete implementation. See also the chapter about modularization of the specification.
materials (tags,A module definition will be unmarshalled by the processor only if it is used.
The <exp:module> element is used to define the materials of the module. It is the root element of the module definition.
A processor instance will use the module bindings known by the implementation :
Of course, the self-bindings are implementation dependant ; others should be defined inside a catalog.
The <exp:module> element works with 2 usages :
In both cases, @target contains a prefix that must be bound to a namespace URI. This prefix is used for the mappings of the module, defined by the subelements.
<?xml version="1.0" encoding="iso-8859-1"?> |
The elements <exp:element>, <exp:attribute>, <exp:property>, and <exp:function>, may appear in any order zero or more times.
In addition :
If <exp:module> is the root of an XML active sheet, the module definition produced is set on the current object.
Additional attributes may have other roles when unmarshalling or at runtime. Please refer to the reference for the exhaustive description.
The @deferred attribute ("yes" or "no") may be used to force the module definitions to be loaded when unmarshalling. By default, the bindings are processed the first time the module is invoked.
When the @source attribute is missing, the implementation is given by the subelements of the definition ; thus, a definition can be a kind of "macro". When a macro is processed, a new data set is used, but parameters may be passed, and some properties set by the macro may also be kept (with the <exp:export> element).
The example below shows an active tag which is defined inline. This other example shows several XPath functions which are also defined inline.
Macro tag | |
---|---|
The following definition of the custom <macro:transform-and-save> element doesn't use the @source attribute ; its implementation is defined with its subtags for parsing, transforming, and saving an XML file to a PDF file. <exp:element name="macro:transform-and-save" xmlns:io="http://ns.inria.org/active-tags/io" xmlns:xcl="http://ns.inria.org/active-tags/xcl" xmlns:serialize="http://ns.inria.org/active-tags/serialize" xmlns:macro="http://www.foo.com/macros"> <xcl:parse name="xml" source="{$exp:params/file}"/> <xcl:transform name="fo" source="{$xml}" stylesheet="{$exp:params/xslt}"/> <serialize:to-pdf output="{substring-before( $exp:params/file/@absolute-path, '.xml' )}.pdf" The element previously defined is used with 2 attributes (@file and @xslt). This attributes become named items of the $exp:params predefined property. Usage of our custom element <macro:transform-and-save> : <?xml version="1.0" encoding="iso-8859-1"?> Remember that our custom tag will be active only if a catalog that refers to its implementation has been plugged to the active sheet. Please refer to the previous chapter. Notice that if the implementation is missing, our custom tag will be considered as a litteral ; to force the engine fails if the implementation is missing, the @exp:enable-prefixes or @exp:disable-prefixes attributes can help. |
An inline implementation may use itself an element defined by an inline implementation. For this purpose, $exp:params must be saved before using, and restored after. Similarly, $exp:args must be saved before using an extended XPath function, and restored after.
The element definition must be unmarshalled only once it is invoked (unused elements won't be unmarshalled).
Inline implementation may be used advantageously to produce content inside a dynamic active sheet. These usage is close to "web server pages" technologies such as JSP, ASP or PHP. When a family of tags are encountered and recognized as belonging to a module, they are replaced by the result produced at runtime.
Dynamic content production | |
---|---|
The following module defines a macro that creates a table of content. Others elements of the same module are copied with their attributes, and their content are processed. <?xml version="1.0" encoding="iso-8859-1"?> The following active sheet uses the module defined above. When processed, the <macro:insert-toc> tag will be replaced by the table of content computed. <?xml version="1.0" encoding="iso-8859-1"?> Result after processing : <?xml version="1.0" encoding="iso-8859-1"?> |
Any module must define a foreign attribute that sets the version of the module used. When used, this attribute must appear only once per module on the root element.
The name of this attribute is a qualified name; its prefix is those of the module, and its local-name is "version".
For example, exp:version="1.0" xcl:version="1.0" are valid declarations.
Some modules may oblige to use such attribute.
When not specified, the processor will use the last known version of the module.
Module designers may define a namespace URI per version of their module if they don't want to deal with versioning.
As the versionings are defined with foreign attributes, they are applied with the restrictions propers to foreign attributes :
Foreign attributes are applied in the order they defined by their own, that is version dependant. Once found, the foreign attributes are ordered and applied; thus, if a version setting has been specified, it can be applied only on things that has not been yet resolved : the element that hosts the foreign attribute that defines a version must endorsed the version expected, whereas the other foreign attributes can't.
Versions should be specified within elements that don't use other foreign attributes of the same module. The only tolerate foreign attributes are @exp:disable-prefixes and @exp:enable-prefixes.
For exemple, foo:version="2.1" shouldn't be used in the same element that also contains foo:bar="oof-rab", because the @foo:bar attribute won't be bind to the appropriate implementation, but to a previous version of the implementation. However, in <foo:foo foo:version="2.1">, the <foo:foo> element will be unmarshalled with the implementation expected (version 2.1).
A module is loaded on behalf of a processor instance. A processor instance is created for each active sheet used. Each processor instance uses its own module resolution strategy according to its own settings.
A module is identified with a namespace URI. When a module request is raised, its namespace URI must be specified.
A processor instance will lookup for a module in its internal registry and with the help of its catalog lists. When a catalog lookup is performed, the lookup key is composed of the namespace URI of the module ; the type of the lookup key is exp:module. Please refer to the for further information about XML catalogs. specification
A module may be requested when unmarshalling or at runtime. Once a module is loaded, it can't be discarded from the processor instance that loads it.
A module request is raised when :
A request depends also on the processor instance settings, as explained below.
The resolution strategy of a module request depends on the processor instance settings (the directive that enables/disables the prefixes).
EXP | : | Extensible XML Processor |
EXP namespace URI | : | http://ns.inria.org/active-tags/exp |
Usual prefix | : | exp |
Must be an adt:expression that computes an object of the type expected. | |
Must be a hard-coded value (litteral) | |
Can be either a hard-coded value or an adt:expression | |
This material may be missing | |
Denotes a value to use by default | |
Allows a read operation. | |
Allows a write operation. | |
Allows a rename operation. | |
Allows an update operation. | |
Allows a delete operation. |
Unmarshals an active sheet (in various types) to a processor instance (#exp:x-processor-instance).
processor inheritance
Only a few features are inherited from a processor that creates a child processor. Most of the behaviours are ruled by the default behaviour if not specified. Those inherited by the parent processor are only the followings :
- the logger
- the shared properties of the data set [FIXME: and global ?]
- the module bindings
- [FIXME: what else ?]
runtime phase
Parameter name Role Type use-catalog A catalog reference. This parameter can be used several times for several catalog references. #xs:anyURI After unmarshalling an active sheet, the <exp:unmarshal> element creates a #exp:x-processor-instance with the settings defined. It is put in the data set used by the host process if the @name attribute is specified.
The processor instance running may be also referred with the $exp:this predefined property in its host process.
[TODO: content definition]
Attributes runtime | hard-coded | both Name Type Value optional | default value name #xs:QName The qualified name of the processor instance to create. source #xs:string The file name of the active sheet. #xs:anyURI The URI where is located the active sheet. #io:x-file The active sheet as a file. #io:input The active sheet as an input stream. #xml:document The active sheet as an XML document ready to unmarshal. enable-prefixes #adt:NCNames The list of prefixes enabled in the active sheet to unmarshal. disable-prefixes #adt:NCNames The list of prefixes disabled in the active sheet to unmarshal. validate Indicates wether or not the active sheet must be validated. #xs:string yes Validate the active sheet when unmarshalling. progress Perform the validation while progressing the unmarshalling. no Doesn't perform the validation. This should be used only if the active sheet has been previously been validated and is reputed valid. fail-fast The behaviour of the processor instance when a non recoverable error occurs. #xs:string stop The processor must stop. progress The host processor goes on while the processor that causes the fault tries to lookup for other errors. complete The host processor wait until the processor that causes the fault tries to lookup for other errors.
The <exp:invoke> element invokes the processor instance referred by the @processor attribute, or by the current object that must be a processor instance if this attribute is missing.
runtime phase
Before invoking, a parameter context is opened to initialize the data set that will be used by the processor instance.
After invoking, the <exp:exports> element may be used to keep properties defined by the processor instance invoked.
[TODO: content definition]
Attributes runtime | hard-coded | both Name Type Value optional | default value processor #exp:x-processor-instance A reference of the processor instance to invoke. #io:x-file A file to unmarshal and invoke. #io:input An input stream to unmarshal and invoke. logic-procedure The name of the logic procedure to invoke. When missing, the startup behaviour is assumed. #xs:QName The qualified name of the logic procedure to invoke. #xs:string #default invoke the default logic procedure. #main invoke the main logic procedure. sync Specify if the invoker instance must wait the end of the hosted instance or not. #xs:string yes The host process that invokes the processor instance wait it ends before continue. no The host process that invokes the processor instance goes on immediately.
Used as the optional last child of some elements :
- the <exp:invoke> element.
- the <exp:function> element when it is used to define a macro.
- the <exp:property> element when it is used to define a macro.
- the element defined as a macro with the <exp:element> element.
<exp:exports> is a place holder for <exp:export> elements.
runtime phase
Runs the subactions. The runtime phase of this tag is launched after running its host action.
[TODO: content definition]
Attributes runtime | hard-coded | both Name Type Value optional | default value current #any object The current object to export to the invoker data set. context Export a context to the invoker data set. #adt:list of #any object Append all items to the context of the invoker data set. #any object Append a single object to the invoker data set. missing attribute The context is kept unchanged, that is to say it the same as before running the host action.
Used as a descendant of the <exp:exports> element ; the <exp:export> element act on behalf of the host action of the <exp:exports> element it descends.
Exports a property to the data set handled by the host action, if any. The host action is the action that launched the processor in use. The data set updated is those used by the host action when the processor in use was launched.
[TODO: content definition]
Attributes runtime | hard-coded | both Name Type Value optional | default value name #xs:QName The name of a property to export in the host action. scope The scope of the property to create in the host action. #xs:string global The created property is global. local The created property is local. shared The created property is shared. value #any The value of the property to export ; property references are picked from the current data set.
Defines a #exp:x-module.
unmarshal phase
Unmarshalling a module may be deferred. In this case, the module is unmarshalled only when a module request is launched.
runtime phase
- A context is opened, and the subactions are performed.
- The module is created with the material definitions found in the content of the context.
Items of the context that are not material definitions are ignored. Material definitions are created with :- The current object is set to the #exp:x-module created.
- The #exp:x-module created is used to feed the context.
[TODO: content definition]
Attributes runtime | hard-coded | both Name Type Value optional | default value source #xs:anyURI The URI of the module when the definitions are externalized to a file. In this file, the root element is <exp:module>.
target #adt:prefix The prefix bound to the namespace URI of the module with a namespace declaration. The prefix is just used to retrieve the namespace URI.
version #xs:string The version of the module. Versions are ordered in string order.
deferred Indicates if the definitions must be unmarshalled immediately or later. #xs:string yes The definitions are unmarshalled and processed only when expected. The materials of the module that are never used at runtime are neither unmarshalled. After unmarshalling a deferred module used, it is processed with an empty data set. no The definitions are unmarshalled immediately.
Sets the level of the messages to log. [TODO: attributes definition] [TODO: content definition]
Indicates the log output stream. [TODO: attributes definition] [TODO: content definition]
Defines an active tag (an element) on behalf of a module. Must be a descendant of <exp:module>.
runtime phase
- Creates an #exp:element-definition.
- The element definition created is used to feed the context.
invokation phase
If the implementation is given by inline tags, it will be invoked when this element is running in a processor instance that uses it.
[TODO: content definition]
Attributes runtime | hard-coded | both Name Type Value optional | default value name #xs:QName The name of the element, that must be bound to the same namespace URI of the module it belongs. When omitted, this definition is used as the fallback definition for the module. source The implementation of this active tag. missing attribute The implementation is defined by subtags. #xs:anyURI Refers to the implementation on a form that depends on the platform/language used.
Defines a foreign attribute on behalf of a module. Must be a descendant of <exp:module>.
runtime phase
- Creates an #exp:attribute-definition.
- The attribute definition created is used to feed the context.
[TODO: content definition]
Attributes runtime | hard-coded | both Name Type Value optional | default value name #xs:QName The name of the foreign attribute, that must be bound to the same namespace URI of the module it belongs. When omitted, this definition is used as the fallback definition for the module. source The implementation of this foreign attribute. missing attribute When no implementation is supplied, the foreign attribute is just a marker. #xs:anyURI Refers to the implementation on a form that depends on the platform/language used.
Defines a predefined property on behalf of a module. Must be a descendant of <exp:module>.
runtime phase
- Creates a #exp:property-definition.
- The property definition created is used to feed the context.
invokation phase
If the implementation is given by inline tags, it will be invoked when this element is running in a processor instance that uses it.
[TODO: content definition]
Attributes runtime | hard-coded | both Name Type Value optional | default value name #xs:QName The name of the property, that must be bound to the same namespace URI of the module it belongs. When omitted, this definition is used as the fallback definition for the module. source The implementation of this predefined property. missing attribute The implementation is defined by subtags. #xs:anyURI Refers to the implementation on a form that depends on the platform/language used.
Defines an extended function on behalf of a module. Must be a descendant of <exp:module>.
runtime phase
- Creates a #exp:function-definition.
- The function definition created is used to feed the context.
invokation phase
If the implementation is given by inline tags, it will be invoked when this function is running in a processor instance that uses it.
[TODO: content definition]
Attributes runtime | hard-coded | both Name Type Value optional | default value name #xs:QName The name of the element, that must be bound to the same namespace URI of the module it belongs. When omitted, this definition is used as the fallback definition for the module. source The implementation of this function. missing attribute The implementation is defined by subtags. #xs:anyURI Refers to the implementation on a form that depends on the platform/language used.
Sets the boundaries of an initialization phase of a macro definition.
The nested actions of the macro definition will be run before the nested actions of the caller tag of the macro. Then, the nested actions of the macro definition will be run.
Sets the boundaries of unmarshalling. Any nested nodes won't be unmarshalled. That is to say that they will be ignored.
- Priority : 0
The version of the EXP module to use. This attribute should be encountered before any EXP element, but it takes precedence on the element inside which it is hosted.
- Priority : -1
The list of prefixes to enable in the current active sheet. When used, the @exp:disable-prefixes attribute must be omitted.
- Priority : -1
The list of prefixes to disable in the current active sheet. When used, the @exp:enable-prefixes attribute must be omitted.
- Priority : -1
A reference to a catalog to apply on the actual active sheet. When used, the catalog is effective before unmarshalling all the materials not yet encountered (including the host element and its foreign attributes that have a lower priority).
Property type: #exp:x-processor-instance $exp:this is a reference to the processor instance. Notice that $this is a reference to the corresponding active sheet.
Property type: #exp:x-dataset $exp:dataset is a reference to the exp:x-dataset currently in use.
Property type: #xml:element $exp:element is set to the element that invokes an active tag defined by an inline implementation (macro tag).
When the macro uses itself elements that are defined by an inline implementation, the $exp:element property is restored to the value before invokation.
Property type: #adt:map of #xs:anyURI $exp:ns-fallback is a collection used to store additional namespace declarations needed at runtime.
Namespaces must be declared for XML elements, attributes, and extended XPath functions. However, qualified names may also be used in content and attribute values; in this cases, if a namespace declaration is missing in the XML active sheet document, the property $exp:ns-fallback may be used to store dynamically additional namespace declarations.
By default, $exp:ns-fallback is not defined. It is the user responsibility to add namespaces declarations at runtime.
$exp:ns-fallback is a collection of named items; each item is defined by :
- a prefix used as the key of the item
- the namespace URI as the value of the item
Example using $exp:ns-fallback <?xml version="1.0" encoding="iso-8859-1"?>
<xcl:active-sheet xmlns:exp="http://ns.inria.org/active-tags/exp" xmlns:xcl="http://ns.inria.org/active-tags/xcl"> <xcl:logic> <xcl:set name="exp:ns-fallback"> <xcl:item name="foo" value="http://www.foo.com/"/> <xcl:item name="oof" value="http://www.oof.com/"/> </xcl:set> <xcl:set name="foo:bar" value="This is valid"/> <xcl:set name="oof:rab" value="{$foo:bar}"/> </xcl:logic> </xcl:active-sheet>The two properties $foo:bar and $oof:rab will be bound to the right namespace URI defined by $exp:ns-fallback because the xmlns declaration is missing for the two prefixes foo and oof.
A processor must try to bind the names used to the namespace URI declared when unmarshalling. Unresolved prefixes must be fix at runtime with the help of $exp:ns-fallback if it exists. It is a fatal error if a prefix can't be resolved at runtime.
It is the user responsability to define $exp:ns-fallback with the appropriate scope.
This property doesn't fix namespaces violations when parsing the active-sheet.
Property type: #adt:map of #any $exp:params is a collection of named items. When an element has been defined with an inline implementation, each of its attribute will be used to feed $exp:params with an item :
- the name of the attribute is the name of the item,
- the result of the evaluation of the attribute value is the value of the item.
An item of the name xml:base is set to the current base location.
Outside an element that has been defined with an inline implementation, $exp:params doesn't exists.
Property type: #adt:list of #any $exp:args is a collection of unnamed items. When an extended XPath function has been defined with an inline implementation, each of its arguments will be used to feed $exp:args with an item.
Outside an extended XPath function that has been defined with an inline implementation, $exp:args doesn't exists.
No additional functions are defined by this module.
- Built with <exp:unmarshal>
- Built with $exp:this
The processor instance is the concrete engine obtained after unmarshalling an active sheet.
Operation read | write | rename | update | delete Type Value Comment #xs:QName The new name of the processor instance. type() #xs:QName #exp:x-processor-instance This type name() #xs:QName The name of the processor instance if any. string() #xs:string The string name of the processor instance if any. parent:: #exp:x-processor-instance The processor instance that hosts this one, if any. child:: #adt:list of #exp:x-dataset The data sets known by this instance. attribute:: #adt:map of #xml:attribute A fixed set of attributes (see below). @active-sheet #xml:document The XML document used for unmarshalling. @catalogs #adt:list of #xs:anyURI The references of the catalogs registered to this processor instance. @default-action #exp:element-definition The default action to perform. @main-action #exp:element-definition The main action to perform. @disabled-prefixes #adt:list of #adt:prefix The prefixes that has been explicitely disabled. @enabled-prefixes #adt:list of #adt:prefix The prefixes that has been explicitely enabled. @modules #adt:map{ of #xs:anyURI, of #xs:string} The modules known by this processor instance. The key of an entry in the map is the namespace URI of a module. The value is the version of the module. @procedures #adt:map of #exp:element-definition The procedures defined for this processor instance. The key of the map is the qualified name of the procedures.
@shared-properties #adt:map of #any object The properties of the processor instance that will be shared by all data set that will run on it. @status The status of the processor instance. #xs:string runnable ready to process data sets. ready ready to unmarshal. unmarshalling is currently unmarshalling its active sheet. fail fail to unmarshal.
- Given by #exp:x-processor-instance::child:*
The data set is used to store the properties computed at runtime.
Operation read | write | rename | update | delete Type Value Comment #xs:QName The new name of the dataset. type() #xs:QName #exp:x-dataset This type name() #xs:QName The name of the dataset if any. string() #xs:string The string name of the dataset if any. parent:: #exp:x-processor-instance The processor instance that uses this dataset. child:: #adt:map of #any object The properties of the dataset. attribute:: #adt:map of #xml:attribute A fixed set of attributes (see below). @current #any object The current object. @context #adt:list of #any object The context. @local-properties #adt:map of #any object The local properties of the dataset. @global-properties #adt:map of #any object The global properties of the dataset. @shared-properties #adt:map of #any object The shared properties of the dataset. @main-action #exp:element-definition The main action that uses this dataset, if any.
- Built with <exp:module>
A module contains the definitions of the active tags materials.
Operation read | write | rename | update | delete Type Value Comment type() #xs:QName #exp:x-module This type string() #xs:string The namespace URI of the module. attribute:: #adt:map of #xml:attribute A fixed set of attributes (see below). @target #xs:anyURI The namespace URI of the module. @version #xs:string The version of this module. @versions #adt:list of #exp:x-module All the versions of the module, sorted by version. @elements #adt:list of #xs:QName The elements defined by this module. @attributes #adt:list of #xs:QName The foreign attributes defined by this module. @properties #adt:list of #xs:QName The predefined properties defined by this module. @functions #adt:list of #xs:QName The extended functions defined by this module.
- Built with <exp:element>
A formal type for the implementation of an active tag.
- Built with <exp:attribute>
A formal type for the implementation of a foreign attribute.
- Built with <exp:property>
A formal type for the implementation of a predefined property.
- Built with <exp:function>
A formal type for the implementation of a function.
This list is not exhaustive; it is a list of common modules usable by an engine that implements the
specifications that implementors may use. Additional modules are welcome.<asl:active-schema asl:version="1.0" target="exp" schema-version="1.0" xml:lang="en" xmlns:exp="http://ns.inria.org/active-tags/exp" xmlns:xcl="http://ns.inria.org/active-tags/xcl" xmlns:asl="http://ns.inria.org/active-schema" xmlns:adt="http://ns.inria.org/active-datatypes" xmlns:xs="http://www.w3.org/2001/XMLSchema-datatypes" xmlns="http://www.w3.org/1999/xhtml" xmlns:at="http://ns.inria.org/active-tags/reference"> <!--adt:version="1.0" xs:version="1.0"--> <asl:attribute name="exp:version" min-occurs="0" ref-type="xs:string"/> <asl:attribute name="exp:enable-prefixes" min-occurs="0" ref-type="adt:prefixes"> <asl:assert test="asl:element()/.. = asl:document()" id="exp:mustBeOnTheRootElement-assert"> <asl:desc id="exp:mustBeOnTheRootElement-desc"> This attribute must be set only on root elements. </asl:desc> </asl:assert> </asl:attribute> <asl:attribute name="exp:disable-prefixes" min-occurs="0" ref-type="adt:prefixes"> <asl:use scope="global" ref-id="exp:mustBeOnTheRootElement-assert"/> </asl:attribute> <asl:type name="exp:dynURI"> <asl:desc id="exp:dynURI-desc">A dynamic URI is either hard-coded or computed at runtime.</asl:desc> <asl:type ref-type="xs:anyURI"/> <asl:type ref-type="adt:expression"/> </asl:type> <asl:element name="exp:bootstrap" root="always"> <asl:block id="exp:rootAttributes-block"> <asl:attribute ref-ns="#other" min-occurs="0" max-occurs="unbounded"/> <asl:attribute ref-attr="exp:version"
min-occurs="{ number( asl:element()/.. = asl:document() ) }"
max-occurs="{ $asl:min-occurs }"/> </asl:block> <asl:choice min-occurs="0" max-occurs="unbounded"> <asl:element ref-ns="#any"/> </asl:choice> </asl:element> <asl:element name="exp:module" root="sometimes"> <asl:use ref-id="exp:rootAttributes-block"/> <asl:attribute name="target" ref-type="adt:prefix"/> <asl:attribute name="version" ref-type="xs:string"/> <asl:attribute name="deferred" min-occurs="0"> <asl:text value="yes"/> <asl:text value="no"/> </asl:attribute> <asl:attribute name="source" ref-type="exp:dynURI"
min-occurs="{number( not( asl:element()/* ) )}"
max-occurs="{ $asl:min-occurs }"/> <asl:choice min-occurs="{number( not( asl:element()/@source ) )}" max-occurs="unbounded"> <asl:element ref-elem="exp:element" min-occurs="0"/> <asl:element ref-elem="exp:extended-function" min-occurs="0"/> <asl:element ref-elem="exp:predefined-property" min-occurs="0"/> <asl:element ref-elem="exp:foreign-attribute" min-occurs="0"/> <asl:element ref-ns="#other" min-occurs="0"/> </asl:choice> </asl:element> <asl:element name="exp:element"> <asl:block id="exp:material-block"> <asl:attribute ref-ns="#other" min-occurs="0" max-occurs="unbounded"/> <asl:attribute name="name" ref-type="xs:QName" min-occurs="0"/> <asl:attribute name="impl" ref-type="xs:string" min-occurs="{count( not( asl:element()/* ) )}"
max-occurs="{$asl:min-occurs}"/> <asl:step min-occurs="{ number( not( asl:element()/@impl ) ) }"
max-occurs="{$asl:min-occurs}"> <asl:choice min-occurs="1" max-occurs="unbounded"> <asl:element ref-ns="#other"/> </asl:choice> </asl:step> <asl:assert test="asl:element()/ancestor::exp:module"
id="exp:mustBeADescendentOfModule-assert"> <asl:desc id="exp:mustBeADescendentOfModule-desc"> <at:element>{name( asl:element() )}</at:element> must be a descendent of <at:element>exp:module</at:element> </asl:desc> </asl:assert> </asl:block> </asl:element> <asl:element name="exp:predefined-property"> <asl:use ref-id="exp:material-block"/> </asl:element> <asl:element name="exp:extended-function"> <asl:use ref-id="exp:material-block"/> </asl:element> <asl:element name="exp:foreign-attribute"> <asl:use scope="global" ref-id="exp:mustBeADescendentOfModule-assert"/> <asl:attribute ref-ns="#other" min-occurs="0" max-occurs="unbounded"/> <asl:attribute name="name" ref-type="xs:QName" min-occurs="0"/> <asl:attribute name="impl" ref-type="xs:string" min-occurs="0"/> </asl:element> <asl:element name="exp:processor"> <asl:attribute name="name" ref-type="asl:dynQName" min-occurs="0"/> <asl:attribute name="source" ref-type="adt:expression"/> <asl:attribute name="module-bindings" ref-type="adt:expression" min-occurs="0"
max-occurs="{count( not( asl:element()//exp:module-bindings ) )}"/>/> <asl:attribute name="enable-prefixes" min-occurs="0" ref-type="adt:prefixes"/> <asl:attribute name="disable-prefixes" min-occurs="0" ref-type="adt:prefixes"/> <asl:attribute name="validate" min-occurs="0"> <asl:text value="yes"/> <asl:text value="progress"/> <asl:text value="no"/> </asl:attribute> <asl:attribute name="fail-fast" min-occurs="0"> <asl:text value="stop"/> <asl:text value="progress"/> <asl:text value="complete"/> </asl:attribute> <asl:choice min-occurs="0" max-occurs="unbounded"> <asl:element ref-elem="module-bindings" min-occurs="0"
max-occurs="{count( not( asl:element()/@impl ) )}"/> <asl:element ref-ns="#other"/> </asl:choice> </asl:element> <asl:element name="exp:invoke"> <asl:attribute name="processor" ref-type="adt:expression" min-occurs="0"/> <asl:attribute name="logic-procedure" min-occurs="0"> <asl:type> <asl:choice> <asl:text value="#default"/> <asl:text value="#main"/> <asl:text ref-type="asl:dynQName"/> </asl:choice> </asl:type> </asl:attribute> <asl:attribute name="sync" min-occurs="0"> <asl:text value="yes"/> <asl:text value="no"/> </asl:attribute> <asl:choice min-occurs="0" max-occurs="unbounded"> <asl:element ref-ns="#other"/> </asl:choice> <asl:sequence> <asl:element ref-elem="exp:exports" min-occurs="0"/> </asl:sequence> </asl:element> <asl:element name="exp:exports"> <asl:attribute ref-ns="#other" min-occurs="0" max-occurs="unbounded"/> <asl:choice min-occurs="0" max-occurs="unbounded"> <asl:element ref-ns="#any"/> </asl:choice> </asl:element> <asl:element name="exp:export"> <asl:attribute ref-ns="#other" min-occurs="0" max-occurs="unbounded"/> <asl:attribute name="name" ref-type="asl:dynQName"/> <asl:attribute name="scope" min-occurs="0"> <asl:text value="local"/> <asl:text value="global"/> <asl:text value="shared"/> </asl:attribute> <asl:attribute name="value" ref-type="adt:expression"/> </asl:element> <asl:element name="exp:instance"> <asl:attribute name="impl" ref-type="xs:string"/> </asl:element> <asl:element name="exp:inactive-tags"> <asl:attribute ref-ns="#other" min-occurs="0" max-occurs="unbounded"/> <asl:choice min-occurs="0" max-occurs="unbounded"> <asl:element ref-ns="#any"/> </asl:choice> </asl:element> <asl:element name="exp:module-bindings" root="sometimes"> <!--TODO--> </asl:element> <asl:element name="exp:log"> <!--TODO--> </asl:element> <asl:element name="exp:log-stream"> <!--TODO--> </asl:element> </asl:active-schema>