INRIA
[Up]
Warning

Work in progress

This version may be updated without notice.

Active Catalog

The Active Catalog Specification

Working Draft 26 july 2006

Editor
Philippe Poulard  <Philippe.Poulard@sophia.inria.fr>

Copyright © INRIA

Abstract

Active Catalogs are powerful XML catalogs used to map URIs to usable URLs, and used to retrieve resources and additional structured meta-datas. Combined with a selector mechanism, an Active Catalog may supply various resource types for a single identifier ; it also offers caching facilities and means to rebuild the discarded objects expected.

Active Catalogs can be advantageously used as abstract registries when they are backed by storage systems like XML native databases. But Active Catalogs are not storage systems, they just offer resource management facilities.

Active Catalogs can be considered as an extension of the well known XML Oasis Catalogs.

Requirement levels

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.

Active Tags specifications

Related specifications

Table of contents

1 What are XML Catalogs ?

1.1 What is Active Catalog ?
2 Basics
2.1 Structure
2.2 Lookup strategy
2.3 Selectors, builders and resources
2.4 Caching policy
2.5 Invokation from Active Sheets
3 Built-in strategies
4 Compatibility
4.1 Legacy invokation
4.2 Active Catalog features
5 Using Active Catalogs
5.1 Active Catalog best practice
6 Active Catalog module reference
6.1 Elements
6.2 Foreign attributes
6.3 Predefined properties
6.4 Extended XPath functions
6.5 Data types

Appendix

A Glossary
B Related Active Tags specifications
C Common Active Tags modules
D Lists

D.1 Examples list
D.2 Figures list
E Active Catalog for Active Tags
F Active Schemata
F.1 Active Schema for XML Oasis Catalogs
F.2 Active Schema for Active Catalogs


1 What are XML Catalogs ?

External identifiers in XML documents refer to resources that have to be accessed for many different purposes. These resources are not necessary available because they are located on a remote machine not reachable with a network connection, because they are identified with a logical name instead of a physical path, etc.

XML Catalogs intend to resolve these identifiers (as well as regular URIs) to accessible URIs.

1.1 What is Active Catalog ?

An XML catalog usually provides a mapping from URI or external identifiers to accessible URIs, without taking care of the use case of the resource, that depends on the client application. Active Catalog is a kind of XML Catalog that :

Client applications are enhanced by Active Catalogs on which they may rely because they can supply directly the object instances expected. Developpers that design applications with Active Catalog can focus on their problematic without taking care on resource delivery and caching because Active Catalog does.

As shown in this example, Active Catalogs are intensively used in Active Tags technologies to resolve and store resources such as :

URI resolution

An application uses the following URI : urn:acme:my-resource ; according to the process expected by the client application, a simple Active Catalog may map several different resources to this URI :

  • a module located at file:///path/to/acme.exp
  • several schemata located at file:///path/to/acme.asl and file:///path/to/messages.asl
  • a stylesheet located at file:///path/to/acme.xslt
  • a link that point to http://www.acme.fr/my-document
  • some XML metadata delivered directly by the catalog

2 Basics

2.1 Structure

An Active Catalog is a shareable component hold by an Active Tags processor ; each time that a child processor instance is built upon a parent processor instance, it uses a local Active Catalog backed by the local Active Catalog of its parent, but in fact, an Active Catalog is processed in a global view (a global catalog). Thus, several Active Catalogs are arranged in the same way that processor instances can be arranged, that is to say a tree structure where in a branch given, processor instances and Active Catalogs have only the knowledge of their parents.

Additionally, a local Active Catalog is composed of :

A global catalog

A catalog lookup must always be performed on behalf of a processor instance to which it has been previously added, or on behalf of a similar component that can hold a registry bounded to each local Active Catalog. When a processor instance processes catalog lookups, it always places its own local catalog list after its parent catalog list (top-down lookup).

A local catalog list may be set to a processor instance while defining it with EXP (<exp:catalog>). Implementation dependant mechanisms (options on a command line interface, parameters on a Web application, etc) may be also considered to achieve this.

2.2 Lookup strategy

Each entry in a catalog storage unit may define the kind of object expected by a client application thanks to a selector. When a client application looks up for a resource, the lookup key must be composed of :

According to the kind of resource expected, different strategy lookup may be considered :

Any mix of the above type of strategy may be relevant according to the client application. Moreover, some special strategy could be considered, if necessary.

Bottom-up lookups are used for components that can be overriden, whereas top-down lookups are used for components that can't be overriden (except thanks to an additional discriminating information, such as the version for the modules).

Registry lookups before are for cacheable components, whereas catalog lookups before are for non-cacheable ones.

Catalog lookups before are suitable when a result can differ between 2 requests. In this case, the registry is used only to check if a builder had been already registered for the same resolved identifier ; in this case, the builder stored in the registry will be used, otherwise a new builder will be used, and according to the caching strategy, stored in the registry. Registry lookups before are suitable when a previous catalog lookup are more reliable.

Lookup result

When a catalog storage unit is processed, it returns an ordered set of entries and an ordered set of next catalogs to process. One or both of these sets may be empty. A catalog storage unit must be processed entirely ; each entry that matches the given lookup key is retained ; a client application that deals with a single result should retain the first of the set, but a specific discriminating algorithm may also be used (such as checking version for the modules). If the catalog fails to resolve and the next catalog list is not empty, it must be used instead of the current processing list. Even if some entries that matches the lookup key were found, the client application may request for further lookup with the next catalogs to process.

When a catalog storage unit resolves an entry, it may build a resource and store it in the registry. If a resource have to be kept, it must be stored in the registry given by the processor instance that owns the catalog that resolves the identifier.

Lookup sequence example

A lookup that uses the registry before with a bottom-up lookup method will perform the following sequence :

  1. ask the registry if the given lookup key exists
    1. if it exists, return the builder and exit
    2. if it doesn't exist, process the step 1 with the parent registry if any
  2. consider the first catalog of the global catalog list in top-down order
  3. ask the catalog if the key given exists
    1. if it doesn't exist :
      • if a new catalog list is provided, discard the existing catalog list and process the step 2 with the new catalog list
      • else process the step 3 with the next catalog in the list
    2. if it exists, store the builder in the registry of the processor instance that delivers the catalog that found the key ; return the builder and exit

2.3 Selectors, builders and resources

The capability to map a single entry to several potential resolved URIs is accomplished thanks to an additional sub-key, that act like a selector. The value of the selector is simply a xs:QName.

A selector

In this example, a client wants to resolve an URI.

    <cat:resource name="http://www.inria.fr/xml/active-tags/xcl" selector="exp:module"
uri="file:///path/to/xcl/module.exp"/> <cat:resource name="http://www.inria.fr/xml/active-tags/xcl" selector="asl:schema"
uri="file:///path/to/xcl/schema.asl"/>

...is the same as :

    <cat:resource name="http://www.inria.fr/xml/active-tags/xcl">
        <cat:entry selector="exp:module" uri="file:///path/to/xcl/module.exp"/>
        <cat:entry selector="asl:schema" uri="file:///path/to/xcl/schema.asl"/>
    </cat:resource>

If the resource http://www.inria.fr/xml/active-tags/xcl is requested with the selector exp:module, the resolved URI will be file:///path/to/xcl/module.exp.

If the resource http://www.inria.fr/xml/active-tags/xcl is requested with the key asl:schema, the resolved URI will be file:///path/to/xcl/schema.asl.

The <cat:resource> element can handle both URIs and objects. If an URI is specified with the @uri on this element or the entry, then the URI is resolved regarding the @xml:base attribute or regarding the localization of its owner catalog ; otherwise, the @alternate attribute can be used to supply any other object.

The resource builder

An URI or external identifier is resolved with its selector. This selector is then used as an indication of what to do with the URI or external identifier given by the catalog. The selector is a xs:QName that identifies which post-process must be applied to the resolved URI or external identifier ; for example :

SelectorPost-process
exp:moduleunmarshalling a module
asl:schemaunmarshalling a schema
xsl:stylesheetparsing a stylesheet
my:selectoruser-defined post-process

More generally, a post-process is applied to the resolved URI to supply to the client the object expected.

Typical post-processes (as those indicated above) should be built-in processes, but user-defined post-processes can also be designed. In any case, these post-processes are themselves considered as resources stored in the registry.

The <cat:resource> element may be used to customize a user-defined post-process.

A resolution scenario

In this example, assumes that the client is an XML validator that encounters the <xcl:if> element in the XML document source to validate. The validator asks the catalog for a schema that contains the definition of this element. The catalog lookup is performed with :

  • URI : http://www.inria.fr/xml/active-tags/xcl, which is the namespace of the <xcl:if> element,
  • selector : asl:schema, which denotes that a schema is expected.
    <cat:resource name="http://www.inria.fr/xml/active-tags/xcl">
        <cat:entry selector="exp:module" uri="file:///path/to/xcl/module.exp"/>
        <cat:entry selector="asl:schema" uri="file:///path/to/xcl/schema.asl"/>
    </cat:resource>

With the catalog above, the resolved URI is file:///path/to/xcl/module.exp.

Now, assumes that there is a builder bound to the key asl:schema ; it will be invoked to unmarshal the resolved URI to a schema usable by the validator.

The <cat:resource> element is almost like the <cat:uri> element :

A builder is just a resource that has the key cat:builder ; all resources are not necessary builders, which makes Active Catalogs usefull for retrieving resources which are not identified by an URI or an external identifier.

A builder

When an URI has been resolved with a selector -for example asl:schema- the catalog is requested once again for a resource that has the name asl:schema and the selector cat:builder.

    <cat:uri name="http://www.inria.fr/xml/active-tags/xcl">
        <cat:entry selector="exp:module" value="file:///path/to/xcl/module.exp"/>
        <cat:entry selector="asl:schema" value="file:///path/to/xcl/schema.asl"/>
    </cat:uri>
    <cat:resource name="asl:schema">
        <cat:entry selector="cat:builder">
            <asl:parse-schema source="{ $cat:result }"/>
        </cat:entry>
    </cat:resource>

Once the resolved URI file:///path/to/xcl/schema.asl has been found, the catalog act as a client of itself, and lookup for the resource builder that has the name asl:schema, which parses the schema expected. When the builder is invoked, $cat:result contains the resolved URI.

2.4 Caching policy

Some resources expected by applications require most efforts in term of CPU consumption to get them usable ; for example, an XML schema must be unmarshalled to an invokable object ; EXP modules must also be unmarshalled. To avoid such cost operations be repeated each time an object is expected, it is possible to bind a caching policy to each entry of the catalog.

Objects that are processed as-is by applications are not intended to be cached.

The @keep and @expire attributes of the <cat:entry> element defines the caching policy to apply :

2.5 Invokation from Active Sheets

XML or non XML tools, that need to resolve URIs, may invoke an Active Catalog with a specific selector. In Active Tags, actions that use URIs are encouraged to support an attribute that indicates the value of the selector when catalogs are processed. If this directive is missing, catalogs will be ignored ; if set to "", no selector will be set ; otherwise, catalogs will be processed with the value given. Remember that if a selector is supplied, the bounded builder will also be used, if any.

The xsl:stylesheet selector is reserved for XSLT processor, but they are not obliged to use it. The bounded builder must be a stylesheet parser. If not used, the resolved URI will be supplied to the XSLT processor as is.

XSLT resolution

The <xcl:transform> element support 2 attributes related to catalogs :

  • @stylesheet-selector : used for parsing the stylesheet if the @stylesheet attribute doesn't refer to a pre-compiled stylesheet ; usually, its value is set to "xsl:stylesheet" ; a post-process should deliver a parsed stylesheet.
  • @document-selector : used when the XSLT processor encounters <xsl:import>, <xsl:include>, or document()() ; a post-process should deliver a resolved URI or an XML document.
    <xcl:transform output-file="{ $output }" source="{ $input }"
stylesheet="urn:myXSLT:this-one.xsl" stylesheet-selector="xsl:stylesheet" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"/>

The XSLT processor is told to use the catalogs with the given selector.

    <cat:uri key="xsl:stylesheet" name="urn:myXSLT:this-one.xsl"
value="file:///path/to/myXSLT/this-one.xsl" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"/> <cat:resource name="xsl:stylesheet"> <cat:entry keep="always" selector="cat:builder"> <xcl:parse-stylesheet source="{ $cat:result }"/> </cat:entry> </cat:resource>

Once the URI file:///path/to/myXSLT/this-one.xsl has been resolved regarding the URN and the selector, the catalog act as a client of itself, and lookup for the resource that has the name xsl:stylesheet and the selector cat:builder, which parses the stylesheet expected.

The parsed stylesheet is cached and will be served again if a next XSLT transformation uses the same stylesheet.

On the other hand, the following XSLT transformation won't use any catalog, and the same stylesheet will be parsed each time it is referred ; this is the case below :

    <xcl:transform output-file="{ $output }" source="{ $input }"
stylesheet="file:///path/to/myXSLT/this-one.xsl"/>

3 Built-in strategies

A resource is resolved on behalf of a global catalog ; the local catalog that is considered as the entry of the global catalog is at the deepest level of the hierarchy. It is called the local catalog entry, but it is not necessary the first considered.

A resource to cache is stored in the registry bind to the catalog that defined a mapping for it if any, or in the local catalog entry.

ComponentSelectorLookupCachingBuilderFailure
Catalog cat:catalog Top-down, all registries before, the first catalog list is ignored. Always and for ever. cat:catalog : build a catalog that behaves as explained in this specification. An unrecognized catalog format must cause a fatal error for the client processor instance. A catalog not found must be reported as an error.
Module exp:module Top-down, registry before, interleave. Always and for ever. exp:module : build a module. An unrecognized module format must cause a fatal error for the client processor instance. Other failure are processed as specified in the EXP specification.
Strategy cat:strategy Top-down, registry before, interleave. Keep if possible. cat:strategy : build a lookup strategy. An unrecognized format must cause a fatal error for the client processor instance.
Schema asl:schema Bottom-up, registry before, interleave. Keep if possible. asl:schema : build a schema. An unrecognized schema format must be reported as an error to the schema client handler, as specified in the ASL specification.
Stylesheet xsl:stylesheet Top-down, registry before, interleave. Keep if possible. xsl:stylesheet : build a stylesheet. Forwarded to the host processor instance.
XML document xml:external-identifier Top-down, registry before, interleave. Cache as specified. xml:document : build an XML document. Forwarded to the host processor instance.
Default none Top-down, catalogs only. Not cached. io:x-file : return the mapped URI if found, or the URI.
Warning
According to the lookup strategies, querying the same identifier with different selectors won't give the same resolved reference : those returned by, say, a module selector would point to the XML module that the processor must use, whereas as those returned by an external identifier selector could point to another XML document.

4 Compatibility

Active Catalog is fully compatible with OASIS catalog ; that is to say that :

Active Catalog also fix some optional behaviours of OASIS' Catalog to make it usable by Active Tags applications.

4.1 Legacy invokation

OASIS primarily defined 3 family of elements, that are the same in Active Catalog :

A catalog may be invoked either with an external identifier (system ID and/or public ID) or with an URI. The clients that invoke a catalog with an external identifier are (but not limited to) XML parsers, when they encounter external resources while parsing, such as DTD references and XML external entities. Other clients are invoking catalogs with URI references.

URIs and system IDs are somewhat equivalent, they differ only by the invoker. To make OASIS catalog invokation compatible with Active Catalogs', the following arrangements are applied :

XML parsing
    <xcl:parse source="{ $input }"/>

The XML parser will use the catalogs to resolve, for example, the external entity <!ENTITY SYSTEM "urn:myXML:this-one.xml">.

    <cat:uri name="urn:myXML:this-one.xml" value="file:///path/to/myXML/this-one.xml"/>
    <cat:system name="urn:myXML:this-one.xml" value="file:///path/to/myXML/this-one.xml"/>

Both declarations are doing the same, but those that matches is the second.

4.2 Active Catalog features

Dynamic support

XCL and other Active Tags modules may perform special purpose processes while retrieving a resource. For example, a special condition may guide to a resource or another thanks to an alternative statement, when the predefined matchers can't express a condition.

Dynamic support
    <xcl:if test="{ends-with(., '.exp')}">
        <xcl:then>
            <cat:rewriteURI uri="jar:file:///path/to/acme.jar!/org/acme/foo/"
uriStartString="http://www.acme.org/"/> </xcl:then> <xcl:else> <cat:rewriteURI uri="file:///path/to/foo/" uriStartString="http://www.acme.org/"/> </xcl:else> </xcl:if>

Any arbitrary complex processes may be consider.

For example, a whole directory could be used as catalog entries :

    <xcl:for-each name="catalog"
select="{io:file( '/path/to/my/catalogs' )//*[@is-file][ends-with( name(), '.xml' )]}"> <cat:nextCatalog catalog="{$catalog/@absolute-path}"/> </xcl:for-each>

URI component access

URIs and system identifiers can be parsed to an io:x-file ; as the string value is used t

Active Catalog provides the cat:uri() function that parses an URI to a typed data (its type is the cat:uri type).

URI mapping with XND

The URI "urn:isbn:0-345-33973-8" built with the cat:uri() function gives a typed data ; in the context of this object :

  • ./@nid (Namespace ID) returns "isbn"
  • ./@nss (Namespace Specific String) returns "0-345-33973-8"

This example shows how to map an ISBN URI with an XML Native Database ; the XND is conform with XML:DB XAPI specification and uses the "ref" subscheme.

    <cat:uri test="{cat:uri( . )/@nid='isbn'}" uri="xmldb:ref://books/{cat:uri( . )/@nss}"/>

5 Using Active Catalogs

An Active Catalog accepts simple queries to retrieve entries and resources.

A simple query on an Active Catalog consists of :

When supported, decoded URNs may also be used to match entries with more accuracy. [TODO]

5.1 Active Catalog best practice

To enhance the benefits of Active Catalogs, the sharability of the resources expected should be taken care the most earlier in mutli-threaded applications. That is to say that such resources should be made available from a catalog near the root catalog before processor instances splitting.

This is typically the case with Web applications that are processing several HTTP requests at the same time. If many applications are using the same set of stylesheets, they should be parsed only once. If all these applications are backed by the same processor instance that uses a catalog that refers to these stylesheets, they will be parsed only once and a single copy of them will be retained.


6 Active Catalog module reference

Active Catalog
Active Catalog namespace URI : http://www.inria.fr/xml/active-catalog
Usual prefix : cat
Elements Foreign attributes Predefined properties
<cat:catalog>
@cat:version
$cat:uri
$cat:system-id
$cat:public-id
$cat:resource
$cat:selector
$cat:prefer
$cat:alternate
$cat:base

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
[TODO]

6.1 Elements

<cat:catalog>

Root element for a catalog.

[TODO]

6.2 Foreign attributes

@cat:version

The version of the Active Catalog module to use. This attribute should be encountered before any Active Catalog element, but it takes precedence on the element inside which it is hosted.

6.3 Predefined properties

$cat:uri

  • Property type: xs:anyURI
  • $cat:uri is set when the identifier to retrieve is an URI reference.


    $cat:system-id

  • Property type: xs:anyURI
  • $cat:system-id is set when the identifier to retrieve is a system identifier.


    $cat:public-id

  • Property type: xs:anyURI
  • $cat:public-id is set when the identifier to retrieve is a public identifier.


    $cat:resource

  • Property type: xs:QName
  • $cat:resource is set when the identifier to retrieve is a resource.


    $cat:selector

  • Property type: xs:QName
  • $cat:selector is set if the catalog is invoked with a selector.


    $cat:prefer

  • Property type: xs:anyURI
  • $cat:prefer is set if the catalog is invoked with a prefer mode, or when an Active Catalog element uses the @prefer attribute.


    $cat:alternate

  • Property type: any
  • $cat:alternate is set each time an item matches. It contains the alternate resource to deliver.


    $cat:base

  • Property type: xs:anyURI
  • $cat:base is the URI that localize the current catalog. Used to resolve relative alternate URIs or relative xml:base URIs.

    Non-localizable catalogs (such as pre-compiled catalogs) must define absolute alternate URIs.

    $xml:base

    $xml:base is set when an Active Catalog element uses the @xml:base attribute.

    6.4 Extended XPath functions

    6.5 Data types

    No additional data types are defined by this module.


    Appendix

    A Glossary

    B Related Active Tags specifications

    C Common Active Tags modules

    This list is not exhaustive; it is a list of common modules usable by an engine that implements the Active Tags specifications that implementors may use. Additional modules are welcome.

    D Lists

    D.1 Examples list

    D.2 Figures list

    E Active Catalog for Active Tags

    The following instance is an example of Active Catalog used for Active Tags resources.

    It may be arranged for special purpose usage ; an Active Tags engine is not obliged to use it to deliver its own resources.

    [catalog.cat]

    <cat:catalog
        xmlns:cat="http://www.inria.fr/xml/active-catalog"
        xmlns:exp="http://www.inria.fr/xml/active-tags/exp"
        xmlns:asl="http://www.inria.fr/xml/active-schema">
        <!-- cat:factory key="cat:factory" bootstrap class org.inria.reflex.processor.catalog.FactoryFactory -->
        <!-- cat:factory key="exp:module" bootstrap class org.inria.reflex.processor.exp.ModuleFactory -->
        <cat:factory key="asl:schema">
            <asl:parse-schema source="{ $cat:entry }"/>
        </cat:factory>
        <cat:group xml:base="file:///path/to/active-tags/core/">
            <cat:uri name="http://www.inria.fr/xml/active-tags/xcl">
                <cat:entry key="exp:module" value="xcl/module.exp"/>
                <cat:entry key="asl:schema" value="xcl/schema.asl"/>
            </cat:uri>
            <cat:uri name="http://www.inria.fr/xml/active-tags/exp">
                <cat:entry key="exp:module" value="exp/module.exp"/>
                <cat:entry key="asl:schema" value="exp/schema.asl"/>
            </cat:uri>
            <cat:uri name="http://www.inria.fr/xml/active-schema">
                <cat:entry key="exp:module" value="asl/module.exp"/>
                <cat:entry key="asl:schema" value="asl/schema.asl"/>
                <cat:entry key="asl:schema" value="asl/messages.asl"/>
            </cat:uri>
            <cat:uri name="http://www.inria.fr/xml/active-datatypes">
                <cat:entry key="exp:module" value="asl/types/adt/module.exp"/>
            </cat:uri>
            <cat:uri name="http://www.w3.org/2001/XMLSchema-datatypes">
                <cat:entry key="exp:module" value="asl/types/xs/module.exp"/>
            </cat:uri>
            <cat:uri name="http://www.w3.org/XML/1998/namespace">
                <cat:entry key="exp:module" value="asl/types/xml/module.exp"/>
            </cat:uri>
            <cat:uri name="http://www.inria.fr/xml/active-catalog">
                <cat:entry key="exp:module" value="catalog/module.exp"/>
                <cat:entry key="asl:schema" value="catalog/schema.asl"/>
            </cat:uri>
            <cat:uri name="urn:oasis:names:tc:entity:xmlns:xml:catalog">
                <cat:entry key="exp:module" value="catalog/oasis-module.exp"/>
                <cat:entry key="asl:schema" value="catalog/oasis-schema.asl"/>
            </cat:uri>
        </cat:group>
        <cat:group xml:base="file:///path/to/active-tags/modules/">
            <cat:uri name="http://www.inria.fr/xml/active-tags/io">
                <cat:entry key="exp:module" value="io/module.exp"/>
                <cat:entry key="asl:schema" value="io/schema.asl"/>
            </cat:uri>
            <cat:uri name="http://www.inria.fr/xml/active-tags/serialize">
                <cat:entry key="exp:module" value="serialize/module.exp"/>
                <cat:entry key="asl:schema" value="serialize/schema.asl"/>
            </cat:uri>
            <cat:uri name="http://www.inria.fr/xml/active-tags/sys">
                <cat:entry key="exp:module" value="sys/module.exp"/>
                <cat:entry key="asl:schema" value="sys/schema.asl"/>
            </cat:uri>
            <cat:uri name="http://www.inria.fr/xml/active-tags/rdbms">
                <cat:entry key="exp:module" value="rdbms/module.exp"/>
                <cat:entry key="asl:schema" value="rdbms/schema.asl"/>
            </cat:uri>
        </cat:group>
    </cat:catalog>

    F Active Schemata

    F.1 Active Schema for XML Oasis Catalogs

    [oasis-schema.asl]

    <asl:active-schema asl:version="1.0" target="oasis" schema-version="1.0" xml:lang="en"
        xmlns:asl="http://www.inria.fr/xml/active-schema"
        xmlns:oasis="urn:oasis:names:tc:entity:xmlns:xml:catalog"
        xmlns:adt="http://www.inria.fr/xml/active-datatypes"
        xmlns:xs="http://www.w3.org/2001/XMLSchema-datatypes">
    
        <asl:element name="oasis:catalog" root="always">
            <asl:block id="oasis:optional-attributes-block">
                <asl:attribute name="id" ref-type="xs:ID"/>
                <asl:attribute name="xml:base" ref-type="xs:string"/>
                <asl:attribute ref-ns="#other"/>
            </asl:block>
            <asl:attribute name="prefer" id="oasis:prefer-attribute">
                <asl:text value="system"/>
                <asl:text value="public"/>
            </asl:attribute>
            <asl:choice max-occurs="unbounded" min-occurs="1" repeating="stable">
                <asl:element ref-elem="oasis:group"/>
                    <asl:block id="oasis:inner-elements-block">
                        <asl:element ref-elem="oasis:public"/>
                        <asl:element ref-elem="oasis:system"/>
                        <asl:element ref-elem="oasis:uri"/>
                        <asl:element ref-elem="oasis:rewriteSystem"/>
                        <asl:element ref-elem="oasis:rewriteURI"/>
                        <asl:element ref-elem="oasis:delegatePublic"/>
                        <asl:element ref-elem="oasis:delegateSystem"/>
                        <asl:element ref-elem="oasis:delegateURI"/>
                        <asl:element ref-elem="oasis:nextCatalog"/>
                       <asl:element ref-ns="#other"/>
                    </asl:block>
            </asl:choice>
        </asl:element>
    
        <asl:element name="oasis:group">
            <asl:use ref-id="oasis:optional-attributes-block"/>
            <asl:use ref-id="oasis:prefer-attribute" scope="global"/>
            <asl:choice max-occurs="unbounded" min-occurs="1" repeating="stable">
                <asl:use ref-id="oasis:inner-elements-block"/>
            </asl:choice>
        </asl:element>
    
        <asl:element name="oasis:public">
            <asl:use ref-id="oasis:optional-attributes-block"/>
            <asl:attribute name="publicId" ref-type="adt:public-id"/>
            <asl:attribute name="uri" ref-type="xs:anyURI"/>
        </asl:element>
    
        <asl:element name="oasis:system">
            <asl:use ref-id="oasis:optional-attributes-block"/>
            <asl:attribute name="systemId" ref-type="xs:anyURI"/>
            <asl:attribute name="uri" ref-type="xs:anyURI"/>
        </asl:element>
    
        <asl:element name="oasis:uri">
            <asl:use ref-id="oasis:optional-attributes-block"/>
            <asl:attribute name="name" ref-type="xs:anyURI"/>
            <asl:attribute name="uri" ref-type="xs:anyURI"/>
        </asl:element>
    
        <asl:element name="oasis:rewriteSystem">
            <asl:use ref-id="oasis:optional-attributes-block"/>
            <asl:attribute name="systemIdStartString" ref-type="xs:string"/>
            <asl:attribute name="rewritePrefix" ref-type="xs:string"/>
        </asl:element>
    
        <asl:element name="oasis:rewriteURI">
            <asl:use ref-id="oasis:optional-attributes-block"/>
            <asl:attribute name="uriStartString" ref-type="xs:string"/>
            <asl:attribute name="rewritePrefix" ref-type="xs:string"/>
        </asl:element>
    
        <asl:element name="oasis:delegatePublic">
            <asl:use ref-id="oasis:optional-attributes-block"/>
            <asl:attribute name="publicIdStartString" ref-type="xs:string"/>
            <asl:attribute name="catalog" ref-type="xs:string"/>
        </asl:element>
    
        <asl:element name="oasis:delegateSystem">
            <asl:use ref-id="oasis:optional-attributes-block"/>
            <asl:attribute name="systemIdStartString" ref-type="xs:string"/>
            <asl:attribute name="catalog" ref-type="xs:string"/>
        </asl:element>
    
        <asl:element name="oasis:delegateURI">
            <asl:use ref-id="oasis:optional-attributes-block"/>
            <asl:attribute name="uriStartString" ref-type="xs:string"/>
            <asl:attribute name="catalog" ref-type="xs:string"/>
        </asl:element>
    
        <asl:element name="oasis:nextCatalog">
            <asl:use ref-id="oasis:optional-attributes-block"/>
            <asl:attribute name="catalog" ref-type="xs:string"/>
        </asl:element>
    
    </asl:active-schema>

    F.2 Active Schema for Active Catalogs

    [schema.asl]

    <asl:active-schema asl:version="1.0" target="cat" schema-version="1.0" xml:lang="en"
        xmlns:asl="http://www.inria.fr/xml/active-schema"
        xmlns:cat="http://www.inria.fr/xml/active-catalog"
        xmlns:adt="http://www.inria.fr/xml/active-datatypes"
        xmlns:xs="http://www.w3.org/2001/XMLSchema-datatypes">
    
        <asl:element name="cat:catalog" root="always">
            <aslbloc{<¯span> id="cat:optional-attributes-block">
                <asl:attribute name="id" ref-type="xs:ID"/>
                <asl:attribute name="xml:base" ref-type="xs:string"/>
                <asl:attribute ref-ns="#other"/>
            </asl:block>
            <asl:attribute name="prefer" id="cat:prefer-attribute">
                <asl:text value="system"/>
                <asl:text value="public"/>
            </asl:attribute>
            <asl:choice max-occurs="unbounded" min-occurs="1" repeating="stable">
                <asl:element ref-elem="cat:group"/>
                    <asl:block id="cat:inner-elements-block">
                        <asl:element ref-elem="cat:public"/>
                        <asl:element ref-elem="cat:system"/>
                        <asl:element ref-elem="cat:uri"/>
                        <asl:element ref-elem="cat:resource"/>
                        <asl:element ref-elem="cat:rewriteSystem"/>
                        <asl:element ref-elem="cat:rewriteURI"/>
                        <asl:element ref-elem="cat:delegatePublic"/>
                        <asl:element ref-elem="cat:delegateSystem"/>
                        <asl:element ref-elem="cat:delegateURI"/>
                        <asl:element ref-elem="cat:nextCatalog"/>
                       <asl:element ref-ns="#other"/>
                    </asl:block>
            </asl:choice>
            <asl:sequence max-occurs="unbounded" min-occurs="0" repeating="stable">
                <asl:element ref-elem="cat:builder"/>
            </asl:sequence>
        </asl:element>
    
        <asl:element name="cat:group">
            <asl:use ref-id="cat:optional-attributes-block"/>
            <asl:use ref-id="cat:prefer-attribute" scope="global"/>
            <asl:choice max-occurs="unbounded" min-occurs="1" repeating="stable">
                <asl:use ref-id="cat:inner-elements-block"/>
            </asl:choice>
        </asl:element>
    
        <asl:element name="cat:public">
            <asl:use ref-id="cat:optional-attributes-block"/>
            <asl:attribute name="publicId" ref-type="adt:public-id"/>
            <asl:attribute name="uri" ref-type="xs:anyURI"/>
        </asl:element>
    
        <asl:element name="cat:system">
            <asl:use ref-id="cat:optional-attributes-block"/>
            <asl:attribute <{pan glAss="dom-attribute">name="systemId" ref-type="xs:anyURI"/>
            <asl:attribute name="uri" ref-type="xs:anyURI"/>
        </asl:element>
    
        <asl:element name="cat:uri">
            <asl:use ref-id="cat:optional-attributes-block"/>
            <asl:attribute name="name" ref-type="xs:anyURI"/>
            <asl:choice max-occurs="1" min-occurs="0" repeating="stable">
                <asl:attribute name="uri" ref-type="xs:anyURI" min-occurs="0" max-occurs="1"/>
                <asl:attribute name="alternate" ref-type="xs:anyURI" min-occurs="0" max-occurs="1"/>
            </asl:choice>
        </asl:element>
    
        <asl:element name="cat:resource">
            <asl:use ref-id="cat:optional-attributes-block"/>
            <asl:attribute name="name" ref-type="xs:anyURI"/>
            <asl:attribute name="uri" ref-type="xs:anyURI"
    min-occurs="{count( not( asl:element()/cat:entry ) )}"
    max-occurs="{$asl:min-occurs}"/> <asl:step id="cat:entryElement-step"
    min-occurs="{count( boolean( asl:element()/cat:entry ) )}"
    max-occurs="{$asl:min-occurs}"> <asl:select> <asl:element ref-name="cat:entry" min-occurs="1" max-occurs="unbounded"/> </asl:select> </asl:step> </asl:element> <asl:element name="cat:rewriteSystem"> <asl:use ref-id="cat:optional-attributes-block"/> <asl:attribute name="systemIdStartString" ref-type="xs:string"/> <asl:attribute name="rewritePrefix" ref-type="xs:string"/> </asl:element> <asl:element name="cat:rewriteURI"> <asl:use ref-id="cat:optional-attributes-block"/> <asl:attribute name="uriStartString" ref-type="xs:string"/> <asl:attribute name="rewritePrefix" ref-type="xs:string"/> </asl:element> <asl:element name="cat:delegatePublic"> <asl:use ref-id="cat:optional-attributes-block"/> <asl:attribute name="publicIdStartString" ref-type="xs:string"/> <asl:attribute name="catalog" ref-type="xs:string"/> </asl:element> <asl:element name="cat:delegateSystem"> <asl:use ref-id="cat:optional-attributes-block"/> <asl:attribute name="systemIdStartString" ref-type="xs:string"/> <asl:attribute name="catalog" ref-type="xs:string"/> </asl:element> <asl:element name="oasis:delegateURI"> <asl:use ref-id="oasis:optional-attributes-block"/> <asl:attribute name="uriStartString" ref-type="xs:string"/> <asl:attribute name="catalog" ref-type="xs:string"/> </asl:element> <asl:element name="cat:nextCatalog"> <asl:use ref-id="cat:optional-attributes-block"/> <asl:attribute name="catalog" ref-type="xs:string"/> </asl:element> <asl:element name="cat:builder"> <!-- TODO --> </asl:element> </asl:active-schema>