aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Vollmer <marius.vollmer@nokia.com>2009-03-24 18:12:47 +0200
committerMarius Vollmer <marius.vollmer@nokia.com>2009-03-24 18:12:47 +0200
commitf8b98114685884dcdbabcddd32a4ee8bb9d8e04a (patch)
tree2d4039be02486fe27d445a011b9d256befeb00cb
parent79d801a5dda7b22f618ebf5f7fe106e68ace69b3 (diff)
parentc9e5cd9b7eed5c52fed5d48808f877a5efe0eabe (diff)
Merged master_0.1.3.
-rw-r--r--.gitignore1
-rw-r--r--Makefile.am12
-rw-r--r--configure.ac4
-rw-r--r--doc/context-providers.txt251
-rw-r--r--libcontextprovider/Makefile.fragment1
-rw-r--r--libcontextprovider/context_provider.vala21
-rw-r--r--libcontextprovider/cprovider.vala21
-rw-r--r--libcontextprovider/dbus_interface.vala21
-rw-r--r--libcontextprovider/key_usage_counter.vala21
-rw-r--r--libcontextprovider/manager.vala119
-rw-r--r--libcontextprovider/provider_interface.vala21
-rw-r--r--libcontextprovider/providers.vala21
-rw-r--r--libcontextprovider/string_set.vala21
-rw-r--r--libcontextprovider/subscriber.vala21
-rw-r--r--libcontextprovider/value_compare.vala19
-rw-r--r--myfilter.conf18
-rw-r--r--spec/context.xml182
-rw-r--r--spec/context.xsd214
-rwxr-xr-xspec/gen_doc.sh4
-rw-r--r--spec/xs3p/CHANGES9
-rw-r--r--spec/xs3p/LICENSE.html519
-rw-r--r--spec/xs3p/README.txt224
-rw-r--r--spec/xs3p/examples/XMLSchema.xsd2492
-rw-r--r--spec/xs3p/examples/address.xsd55
-rw-r--r--spec/xs3p/examples/build.xml40
-rw-r--r--spec/xs3p/examples/ipo.xsd59
-rw-r--r--spec/xs3p/examples/links.xml6
-rw-r--r--spec/xs3p/examples/po.xsd66
-rw-r--r--spec/xs3p/examples/recursion.xsd85
-rw-r--r--spec/xs3p/examples/report.xsd84
-rw-r--r--spec/xs3p/examples/test_msxsl.bat19
-rw-r--r--spec/xs3p/examples/test_xalanj.bat19
-rw-r--r--spec/xs3p/examples/test_xsltproc.sh30
-rw-r--r--spec/xs3p/examples/xml.xsd80
-rw-r--r--spec/xs3p/links.dtd7
-rw-r--r--spec/xs3p/links.xsd20
-rw-r--r--spec/xs3p/xs3p.xsl8503
-rw-r--r--src/Location.vala21
-rwxr-xr-xsrc/MCE.vala21
-rwxr-xr-xsrc/main.vala26
-rw-r--r--src/sqlite-test.vala8
-rw-r--r--src/sqlitevala.vala75
-rwxr-xr-xtools/context2asciidoc.pl35
-rwxr-xr-xtools/context2html.pl8
-rw-r--r--vapi/sqlite3.vapi185
45 files changed, 13205 insertions, 484 deletions
diff --git a/.gitignore b/.gitignore
index d4beaa3b..c01745e3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -105,3 +105,4 @@ libcontextprovider/cprovider.h
libcontextprovider/cprovider.c
m4/gtk-doc.m4
/contextprovider-1.0.pc
+/doc/context-providers.html
diff --git a/Makefile.am b/Makefile.am
index 68f77bdd..e4215307 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -77,6 +77,7 @@ SPEC_TOOLS = \
tools/doc-generator.xsl \
tools/spec-to-introspect.xsl \
tools/context2html.pl \
+ tools/context2asciidoc.pl \
$(NULL)
@@ -93,7 +94,7 @@ SPEC_FILES = \
INTROSPECT = $(INTERFACES:spec/%.xml=introspect/%.xml)
ASYNC_INTROSPECT = $(INTERFACES:spec/%.xml=introspect/async/%.xml)
-DOCS = doc/contextkit.html doc/context.html
+DOCS = doc/contextkit.html doc/context.html doc/context-providers.html
src/contextd.vala.stamp: contextprovider.vapi $(contextd_VALASOURCES) $(contextd_VAPISOURCES)
$(VALAC) -C --basedir $(top_srcdir) --vapidir=$(top_srcdir)/vapi --pkg posix --pkg dbus-glib-1 --pkg gee-1.0 --disable-dbus-transformation $^
@@ -117,9 +118,13 @@ context.valid.stamp: spec/context.xsd spec/context.xml
$(XMLLINT) $^
touch $@
-doc/context.html: context.valid.stamp spec/context.xml tools/context2html.pl
+doc/context.html: spec/context.xml tools/context2asciidoc.pl
install -d doc
- $(top_srcdir)/tools/context2html.pl < $(top_srcdir)/spec/context.xml > $@
+ $(top_srcdir)/tools/context2asciidoc.pl \
+ < $(top_srcdir)/spec/context.xml | asciidoc -f myfilter.conf -o $@ -
+
+doc/context-providers.html: doc/context-providers.txt
+ asciidoc -f myfilter.conf $^
CLEANFILES = $(INTROSPECT) $(ASYNC_INTROSPECT) context.valid.stamp
clean-local:
@@ -144,6 +149,7 @@ EXTRA_DIST += \
$(contextd_VALASOURCES) \
$(contextd_VAPISOURCES) \
src/contextd.vala.stamp \
+ doc/context-providers.txt \
$(SPEC_FILES) \
spec/all.xml \
spec/context.xml \
diff --git a/configure.ac b/configure.ac
index b1b51cc9..37a047c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([ContextKit], [0.1.2], [rob.taylor@codethink.co.uk], ContextKit)
+AC_INIT([ContextKit], [0.1.3], [rob.taylor@codethink.co.uk], ContextKit)
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE([-Wall -Werror dist-bzip2 tar-ustar 1.9])
@@ -66,7 +66,7 @@ AC_ARG_ENABLE(debug,
GLIB_REQUIRED=2.12.0
GEE_REQUIRED=0.1.3
-PKG_CHECK_MODULES(CONTEXTD, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED sqlite3 dbus-glib-1 gee-1.0 >= $GEE_REQUIRED)
+PKG_CHECK_MODULES(CONTEXTD, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED dbus-glib-1 gee-1.0 >= $GEE_REQUIRED)
##################################
# Flags for coverage measurement
diff --git a/doc/context-providers.txt b/doc/context-providers.txt
new file mode 100644
index 00000000..2d6c72f5
--- /dev/null
+++ b/doc/context-providers.txt
@@ -0,0 +1,251 @@
+How to provide context properties
+=================================
+
+Any component can provide its own key/value pairs and make them appear
+in the api:libduivaluespace[+DuiValueSpace+] (and other interfaces
+that expose context properties).
+
+As a provider of context properties, you need to drop one or more
+_property declaration_ files into +/usr/share/context-providers/+ to
+register your properties with the context framework. This file
+follows a format described below and is used by DuiValueSpace and
+others to find you when someone subscribes to your properties. The
+file is also used by the Context Commander to show descriptions of
+your properties and to learn about the possible values that a property
+can legally have.
+
+The property declaration files also inform the context framework how
+you want to be contacted. Right now, you have to implement the
+api:org.freedesktop.ContextKit[] D-Bus interface, and register
+yourself on either the system or the session D-Bus with a suitable bus
+name. The choice iof system or session bus and your bus name go into
+the property declaration file.
+
+The easiest way to implement the api:org.freedesktop.ContextKit[]
+interface is to use the api:libcontextprovider[] library.
+
+The property declaration file
+-----------------------------
+
+The property declaration file contains XML and must follow
+link:schema.html[this XML schema]. A simple example for the
++Context.Example.Random+ property looks like this:
+
+[source,xml]
+------------------
+<?xml version="1.0"?>
+<provider bus="session" service="com.example.RandomProvider">
+ <node name="Context">
+ <node name="Example">
+ <doc>
+ A exemplary context provider.
+ </doc>
+ <key name="Random" type="DOUBLE">
+ <doc>
+ A random number between 0 and 1 that changes every now and then.
+ </doc>
+ </key>
+ </node>
+ </node>
+</provider>
+------------------
+
+This file declares the single property +Context.Example.Random+ and
+instructs the Content Framework to connect to the
++com.exmple.RandomProvider+ bus name on the session D-Bus.
+
+You need to be careful when choosing property name; see the
+"Guidelines for property providers" section for how to avoid
+conflicts.
+
+When providing properties from the api:context-properties[core list],
+you need to follow additional rules to make sure that your property
+declarations and the centrally maintained core list do not fall out of
+synch. See the "Providing core properties" section for more about
+them.
+
+After installing a property declaration file into a directory +$dir+,
+you should usually execute +update-context-propoerties+ like so:
+
+[source,sh]
+-----------------------
+update-context-properties $dir
+-----------------------
+
+This will update the various caches that clients like the
++DuiValueSpace+ use.
+
+But, if a property declaration file is installed via a Debian package,
+you should not call +update-context-propoerties+ in your maintainer
+scripts. Triggers in the relevant packages take care of running
+update-context-properties at the right time and only as often as
+necessary.
+
+XML structure
+~~~~~~~~~~~~~
+
+The XML element tree in the property declaration file consists of
+nested +node+ elements, and each +node+ defines the prefix for the
+names of all its children. The top level node should always have the
+name "Context".
+
+Actual properties are defined with +key+ elements. A +key+ element
+contains child elements that describe the possible values of the
+property, using elements such as +string+ or +float+.
+
+Documentation
+~~~~~~~~~~~~~
+
+Every +node+ and +key+ element in the property declaration tree can
+have a +doc+ element. The contents of this element should be text
+formatted using link:http://www.methods.co.nz/asciidoc/[asccidoc]
+markup.
+
+Types
+~~~~~
+
+*NOTE:* This is preview of things that might come, or not. For now,
+just use a +type+ attribute in your +key+ elements with one of
++"TRUTH"+, +"STRING"+, +"INT"+, or +"DOUBLE"+ as the value.
+
+
+Each +key+ element in the property declaration tree should contain a
+child element that describes the possible values of the property.
+Allowed elements are:
+
++bool+::
+True or false.
+
++int+::
+A integer. Attributes min, max.
+
++float+::
+A floating point number. Attributes min, max.
+
++string+::
+A arbitrary string.
+
++const+::
+A constant. Constant are useful inside of a +choice+
+element. Attributes +bool+, +int+, +float+, +string+.
+
++list+::
+A list. The single child element of +list+ specifies the possible values
+for all the list elements.
+
++struct+::
+A fixed length list. Each child element of +struct+ specifies the
+possible values for the corresponding list element. The +tag+
+attribute of the children can be used to give names to the list
+elements.
+
++choice+::
+One of a given set of alternative. Each child element describes one
+alternative. The possible values for the alternatives must not
+overlap with each other. This makes it possible to find the
+alternative that corresponds to a given value. The +tag+ attribute of
+the children can be used to give names to the alternatives.
+
+For example,
+
+[source,xml]
+----
+<struct>
+ <bool tag="landscape"/>
+ <bool tag="inverted"/>
+<struct>
+----
+
+describes a pair of booleans. When showing it, the first boolean is
+named "landscape" and the second is named "inverted".
+
+This example
+
+[source,xml]
+----
+<choice>
+ <const int="1" tag="First"/>
+ <const int="2" tag="Second"/>
+</choice>
+----
+
+describes a property that can have the values +1+ and +2+. When
+letting the user edit the value, the given tags will be used in a drop
+down list instead of the raw numbers.
+
+The following example takes things to far. It describes a tagged
+union that represents a location either by name or by geographical
+coordinates.
+
+[source,xml]
+----
+<choice>
+ <struct tag="named">
+ <const int="0"/>
+ <string/>
+ </struct>
+ <struct tag="coords">
+ <const int="1"/>
+ <float tag="latitude"/>
+ <float tag="longitude"/>
+ </struct>
+</choice>
+----
+
+Guidelines for property providers
+---------------------------------
+
+TBW.
+
+Providing core properties
+-------------------------
+
+The Context Framework project maintains a list of _core properties_.
+These core properties are intended to cover the needs of most
+applications and be meaningful for many different devices.
+
+When you are implementing a provider for some of the core properties,
+you must of course make sure that you follow the specification of that
+property. You can not redefine its type or description in your
+property declaration file, obviously.
+
+But you still need to include a complete property declaration file
+with your provider and install it in +/usr/share/context-providers/+.
+At run-time, all properties are equal and there isn't anything special
+about core properties anymore.
+
+To create a property declaration file that includes core properties,
+you should copy the necesarry fragments out of the core declaration
+file into yours. The core declaration file can be found in the
++contextkit-dev+ package and also link:context.xml[here].
+
+The core properties will not change very often, but there might be
+changes. When that happens, you need to review the changes and
+maybe--after careful consideration--update your implementation to
+reflect the changes. You also need to update your property
+declaration file at that time.
+
+The +contextkit-dev+ package contains the +check-core-properties+ tool
+to help with this. Running it like this
+
+[source,sh]
+----
+check-context-properties properties.xml
+----
+
+will check every core property declared in the file +properties.xml+
+against its current official declarations. It will output some
+diagnosis and fail if there are any discrepancies. You should run it
+as part of your test-suite.
+
+You can automatically update your property declaration file from the
+current official declarations by using the +--update+ option:
+
+[source,sh]
+----
+check-context-properties --update properties.xml
+----
+
+This will modify +properties.xml+ in place. You should run it
+manually when adapting your provider to changes in the official core
+property declarations.
diff --git a/libcontextprovider/Makefile.fragment b/libcontextprovider/Makefile.fragment
index a37d74b4..b0cd4183 100644
--- a/libcontextprovider/Makefile.fragment
+++ b/libcontextprovider/Makefile.fragment
@@ -7,6 +7,7 @@ libcontextprovider_VALASOURCES_PRIV = \
libcontextprovider/key_usage_counter.vala \
libcontextprovider/subscriber.vala \
libcontextprovider/cprovider.vala \
+ libcontextprovider/value_compare.vala \
$(NULL)
libcontextprovider_VALASOURCES_PUB = \
diff --git a/libcontextprovider/context_provider.vala b/libcontextprovider/context_provider.vala
index e26c21a5..838918c8 100644
--- a/libcontextprovider/context_provider.vala
+++ b/libcontextprovider/context_provider.vala
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2008, 2009 Nokia Corporation.
+ *
+ * Contact: Marius Vollmer <marius.vollmer@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
using Gee;
namespace ContextProvider {
diff --git a/libcontextprovider/cprovider.vala b/libcontextprovider/cprovider.vala
index db5d2c10..8819272c 100644
--- a/libcontextprovider/cprovider.vala
+++ b/libcontextprovider/cprovider.vala
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2008, 2009 Nokia Corporation.
+ *
+ * Contact: Marius Vollmer <marius.vollmer@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
using GLib;
using Gee;
diff --git a/libcontextprovider/dbus_interface.vala b/libcontextprovider/dbus_interface.vala
index d7f452f1..418335ed 100644
--- a/libcontextprovider/dbus_interface.vala
+++ b/libcontextprovider/dbus_interface.vala
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2008, 2009 Nokia Corporation.
+ *
+ * Contact: Marius Vollmer <marius.vollmer@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
using GLib;
using DBus;
diff --git a/libcontextprovider/key_usage_counter.vala b/libcontextprovider/key_usage_counter.vala
index 30be4537..7456ac01 100644
--- a/libcontextprovider/key_usage_counter.vala
+++ b/libcontextprovider/key_usage_counter.vala
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2008, 2009 Nokia Corporation.
+ *
+ * Contact: Marius Vollmer <marius.vollmer@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
using GLib;
namespace ContextProvider {
diff --git a/libcontextprovider/manager.vala b/libcontextprovider/manager.vala
index ab49d0d8..fdd93531 100644
--- a/libcontextprovider/manager.vala
+++ b/libcontextprovider/manager.vala
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2008, 2009 Nokia Corporation.
+ *
+ * Contact: Marius Vollmer <marius.vollmer@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
using GLib;
using Gee;
@@ -53,15 +74,26 @@ namespace ContextProvider {
get_internal (keyset, out values_to_send, out undeterminable_keys);
}
- internal void get_internal (StringSet keyset, out HashTable<string, Value?> values_to_send, out string[] undeterminable_keys) {
- HashTable<string, Value?> values = new HashTable<string, Value?> (str_hash, str_equal);
-
- // Let providers update the central value table
- ArrayList<string> undeterminable_key_list = providers.get (keyset, values);
- insert_to_value_table (values, undeterminable_key_list);
+ internal void get_internal (StringSet keyset, out HashTable<string, Value?> properties, out string[] undeterminable_keys) {
+ // Note: Vala doesn't support += for parameters yet; using a temp array
+ properties = new HashTable<string, Value?>(str_hash, str_equal);
+ string[] undeterminable_keys_temp = {};
+ foreach (var key in keyset) {
+ debug (" %s", key);
+ //debug ("reading value for key %s", key);
+ Value? v = values.lookup (key);
- // Then read the values from the value table
- read_from_value_table(keyset, out values_to_send, out undeterminable_keys);
+ if (v == null) {
+ debug (" - undeterminable");
+ undeterminable_keys_temp += key;
+ }
+ else {
+ debug (" - %s", v.strdup_contents());
+ properties.insert (key, v);
+ }
+ }
+ undeterminable_keys = undeterminable_keys_temp;
+ debug ("read_from_value_table done");
}
public DBus.ObjectPath GetSubscriber (DBus.BusName name) throws DBus.Error {
@@ -127,77 +159,28 @@ namespace ContextProvider {
return checked_keys;
}
- /*
- Update the value table with new values.
- */
- private void insert_to_value_table(HashTable<string, Value?> properties, ArrayList<string>? undeterminable_keys) {
- //debug ("insert_to_value_table");
- var keys = properties.get_keys ();
+ /* Is called when the provider sets new values to context properties */
+ public bool property_values_changed(HashTable<string, Value?> properties, ArrayList<string>? undeterminable_keys) {
// Note: get_keys returns a list of unowned strings. We shouldn't assign it to
// a list of owned strings. At the moment, the Vala compiler doesn't prevent us
// from doing so.
- foreach (var key in keys) {
- // Overwrite the value in the value table.
- // Do not care whether it was already there or not.
- values.insert (key, properties.lookup (key));
- }
- foreach (var key in undeterminable_keys) {
- values.insert (key, null);
- }
- }
-
- /*
- Read the values of the specified keys from the value table.
- */
- private void read_from_value_table(StringSet keys, out HashTable<string, Value?> properties, out string[] undeterminable_keys) {
- debug ("read_from_value_table");
- // Note: Vala doesn't support += for parameters yet; using a temp array
- properties = new HashTable<string, Value?>(str_hash, str_equal);
- string[] undeterminable_keys_temp = {};
- foreach (var key in keys) {
- debug (" %s", key);
- //debug ("reading value for key %s", key);
- Value? v = values.lookup (key);
-
- if (v == null) {
- debug (" - undeterminable");
- undeterminable_keys_temp += key;
- }
- else {
- debug (" - %s", v.strdup_contents());
- properties.insert (key, v);
- }
- }
- undeterminable_keys = undeterminable_keys_temp;
- debug ("read_from_value_table done");
- }
-
- /* Is called when the provider sets new values to context properties */
- public bool property_values_changed(HashTable<string, Value?> properties, ArrayList<string>? undeterminable_keys) {
- // Check that all the keys are valid
- var keys = properties.get_keys ();
- foreach (var key in keys) {
+ foreach (var key in properties.get_keys()) {
if (providers.valid_keys.is_member (key) == false) {
- debug ("Key %s is not valid", key);
- assert (false);
- // FIXME: How to react?
- // Now we drop the whole event and return an error value
- return false;
+ critical ("Key %s is not valid", key);
+ }
+ // Remove unchanged keys
+ if (value_compare(values.lookup(key),properties.lookup (key))) {
+ properties.remove(key);
}
+ values.insert (key, properties.lookup (key));
}
foreach (var key in undeterminable_keys) {
if (providers.valid_keys.is_member (key) == false) {
- debug ("Key %s is not valid", key);
- assert (false);
- // FIXME: How to react?
- // Now we drop the whole event and return an error value
- return false;
+ critical ("Key %s is not valid", key);
}
+ values.insert (key, null);
}
- // Update the value table
- insert_to_value_table(properties, undeterminable_keys);
-
// Inform the subscribers of the change
foreach (var s in subscribers.get_values()) {
s.on_value_changed(properties, undeterminable_keys);
diff --git a/libcontextprovider/provider_interface.vala b/libcontextprovider/provider_interface.vala
index db36d899..10d235d6 100644
--- a/libcontextprovider/provider_interface.vala
+++ b/libcontextprovider/provider_interface.vala
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2008, 2009 Nokia Corporation.
+ *
+ * Contact: Marius Vollmer <marius.vollmer@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
using GLib;
using Gee;
diff --git a/libcontextprovider/providers.vala b/libcontextprovider/providers.vala
index 7b04ff0d..eca51386 100644
--- a/libcontextprovider/providers.vala
+++ b/libcontextprovider/providers.vala
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2008, 2009 Nokia Corporation.
+ *
+ * Contact: Marius Vollmer <marius.vollmer@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
using Gee;
namespace ContextProvider {
diff --git a/libcontextprovider/string_set.vala b/libcontextprovider/string_set.vala
index 7c984b7c..efbc549a 100644
--- a/libcontextprovider/string_set.vala
+++ b/libcontextprovider/string_set.vala
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2008, 2009 Nokia Corporation.
+ *
+ * Contact: Marius Vollmer <marius.vollmer@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
namespace ContextProvider {
/**
diff --git a/libcontextprovider/subscriber.vala b/libcontextprovider/subscriber.vala
index daea2ced..7630a68f 100644
--- a/libcontextprovider/subscriber.vala
+++ b/libcontextprovider/subscriber.vala
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2008, 2009 Nokia Corporation.
+ *
+ * Contact: Marius Vollmer <marius.vollmer@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
using GLib;
using Gee;
diff --git a/libcontextprovider/value_compare.vala b/libcontextprovider/value_compare.vala
new file mode 100644
index 00000000..d7f8679d
--- /dev/null
+++ b/libcontextprovider/value_compare.vala
@@ -0,0 +1,19 @@
+using GLib;
+
+namespace ContextProvider {
+
+ /* All because GValue SUCKS. bring on GVariant */
+ bool value_compare (Value? v1, Value? v2) {
+ if (v1 == null && v2 == null)
+ return true;
+ if (v1.type() == typeof(int) && v2.type() == typeof(int))
+ return (v1.get_int() == v2.get_int());
+ if (v1.type() == typeof(double) && v2.type() == typeof(double))
+ return (v1.get_double() == v2.get_double());
+ if (v1.type() == typeof(bool) && v2.type() == typeof(bool))
+ return (v1.get_boolean() == v2.get_boolean());
+ if (v1.type() == typeof(string) && v2.type() == typeof(string))
+ return (v1.get_string() == v2.get_string());
+ return false;
+ }
+}
diff --git a/myfilter.conf b/myfilter.conf
new file mode 100644
index 00000000..38ef3870
--- /dev/null
+++ b/myfilter.conf
@@ -0,0 +1,18 @@
+# AsciiDoc filter for graphviz
+
+[svg-template]
+<div class="svg">
+<div class="title">{title}</div>
+<object type="image/svg+xml" data="{file}"></object>
+</div>
+
+[blockdef-filter]
+ifdef::backend-xhtml11[]
+dotty-style=template="svg-template",subs=(),posattrs=("style","file"),filter="dot -Tsvg -o{outdir}/{file}; echo"
+endif::backend-xhtml11[]
+
+[macros]
+(?su)[\\]?(?P<name>api):(?P<target>\S*?)(\[(?P<attrlist>.*?)\])=
+
+[api-inlinemacro]
+<a href="../{target}/index.html">{0=<tt>{target}</tt>}</a>
diff --git a/spec/context.xml b/spec/context.xml
index b4b84818..061a432f 100644
--- a/spec/context.xml
+++ b/spec/context.xml
@@ -1,67 +1,123 @@
<?xml version="1.0"?>
-<provider service="org.freedesktop.ContextKit">
- <doc>
- Contextd daemon provides the below specified read only properties.
- This file is the ultimate source of information about the properties provided
- by contextd. As such it should be kept closely synchronized with contextd.
- </doc>
- <root>
+<properties xmlns="http://contextkit.freedesktop.org/Provider">
+ <doc>
+Core Context Properties
+=======================
+
+This is the list of the core contextual properties of the Maemo
+platform.
+
+This document is maintained as part of the +contextkit+ package.
+Please report change requests as bugs against the +contextkit+
+package.
+
+*NOTE:* Most of these properties are unstable and their definition will
+change for some time still. Only the ones explicitly marked as stable
+should be used for now.
+
+ </doc>
<node name="Context">
- <doc> There will be probably one top level node as here, but more can be added. </doc>
- <node name="Device">
-<!--
- <node name="Display">
- <doc> These are properties related to the built-in display. </doc>
- <key name="displayLit" type="INT"/>
- <key name="inHomeScreen" type="STRING">
- <doc> What this might be? </doc>
- </key>
- <key name="brightnessLevel" type="STRING">
- <doc> these should be one-liner commentst about the property </doc>
- </key>
- </node>
- <node name="Battery">
- <key name="capacity" type="INT"/>
- <key name="percentRemaining" type="INT"/>
- <key name="timeOnBattery" type="INT"/>
- <key name="timeLeftOnBattery" type="INT">
- <doc> We store time in the battery </doc>
- </key>
- <key name="isCharging" type="INT"/>
- <key name="timeToCompleteCharge" type="INT"/>
- </node>
- <node name="CurrentProfile"/>
--->
- <node name="Orientation">
- <key name="facingUp" type="TRUTH">
- <doc>A boolean , true if the device is face up, false if face down </doc>
- </key>
- <key name="edgeUp" type="ENUM">
- <doc> The screen edge that is currently pointing upwards.</doc>
- <enumerator name="Top" value="1"/>
- <enumerator name="Left" value="2"/>
- <enumerator name="Right" value="3"/>
- <enumerator name="Bottom" value="4"/>
- </key>
- </node>
-<!--
- <node name="Memory">
- <doc>These are coming from /proc/meminfo, right?</doc>
- <key name="ramUsed" type="INT"/>
- <key name="ramTotal" type="INT"/>
- <key name="swapFree" type="INT"/>
- <key name="swapUsed" type="INT"/>
- <key name="swapTotal" type="INT"/>
- <key name="internalFree" type="INT"/>
- <key name="internalUsed" type="INT"/>
- <key name="internalTotal" type="INT"/>
- <key name="externalFree" type="INT"/>
- <key name="externalUsed" type="INT"/>
- <key name="externalTotal" type="INT"/>
- <key name="isInternalCardCorrupted" type="INT"/>
- </node>
--->
+ <node name="Screen">
+ <doc>
+Display screens
+---------------
+
+These properties talk about the display screens of the device.
+ </doc>
+ <key name="TopEdge" type="STRING">
+ <doc>
+The edge of the main display screen where the user expects
+the top-most UI elements to be. Possible values are the
+strings "top", "bottom", "left", and "right", which refer to
+the edges of the screen in its normal orientation as defined
+by the graphics hardware. _(stable)_
+ </doc>
+ </key>
+ <key name="IsCovered" type="TRUTH">
+ <doc>
+Whether or not the main display screen is covered and can
+not be seen by the user. This might mean that the device is
+laying face down on a table, or that its lid is closed if it
+has one. _(stable)_
+ </doc>
+ </key>
+ </node>
+ <node name="Location">
+ <doc>
+Location
+--------
+
+Information about the geographic location of the device.
+ </doc>
+ <key name="Streets" type="STRING">
+ <doc>
+The names of the nearby streets, as a list of strings. The list might
+be empty when the current location is not near any street, or there
+might be more than one name in the list, when we are at an
+intersection.
+ </doc>
+ </key>
+ <key name="City" type="STRING">
+ <doc>
+The name of the current city in the users language, as a string.
+ </doc>
+ </key>
+ <key name="State" type="STRING">
+ <doc>
+The name of the current state in the users language, as a string.
+ </doc>
+ </key>
+ <key name="StateCode" type="STRING">
+ <doc>
+The ISO 3166-2 code of the current state, as a string. See
+link:http://en.wikipedia.org/wiki/ISO_3166-2[here] for more
+information. This value of this property includes the IS3166-1
+alpha-2 prefix, as is usual for ISO 3166-2 codes.
+ </doc>
+ </key>
+ <key name="Country" type="STRING">
+ <doc>
+The name of the current country in the users language, as a string.
+ </doc>
+ </key>
+ <key name="CountryCode" type="STRING">
+ <doc>
+The ISO 3166-1 alpha-2 code of the current country, as a string. See
+link:http://en.wikipedia.org/wiki/ISO_3166-1[here] for more
+information.
+ </doc>
+ </key>
+ <key name="Continent" type="STRING">
+ <doc>
+The name of the current continent, as a string.
+ </doc>
+ </key>
+ <key name="Planet" type="STRING">
+ <doc>
+The name of the current planet (or dwarf planet), as a string.
+ </doc>
+ </key>
+ </node>
+ <node name="Connectivity">
+ <doc>
+Network connectivity
+--------------------
+
+Information about the network connectivity of the device.
+ </doc>
+ </node>
+ <node name="Situation">
+ <doc>
+Situations
+----------
+
+Information about the _situation_ the device is in.
+ </doc>
+ <key name="IsDark" type="TRUTH">
+ <doc>
+Whether or not it is dark.
+ </doc>
+ </key>
</node>
</node>
- </root>
-</provider>
+</properties>
diff --git a/spec/context.xsd b/spec/context.xsd
index 7ad187af..86e16007 100644
--- a/spec/context.xsd
+++ b/spec/context.xsd
@@ -1,65 +1,149 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
- <xs:element name="provider">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" ref="doc"/>
- <xs:element name="root">
- <xs:complexType>
- <xs:group maxOccurs="unbounded" ref="node"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="service" use="required" type="xs:NCName"/>
- </xs:complexType>
- </xs:element>
- <xs:group name="node">
- <xs:sequence>
- <xs:element name="node">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" ref="doc"/>
- <xs:choice>
- <xs:group minOccurs="0" maxOccurs="unbounded" ref="node"/>
- <xs:group minOccurs="0" maxOccurs="unbounded" ref="key"/>
- </xs:choice>
- </xs:sequence>
- <xs:attribute name="name" use="required" type="xs:NCName"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:group>
- <xs:element name="doc" type="xs:string"/>
- <xs:group name="key">
- <xs:sequence>
- <xs:element name="key">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" ref="doc"/>
- <xs:element minOccurs="0" maxOccurs="unbounded" ref="enumerator"/>
- </xs:sequence>
- <xs:attribute name="name" use="required" type="xs:NCName"/>
- <xs:attribute name="type" use="required" type="typetype"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:group>
- <xs:element name="enumerator">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" maxOccurs="unbounded" ref="enumerator"/>
- </xs:sequence>
- <xs:attribute name="name" use="required" type="xs:NCName"/>
- <xs:attribute name="value" use="required" type="xs:integer"/>
- </xs:complexType>
- </xs:element>
- <xs:simpleType name="typetype">
- <xs:restriction base="xs:string">
- <xs:enumeration value="INT"/>
- <xs:enumeration value="DOUBLE"/>
- <xs:enumeration value="STRING"/>
- <xs:enumeration value="TRUTH"/>
- <xs:enumeration value="ENUM"/>
- </xs:restriction>
- </xs:simpleType>
-</xs:schema>
+<schema targetNamespace="http://contextkit.freedesktop.org/Provider"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:provider="http://contextkit.freedesktop.org/Provider">
+ <annotation>
+ <documentation>
+ Documentation for ContextKit Provider schema.
+ Copyright 2009 Nokia Corporation.
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <documentation>
+ This schema is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <documentation>
+ This schema is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <documentation>
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA
+ </documentation>
+ </annotation>
+
+ <simpleType name="dbusBusType">
+ <annotation><documentation>
+ Represents a standard D-Bus bus type.
+ </documentation></annotation>
+ <restriction base="string">
+ <enumeration value="system"/>
+ <enumeration value="session"/>
+ </restriction>
+ </simpleType>
+
+ <complexType name="propertyList">
+ <sequence>
+ <element minOccurs="0" ref="provider:doc"/>
+ <element maxOccurs="unbounded" ref="provider:node"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="providerDefn">
+ <complexContent>
+ <extension base="provider:propertyList">
+ <attribute name="bus" use="required" type="provider:dbusBusType">
+ <annotation><documentation>
+ Which standard D-Bus bus this service can be activated on
+ </documentation></annotation>
+ </attribute>
+ <attribute name="service" use="required" type="NCName">
+ <annotation><documentation>
+ The bus name of the service that will provide these keys.
+ This service must be activatable on the bus specified in "bus".
+ </documentation></annotation>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <element name="provider" type="provider:providerDefn">
+ <annotation>
+ <documentation>
+ A top-level declaration of a context-providing service using the
+ ContextKit framework.
+ </documentation>
+ </annotation>
+ </element>
+
+ <element name="properties" type="provider:propertyList">
+ <annotation>
+ <documentation>
+ A top-level definition of property names and meaning, divorced from a
+ specific context providing service.
+ </documentation>
+ </annotation>
+ </element>
+
+
+ <element name="node">
+ <complexType>
+ <annotation><documentation>
+ A node in the tree of provided context.
+ A node can have children that are keys or nodes.
+ </documentation></annotation>
+
+ <sequence>
+ <element minOccurs="0" ref="provider:doc"/>
+ <choice>
+ <element minOccurs="0" maxOccurs="unbounded" ref="provider:node"/>
+ <element minOccurs="0" maxOccurs="unbounded" ref="provider:key"/>
+ </choice>
+ </sequence>
+ <attribute name="name" use="required" type="NCName">
+ <annotation><documentation>
+ The name of the node.
+ </documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="doc" type="string">
+ <annotation><documentation>
+ Documentation about a key or node.
+ </documentation></annotation>
+ </element>
+
+ <element name="key">
+ <complexType >
+ <sequence>
+ <element minOccurs="0" ref="provider:doc"/>
+ </sequence>
+ <attribute name="name" use="required" type="NCName">
+ <annotation><documentation>
+ The name of this key.
+ </documentation></annotation>
+ </attribute>
+ <attribute name="type" use="required" type="provider:contextType">
+ <annotation><documentation>
+ The type of this key.
+ </documentation></annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <simpleType name="contextType">
+ <annotation><documentation>
+ The type of a simple context key.
+ </documentation></annotation>
+ <restriction base="string">
+ <enumeration value="INT"/>
+ <enumeration value="DOUBLE"/>
+ <enumeration value="STRING"/>
+ <enumeration value="TRUTH"/>
+ </restriction>
+ </simpleType>
+</schema>
diff --git a/spec/gen_doc.sh b/spec/gen_doc.sh
new file mode 100755
index 00000000..d5be95ba
--- /dev/null
+++ b/spec/gen_doc.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+xsltproc --nonet --output context-provider-schema.html \
+ xs3p/xs3p.xsl \
+ context.xsd
diff --git a/spec/xs3p/CHANGES b/spec/xs3p/CHANGES
new file mode 100644
index 00000000..6a67241c
--- /dev/null
+++ b/spec/xs3p/CHANGES
@@ -0,0 +1,9 @@
+xs3p was originally developed by DSTC and was availabe
+through their website at http://titanium.dstc.edu.au/xml/xs3p/
+
+Since the demise of this organization, we at FiForms Solutions
+have decided to host xs3p, since we have been using it in
+documenting the XML used in FiForms. The stylesheet has been
+modified to point to the new xs3p home here at FiForms, while
+still retaining the old (dead) link to the dstc website. The
+xs3p home is http://xml.fiforms.org/xs3p/ \ No newline at end of file
diff --git a/spec/xs3p/LICENSE.html b/spec/xs3p/LICENSE.html
new file mode 100644
index 00000000..263e6356
--- /dev/null
+++ b/spec/xs3p/LICENSE.html
@@ -0,0 +1,519 @@
+<html>
+
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <title>DSTC Public License</title>
+</head>
+
+<body>
+<h1>DSTC Public License (DPL)</h1>
+<p>Version 1.1</p>
+
+<h2>1. Definitions.</h2>
+
+<p><b>1.0.1. "Commercial Use" </b>means distribution or otherwise making
+the Covered Code available to a third party.</p>
+
+<p><b>1.1. "Contributor"</b> means each entity that creates or
+contributes to the creation of Modifications.</p>
+
+<p><b>1.2. "Contributor Version"</b> means the combination of the
+Original Code, prior Modifications used by a Contributor, and the
+Modifications made by that particular Contributor.</p>
+
+<p><b>1.3. "Covered Code"</b> means the Original Code or
+Modifications or the combination of the Original Code and Modifications,
+in each case including portions thereof<b>.</b></p>
+
+<p><b>1.4. "Electronic Distribution Mechanism"</b> means a mechanism
+generally accepted in the software development community for the
+electronic transfer of data.</p>
+
+<p><b>1.5. "Executable"</b> means Covered Code in any form other than
+Source Code.</p>
+
+<p><b>1.6. "Initial Developer"</b> means the individual or entity
+identified as the Initial Developer in the Source Code notice required
+by <b>Exhibit A</b>.</p>
+
+<p><b>1.7. "Larger Work"</b> means a work which combines Covered Code
+or portions thereof with code not governed by the terms of this
+License.</p>
+
+<p><b>1.8. "License"</b> means this document.</p>
+
+<p><b>1.8.1. "Licensable"</b> means having the right to grant, to the
+maximum extent possible, whether at the time of the initial grant or
+subsequently acquired, any and all of the rights conveyed herein.</p>
+
+<p><b>1.9. "Modifications"</b> means any addition to or deletion from
+the substance or structure of either the Original Code or any previous
+Modifications. When Covered Code is released as a series of files, a
+Modification is:</p>
+
+<ul>
+<li><b>A.</b> Any addition to or
+deletion from the contents of a file containing Original Code or previous
+Modifications.</li>
+
+<li><b>B.</b> Any new file that contains any part of the Original Code
+or previous Modifications.</li>
+</ul>
+
+
+<p><b>1.10. "Original Code"</b>
+means Source Code of computer software code which is described in the Source
+Code notice required by <b>Exhibit A</b> as Original Code, and which, at the
+time of its release under this License is not already Covered Code governed by
+this License.</p>
+
+<p><b>1.10.1. "Patent Claims"</b> means any patent claim(s), now owned
+or hereafter acquired, including without limitation, method, process,
+and apparatus claims, in any patent Licensable by grantor.</p>
+
+<p><b>1.11. "Source Code"</b> means the preferred form of the Covered
+Code for making modifications to it, including all modules it contains,
+plus any associated interface definition files, scripts used to control
+compilation and installation of an Executable, or source code
+differential comparisons against either the Original Code or another
+well known, available Covered Code of the Contributor's choice. The
+Source Code can be in a compressed or archival form, provided the
+appropriate decompression or de-archiving software is widely available
+for no charge.</p>
+
+<p><b>1.12. "You" (or "Your")</b> means an individual or a legal
+entity exercising rights under, and complying with all of the terms of,
+this License or a future version of this License issued under Section
+6.1. For legal entities, "You" includes any entity which controls, is
+controlled by, or is under common control with You. For purposes of this
+definition, "control" means (a) the power, direct or indirect, to cause
+the direction or management of such entity, whether by contract or
+otherwise, or (b) ownership of more than fifty percent (50%) of the
+outstanding shares or beneficial ownership of such
+entity.</p>
+
+
+<h2>2. Source Code License.</h2>
+
+<h3>2.1. The Initial Developer Grant.</h3>
+
+<p>The Initial Developer hereby grants You a world-wide, royalty-free,
+non-exclusive license, subject to third party intellectual property
+claims:</p>
+
+<p><b>(a)</b> under intellectual property rights (other than patent or
+trademark) Licensable by Initial Developer to use, reproduce, modify,
+display, perform, sublicense and distribute the Original Code (or
+portions thereof) with or without Modifications, and/or as part of a
+Larger Work; and</p>
+
+<p><b>(b)</b> under Patents Claims infringed by the making, using or
+selling of Original Code, to make, have made, use, practice, sell, and
+offer for sale, and/or otherwise dispose of the Original Code (or
+portions thereof).</p>
+
+<p><b>(c) </b>the licenses granted in this Section 2.1(a) and (b) are
+effective on the date Initial Developer first distributes Original Code
+under the terms of this License.</p>
+
+<p><b>(d) </b>Notwithstanding Section 2.1(b) above, no patent license is
+granted: 1) for code that You delete from the Original Code; 2) separate
+from the Original Code; or 3) for infringements caused by: i) the
+modification of the Original Code or ii) the combination of the Original
+Code with other software or devices.</p>
+
+<h3>2.2. Contributor Grant.</h3>
+
+<p>Subject to third party intellectual property claims, each Contributor
+hereby grants You a world-wide, royalty-free, non-exclusive license</p>
+
+<p><b>(a)</b> under intellectual property rights (other than patent or
+trademark) Licensable by Contributor, to use, reproduce, modify,
+display, perform, sublicense and distribute the Modifications created by
+such Contributor (or portions thereof) either on an unmodified basis,
+with other Modifications, as Covered Code and/or as part of a Larger
+Work; and</p>
+
+<p><b>(b)</b> under Patent Claims infringed by the making, using, or
+selling of Modifications made by that Contributor either alone and/or in
+combination with its Contributor Version (or portions of such
+combination), to make, use, sell, offer for sale, have made, and/or
+otherwise dispose of: 1) Modifications made by that Contributor (or
+portions thereof); and 2) the combination of Modifications made by that
+Contributor with its Contributor Version (or portions of such
+combination).</p>
+
+<p><b>(c) </b>the licenses granted in Sections 2.2(a) and 2.2(b) are
+effective on the date Contributor first makes Commercial Use of the
+Covered Code.</p>
+
+<p><b>(d)</b> Notwithstanding Section 2.2(b) above, no patent
+license is granted: 1) for any code that Contributor has deleted from
+the Contributor Version; 2) separate from the Contributor Version; 3)
+for infringements caused by: i) third party modifications of Contributor
+Version or ii) the combination of Modifications made by that Contributor
+with other software (except as part of the Contributor Version) or other
+devices; or 4) under Patent Claims infringed by Covered Code in the
+absence of Modifications made by that Contributor.</p>
+
+
+<h2>3. Distribution Obligations</h2>
+
+<h3>3.1. Application of License.</h3>
+
+<p>The Modifications which You create or to which You contribute are
+governed by the terms of this License, including without limitation
+Section <b>2.2</b>. The Source Code version of Covered Code may be
+distributed only under the terms of this License or a future version of
+this License released under Section <b>6.1</b>, and You must include a
+copy of this License with every copy of the Source Code You
+distribute. You may not offer or impose any terms on any Source Code
+version that alters or restricts the applicable version of this License
+or the recipients' rights hereunder. However, You may include an
+additional document offering the additional rights described in Section
+<b>3.5</b>.</p>
+
+<h3>3.2. Availability of Source Code.</h3>
+
+<p>Any Modification which You create or to which You contribute must be
+made available in Source Code form under the terms of this License
+either on the same media as an Executable version or via an accepted
+Electronic Distribution Mechanism to anyone to whom you made an
+Executable version available; and if made available via Electronic
+Distribution Mechanism, must remain available for at least twelve (12)
+months after the date it initially became available, or at least six (6)
+months after a subsequent version of that particular Modification has
+been made available to such recipients. You are responsible for ensuring
+that the Source Code version remains available even if the Electronic
+Distribution Mechanism is maintained by a third party.</p>
+
+<h3>3.3. Description of Modifications.</h3>
+
+<p>You must cause all Covered Code to which You contribute to contain a
+file documenting the changes You made to create that Covered Code and
+the date of any change. You must include a prominent statement that the
+Modification is derived, directly or indirectly, from Original Code
+provided by the Initial Developer and including the name of the Initial
+Developer in (a) the Source Code, and (b) in any notice in an Executable
+version or related documentation in which You describe the origin or
+ownership of the Covered Code.</p>
+
+<h3>3.4. Intellectual Property Matters</h3>
+
+<h4>(a) Third Party Claims.</h4>
+
+<p>If Contributor has knowledge that a license under a third party's
+intellectual property rights is required to exercise the rights granted
+by such Contributor under Sections 2.1 or 2.2, Contributor must include
+a text file with the Source Code distribution titled "LEGAL" which
+describes the claim and the party making the claim in sufficient detail
+that a recipient will know whom to contact. If Contributor obtains such
+knowledge after the Modification is made available as described in
+Section 3.2, Contributor shall promptly modify the LEGAL file in all
+copies Contributor makes available thereafter and shall take other steps
+(such as notifying appropriate mailing lists or newsgroups) reasonably
+calculated to inform those who received the Covered Code that new
+knowledge has been obtained.</p>
+
+<h4>(b) Contributor APIs.</h4>
+
+<p>If Contributor's Modifications include an application programming
+interface and Contributor has knowledge of patent licenses which are
+reasonably necessary to implement that API, Contributor must also
+include this information in the LEGAL file.</p>
+
+<h4>(c) Representations.</h4>
+
+<p>Contributor represents that, except
+as disclosed pursuant to Section 3.4(a) above, Contributor believes that
+Contributor's Modifications are Contributor's original creation(s)
+and/or Contributor has sufficient rights to grant the rights conveyed by
+this License.</p>
+
+<h3>3.5. Required Notices.</h3>
+
+<p>You must duplicate the notice in <b>Exhibit A</b> in each file of the
+Source Code. If it is not possible to put such notice in a
+particular Source Code file due to its structure, then You must include
+such notice in a location (such as a relevant directory) where a user
+would be likely to look for such a notice. If You created one or
+more Modification(s) You may add your name as a Contributor to the
+notice described in <b>Exhibit A</b>. You must also duplicate this
+License in any documentation for the Source Code where You describe
+recipients' rights or ownership rights relating to Covered Code.
+You may choose to offer, and to charge a fee for, warranty, support,
+indemnity or liability obligations to one or more recipients of Covered
+Code. However, You may do so only on Your own behalf, and not on behalf
+of the Initial Developer or any Contributor. You must make it absolutely
+clear than any such warranty, support, indemnity or liability obligation
+is offered by You alone, and You hereby agree to indemnify the Initial
+Developer and every Contributor for any liability incurred by the
+Initial Developer or such Contributor as a result of warranty, support,
+indemnity or liability terms You offer.</p>
+
+<h3>3.6. Distribution of Executable Versions.</h3>
+
+<p>You may distribute Covered Code in Executable form only if the
+requirements of Section <b>3.1-3.5</b> have been met for that Covered
+Code, and if You include a notice stating that the Source Code version
+of the Covered Code is available under the terms of this License,
+including a description of how and where You have fulfilled the
+obligations of Section <b>3.2</b>. The notice must be conspicuously
+included in any notice in an Executable version, related documentation
+or collateral in which You describe recipients' rights relating to the
+Covered Code. You may distribute the Executable version of Covered Code
+or ownership rights under a license of Your choice, which may contain
+terms different from this License, provided that You are in compliance
+with the terms of this License and that the license for the Executable
+version does not attempt to limit or alter the recipient's rights in the
+Source Code version from the rights set forth in this License. If You
+distribute the Executable version under a different license You must
+make it absolutely clear that any terms which differ from this License
+are offered by You alone, not by the Initial Developer or any
+Contributor. You hereby agree to indemnify the Initial Developer and
+every Contributor for any liability incurred by the Initial Developer or
+such Contributor as a result of any such terms You offer.</p>
+
+<h3>3.7. Larger Works.</h3>
+
+<p>You may create a Larger Work by combining Covered Code with other code not
+governed by the terms of this License and distribute the Larger Work as a
+single product. In such a case, You must make sure the requirements of this
+License are fulfilled for the Covered Code.</p>
+
+<h2>4. Inability to Comply Due to Statute or Regulation.</h2>
+
+<p>If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Code due to statute,
+judicial order, or regulation then You must: (a) comply with the terms
+of this License to the maximum extent possible; and (b) describe the
+limitations and the code they affect. Such description must be included
+in the LEGAL file described in Section <b>3.4</b> and must be included
+with all distributions of the Source Code. Except to the extent
+prohibited by statute or regulation, such description must be
+sufficiently detailed for a recipient of ordinary skill to be able to
+understand it.</p>
+
+
+<h2>5. Application of this License.</h2>
+
+<p>This License applies to code to which the Initial Developer has
+attached the notice in <b>Exhibit A</b> and to related Covered Code.</p>
+
+
+<h2>6. Versions of the License.</h2>
+
+<h3>6.1. New Versions</h3>
+
+<p>The Distributed Systems Technology Centre ("DSTC") may publish
+revised and/or new versions of the License from time to time. Each
+version will be given a distinguishing version number.</p>
+
+<h3>6.2. Effect of New Versions</h3>
+
+<p>Once Covered Code has been published under a particular version of
+the License, You may always continue to use it under the terms of that
+version. You may also choose to use such Covered Code under the terms of
+any subsequent version of the License published by DSTC. No one other
+than DSTC has the right to modify the terms applicable to Covered Code
+created under this License.</p>
+
+<h3>6.3. Derivative Works</h3>
+
+<p>If You create or use a modified version of this License (which you
+may only do in order to apply it to code which is not already Covered
+Code governed by this License), You must (a) rename Your license so that
+the phrases "DSTC", "DPL" or any confusingly similar phrase do not
+appear in your license (except to note that your license differs from
+this License) and (b) otherwise make it clear that Your version of the
+license contains terms which differ from the DSTC Public
+License. (Filling in the name of the Initial Developer, Original Code or
+Contributor in the notice described in <b>Exhibit A</b> shall not of
+themselves be deemed to be modifications of this License.)</p>
+
+<h2>7. Disclaimer of Warranty.</h2>
+
+<p>COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS,
+MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE
+RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH
+YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT
+THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY
+NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY
+CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED
+CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.</p>
+
+
+<h2>8. Termination.</h2>
+
+<p><b>8.1. </b>This License and the rights granted hereunder will
+terminate automatically if You fail to comply with terms herein and fail
+to cure such breach within 30 days of becoming aware of the breach. All
+sublicenses to the Covered Code which are properly granted shall survive
+any termination of this License. Provisions which, by their nature, must
+remain in effect beyond the termination of this License shall
+survive.</p>
+
+<p><b>8.2.
+</b>If You initiate
+litigation by asserting a patent infringement claim (excluding declatory
+judgment actions) against Initial Developer or a Contributor (the Initial
+Developer or Contributor against whom You file such action is referred to as
+'Participant') alleging that:</p>
+
+<p><b>(a) </b>such Participant's Contributor Version directly or
+indirectly infringes any patent, then any and all rights granted by such
+Participant to You under Sections 2.1 and/or 2.2 of this License shall,
+upon 60 days notice from Participant terminate prospectively, unless if
+within 60 days after receipt of notice You either: (i) agree in writing
+to pay Participant a mutually agreeable reasonable royalty for Your past
+and future use of Modifications made by such Participant, or (ii)
+withdraw Your litigation claim with respect to the Contributor Version
+against such Participant. If within 60 days of notice, a reasonable
+royalty and payment arrangement are not mutually agreed upon in writing
+by the parties or the litigation claim is not withdrawn, the rights
+granted by Participant to You under Sections 2.1 and/or 2.2
+automatically terminate at the expiration of the 60 day notice period
+specified above.</p>
+
+<p><b>(b)</b> any software, hardware, or device, other than such
+Participant's Contributor Version, directly or indirectly infringes any
+patent, then any rights granted to You by such Participant under
+Sections 2.1(b) and 2.2(b) are revoked effective as of the date You
+first made, used, sold, distributed, or had made, Modifications made by
+that Participant.</p>
+
+<p><b>8.3.
+</b>If You assert a patent
+infringement claim against Participant alleging that such Participant's
+Contributor Version directly or indirectly infringes any patent where such
+claim is resolved (such as by license or settlement) prior to the initiation of
+patent infringement litigation, then the reasonable value of the licenses
+granted by such Participant under Sections 2.1 or 2.2 shall be taken into
+account in determining the amount or value of any payment or license.</p>
+
+<p><b>8.4.</b> In the event of termination under
+Sections 8.1 or 8.2 above, all end user license agreements (excluding
+distributors and resellers) which have been validly granted by You or any
+distributor hereunder prior to termination shall survive termination.</p>
+
+<h2>9. Limitation of Liability.</h2>
+
+<p>UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR
+ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY
+INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER
+INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK
+STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
+OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION
+AND LIMITATION MAY NOT APPLY TO YOU.</p>
+
+<h2>10. U.S. Government End Users.</h2>
+
+<p>The Covered Code is a "commercial item," as that term is defined in
+48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+software" and "commercial computer software documentation," as such
+terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+all U.S. Government End Users acquire Covered Code with only those
+rights set forth herein.</p>
+
+
+<h2>11. Miscellaneous.</h2>
+
+<p>This License represents the complete agreement concerning subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. This License shall be governed by
+Queensland, Australia law provisions (except to the extent applicable
+law, if any, provides otherwise), excluding its conflict-of-law
+provisions. With respect to disputes in which at least one party is a
+citizen of, or an entity chartered or registered to do business in
+Australia, any litigation relating to this License shall be subject to
+the jurisdiction of Australian Courts, with the losing party responsible
+for costs, including without limitation, court costs and reasonable
+attorneys' fees and expenses. The application of the United Nations
+Convention on Contracts for the International Sale of Goods is expressly
+excluded. Any law or regulation which provides that the language of a
+contract shall be construed against the drafter shall not apply to this
+License.</p>
+
+
+<h2>12. Responsibility for Claims.</h2>
+
+<p>As between Initial Developer and the Contributors, each party is
+responsible for claims and damages arising, directly or indirectly, out
+of its utilization of rights under this License and You agree to work
+with Initial Developer and Contributors to distribute such
+responsibility on an equitable basis. Nothing herein is intended or
+shall be deemed to constitute any admission of liability.</p>
+
+
+<h2>13. Multiple-licensed Code.</h2>
+
+<p>Initial Developer may designate portions of the Covered Code as
+"Multiple-Licensed". "Multiple-Licensed" means that the Initial
+Developer permits you to utilize portions of the Covered Code under Your
+choice of the DPL or the alternative licenses, if any, specified by the
+Initial Developer in the file described in Exhibit A.</p>
+
+
+<h2>14. High Risk Activities.</h2>
+
+<p>The Software is not fault-tolerant and is not designed, manufactured
+or intended for use or resale as on-line control equipment in hazardous
+environments requiring fail-safe performance, such as in the operation
+of nuclear facilities, aircraft navigation or communication systems, air
+traffic control, direct life support machines, or weapons systems, in
+which the failure of the Software could lead directly to death, personal
+injury, or severe physical or environmental damage ("High Risk
+Activities").</p>
+
+
+<h2>EXHIBIT A - DSTC Public License.</h2>
+
+<p>The contents of this file are subject to the DSTC Public License
+Version 1.1 (the 'License'); you may not use this file except in
+compliance with the License.</p>
+
+<p>Software distributed under the License is distributed on an 'AS IS'
+basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+License for the specific language governing rights and limitations under
+the License.</p>
+
+<p>The Original Code is ______________________________________.</p>
+
+<p>The Initial Developer of the Original Code is
+________________________. Portions created by ______________________ are
+Copyright &copy; _____________________________. All Rights
+Reserved.</p>
+
+<p>Contributor(s): ______________________________________.</p>
+
+<p>Alternatively, the contents of this file may be used under the terms
+of the _____ license (the "[___] License"), in which case the provisions
+of [______] License are applicable instead of those above. If you wish
+to allow use of your version of this file only under the terms of the
+[____] License and not to allow others to use your version of this file
+under the DPL, indicate your decision by deleting the provisions above
+and replace them with the notice and other provisions required by the
+[___] License. If you do not delete the provisions above, a recipient
+may use your version of this file under either the DPL or the [___]
+License.'</p>
+
+<p>[NOTE: The text of this Exhibit A may differ slightly from the text
+of the notices in the Source Code files of the Original Code. You should
+use the text of this Exhibit A rather than the text found in the
+Original Code Source Code for Your Modifications.]</p>
+
+</body>
+
+</html>
+
diff --git a/spec/xs3p/README.txt b/spec/xs3p/README.txt
new file mode 100644
index 00000000..c9c2df10
--- /dev/null
+++ b/spec/xs3p/README.txt
@@ -0,0 +1,224 @@
+xs3p - Version 1.0
+==================
+
+Index
+-----
+-Description
+-Generating the documentation
+-Viewing the documentation
+-Configuring the stylesheet
+
+Description
+-----------
+
+xs3p is a schema documentation generator. It is an XSLT stylesheet
+that will output an XHTML document from an XSD schema. Aside from
+using as much W3C acronyms as possible, the tool makes schemas more
+readable by providing a view of schema components' constraints as a
+sample XML instance, links that allow the user to jump to the
+documentation of schema components that are referenced, and a whole
+host of neat features. However, most important of all, it makes your
+schemas look 'pretty in pink'.
+
+Generating the documentation
+----------------------------
+
+To generate the documentation, you need a command-line XSLT tool that
+supports the W3C XSLT 1.0 recommendation. (NOTE: xs3p does not work
+with <?xml-stylesheet ?> processing instruction because the <A> links
+in the generated XHTML document will not be correct.)
+
+Here are a few examples of XSLT tools:
+
+1. MSXML 4.0 (Windows only)
+---------------------------
+
+You can download MSXML 4.0 SP1 at:
+
+http://msdn.microsoft.com/downloads/default.asp?
+url=/downloads/sample.asp?url=/msdn-
+files/027/001/766/msdncompositedoc.xml
+
+(If the URL is incorrect, go to http://msdn.microsoft.com, and search
+for the keywords, "msxml 4.0".)
+
+Microsoft's web page gives you instructions of how to install the
+MSXML 4.0 library. You'll also need to download Msxsl which is a
+wrapper to access the library from the command-line. You can download
+it at:
+
+http://msdn.microsoft.com/downloads/default.asp?
+URL=/downloads/sample.asp?url=/MSDN-
+FILES/027/001/485/msdncompositedoc.xml
+
+(Again, if the URL is incorrect, go to http://msdn.microsoft.com, and
+search for the keyword, "msxsl".)
+
+Click on the "Download the executable file" link. Save the msxsl.exe
+file in a directory specified in the PATH environment variable. In
+most cases, you can dump the file in c:\winnt (or c:\windows
+depending on your OS) directory since it's already in the PATH
+variable.
+
+Type: msxsl -? to learn how to use the tool. The basic usage is:
+
+msxsl [source] [stylesheet] -o [result] {[param-name]=[param-value]...}
+
+2. Xalan (Java-based)
+---------------------
+
+You can download Xalan from Apache at:
+
+http://xml.apache.org/xalan-j/getstarted.html
+
+The web page gives you instructions of how to install Xalan. You can
+find out how to use Xalan's command-line tool at:
+
+http://xml.apache.org/xalan-j/commandline.html
+
+The basic usage is:
+
+java org.apache.xalan.xslt.Process -IN [source] -XSL [stylesheet]
+-OUT [result] {-PARAM [param-name] [param-value]...}
+
+3. Saxon (Java-based)
+---------------------
+
+You can download Saxon from Sourceforge at:
+
+http://sourceforge.net/projects/saxon
+
+If you download the saxon package, it comes with instructions of how
+to install and use the Java jar files.
+
+If you download the instant saxon package, it comes with a .exe file,
+and all you have to do is put the file in a directory in the PATH
+environment variable. It also comes with instant.html file, which
+documents how to use it. The basic usage is:
+
+saxon -o [result] [source] [stylesheet] {[param-name]=[param-value]...}
+
+Viewing the documentation
+-------------------------
+
+To view the documentation, you need a browser that supports the W3C
+XHTML 1.0 and CSS 2 recommendations, e.g.
+-Internet Explorer 5.5 and above
+-Netscape 6 and above
+-Opera 5.0 and above
+-Mozilla 1.0
+
+Configuring the stylesheet
+--------------------------
+
+The xs3p stylesheet can be customised through its global parameters,
+which are listed below.
+
+title :-
+ You can specify your own title for the document, rather than
+using the default one.
+
+sortByComponent :-
+ If this parameter is set to "true", the schema components are
+presented sorted by type and name. Otherwise, they are presented in
+the order that they appear in the schema. By default, this parameter
+is set to "true."
+
+useJavaScript :-
+ The generated XHTML document uses JavaScript to hide some
+details like the underlying schema component XML representation,
+which can be made to appear with a button press. Since some people
+have ideological objections to JavaScript, this feature can be turned
+off. If this parameter is set to "true", JavaScript will be used in
+the generated documentation. Otherwise, it won't. By default, this
+parameter is set to "true."
+
+printAllSuperTypes :-
+ The type hierarchy of a global type definition is displayed in
+its section. If this parameter is set to "true", all super-types of
+the current type are shown in the type hierarchy. Otherwise, only the
+immediate parent type is displayed. By default, this parameter is set
+to "true."
+
+printAllSubTypes :-
+ This parameter has a similar concept as printAllSuperTypes. If
+it is set to "true", all sub-types of the current type are shown in
+the type hierarchy. Otherwise, only the direct sub-types are
+displayed. By default, this parameter is set to "true."
+
+printLegend :-
+ If this parameter is set to "true", the Legend section is
+included. Otherwise, it isn't. By default, this parameter is set to
+"true."
+
+printGlossary :-
+ If this parameter is set to "true", the Glossary section is
+included. Otherwise, it isn't. By default, this parameter is set to
+"true."
+
+printNSPrefixes :-
+ If this parameter is set to "true", namespace information is
+provided when displaying sample instances and references. This is
+done by providing a prefix in front of tags and references, which
+when clicked, will take the user to the declared namespace. The
+prefix matches the prefix in the namespace declaration in the schema.
+If not set to "true", namespace prefixes are not displayed. By
+default, this parameter is set to "true."
+
+searchIncludedSchemas :-
+ If this parameter is set to "true", xs3p will search for
+components in "included" schemas when creating links and generating
+the XML Instance Representation table.
+ When this parameter is set to "true", the "linksFile" parameter
+must also be set, which is described below. Otherwise, an error will
+be raised.
+ The XSLT processor will also raise an error if it can't find the
+schemas specified in the "schemaLocation" attribute of "include"
+elements. XSLT implementations seem to resolve relative addresses
+relative to the XSLT script, rather than the source file. This is a
+common cause of error since in schemas, the "schemaLocation"
+attribute is specified relative to the current schema. It is probably
+best to write a script (e.g. Ant build file, DOS batch file, or Unix
+shell script), which copies the xs3p stylesheet to the directory
+containing the set of schemas and execute the XSLT script based on
+the local copy.
+ The final thing to note is that this search is recursive, so
+schemas "included" in the current schema's "included" schemas will
+also be searched. This is another common source of error, since
+schemas may be searched that might not have been thought about.
+ There are some batch files in the examples/ directory to show
+how to use this feature. If you have 'msxsl', run "test_msxsl.bat"
+file. If you use 'xalanj', run "test_xalanj.bat" file. Otherwise,
+edit the files for your specific XSLT processor.
+
+searchImportedSchemas :-
+ If this parameter is set to "true", xs3p will search for
+components in "imported" schemas when creating links and generating
+the XML Instance Representation table. The above discussion for the
+"searchIncludedSchemas" parameter also applies to this parameter.
+Also, when this parameter is set to "true", the "linksFile" parameter
+must also be set.
+
+linksFile :-
+ Specifies the file which maps from file locations of
+"included" and "imported" schemas to the file locations of their
+xs3p-generated documentation. This file must be provided if either
+"searchIncludedSchemas" or "searchImportedSchemas" is set to true.
+ If relative addresses are used to specify the location of
+external xs3p-generated documentation, they must be relative to
+documentation file currently generated. NOTE: The external
+documentation files does not need to exist at the time of generating
+the documentation for the current schema.
+ The mapping is specified in XML. The dtd and schema for this
+mapping syntax are "links.dtd" and "links.xsd" respectively.
+ A sample links file, "links.xml", is provided in the examples/
+directory.
+ NOTE: The "xmlns" namespace attribute with the correct
+namespace must be provided in the mapping file for the xs3p
+stylesheet to work.
+
+
+
+COPYRIGHT AND LICENCE
+
+Copyright (C) 2001, 2002 DSTC Pty Ltd. \ No newline at end of file
diff --git a/spec/xs3p/examples/XMLSchema.xsd b/spec/xs3p/examples/XMLSchema.xsd
new file mode 100644
index 00000000..b8229fd9
--- /dev/null
+++ b/spec/xs3p/examples/XMLSchema.xsd
@@ -0,0 +1,2492 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- XML Schema schema for XML Schemas: Part 1: Structures -->
+<!-- Note this schema is NOT the normative structures schema. -->
+<!-- The prose copy in the structures REC is the normative -->
+<!-- version (which shouldn't differ from this one except for -->
+<!-- this comment and entity expansions, but just in case -->
+<!--
+<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd" [
+-->
+
+<!-- provide ID type information even for parsers which only read the
+ internal subset -->
+<!--
+<!ATTLIST xs:schema id ID #IMPLIED>
+<!ATTLIST xs:complexType id ID #IMPLIED>
+<!ATTLIST xs:complexContent id ID #IMPLIED>
+<!ATTLIST xs:simpleContent id ID #IMPLIED>
+<!ATTLIST xs:extension id ID #IMPLIED>
+<!ATTLIST xs:element id ID #IMPLIED>
+<!ATTLIST xs:group id ID #IMPLIED>
+<!ATTLIST xs:all id ID #IMPLIED>
+<!ATTLIST xs:choice id ID #IMPLIED>
+<!ATTLIST xs:sequence id ID #IMPLIED>
+<!ATTLIST xs:any id ID #IMPLIED>
+<!ATTLIST xs:anyAttribute id ID #IMPLIED>
+<!ATTLIST xs:attribute id ID #IMPLIED>
+<!ATTLIST xs:attributeGroup id ID #IMPLIED>
+<!ATTLIST xs:unique id ID #IMPLIED>
+<!ATTLIST xs:key id ID #IMPLIED>
+<!ATTLIST xs:keyref id ID #IMPLIED>
+<!ATTLIST xs:selector id ID #IMPLIED>
+<!ATTLIST xs:field id ID #IMPLIED>
+<!ATTLIST xs:include id ID #IMPLIED>
+<!ATTLIST xs:import id ID #IMPLIED>
+<!ATTLIST xs:redefine id ID #IMPLIED>
+<!ATTLIST xs:notation id ID #IMPLIED>
+-->
+<!--
+ keep this schema XML1.0 DTD valid
+ -->
+<!--
+ <!ENTITY % schemaAttrs 'xmlns:hfp CDATA #IMPLIED'>
+
+ <!ELEMENT hfp:hasFacet EMPTY>
+ <!ATTLIST hfp:hasFacet
+ name NMTOKEN #REQUIRED>
+
+ <!ELEMENT hfp:hasProperty EMPTY>
+ <!ATTLIST hfp:hasProperty
+ name NMTOKEN #REQUIRED
+ value CDATA #REQUIRED>
+-->
+<!--
+ Make sure that processors that do not read the external
+ subset will know about the various IDs we declare
+ -->
+<!--
+ <!ATTLIST xs:simpleType id ID #IMPLIED>
+ <!ATTLIST xs:maxExclusive id ID #IMPLIED>
+ <!ATTLIST xs:minExclusive id ID #IMPLIED>
+ <!ATTLIST xs:maxInclusive id ID #IMPLIED>
+ <!ATTLIST xs:minInclusive id ID #IMPLIED>
+ <!ATTLIST xs:totalDigits id ID #IMPLIED>
+ <!ATTLIST xs:fractionDigits id ID #IMPLIED>
+ <!ATTLIST xs:length id ID #IMPLIED>
+ <!ATTLIST xs:minLength id ID #IMPLIED>
+ <!ATTLIST xs:maxLength id ID #IMPLIED>
+ <!ATTLIST xs:enumeration id ID #IMPLIED>
+ <!ATTLIST xs:pattern id ID #IMPLIED>
+ <!ATTLIST xs:appinfo id ID #IMPLIED>
+ <!ATTLIST xs:documentation id ID #IMPLIED>
+ <!ATTLIST xs:list id ID #IMPLIED>
+ <!ATTLIST xs:union id ID #IMPLIED>
+ ]>
+-->
+<xs:schema targetNamespace="http://www.w3.org/2001/XMLSchema" blockDefault="#all" elementFormDefault="qualified" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="EN" xmlns:hfp="http://www.w3.org/2001/XMLSchema-hasFacetAndProperty">
+ <xs:annotation>
+ <xs:documentation>
+ Part 1 version: Id: XMLSchema.xsd,v 1.50 2002/05/22 09:24:24 ht Exp
+ Part 2 version: Id: datatypes.xsd,v 1.54 2002/05/27 22:22:50 ht Exp
+ </xs:documentation>
+ </xs:annotation>
+
+
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/structures.html">
+ The schema corresponding to this document is normative,
+ with respect to the syntactic constraints it expresses in the
+ XML Schema language. The documentation (within &lt;documentation> elements)
+ below, is not normative, but rather highlights important aspects of
+ the W3C Recommendation of which this is a part</xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+ <xs:documentation>
+ The simpleType element and all of its members are defined
+ towards the end of this schema document</xs:documentation>
+ </xs:annotation>
+
+ <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd">
+ <xs:annotation>
+ <xs:documentation>
+ Get access to the xml: attribute groups for xml:lang
+ as declared on 'schema' and 'documentation' below
+ </xs:documentation>
+ </xs:annotation>
+ </xs:import>
+
+ <xs:complexType name="openAttrs">
+ <xs:annotation>
+ <xs:documentation>
+ This type is extended by almost all schema types
+ to allow attributes from other namespaces to be
+ added to user schemas.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:restriction base="xs:anyType">
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="annotated">
+ <xs:annotation>
+ <xs:documentation>
+ This type is extended by all types which allow annotation
+ other than &lt;schema&gt; itself
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="xs:openAttrs">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="id" type="xs:ID"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:group name="schemaTop">
+ <xs:annotation>
+ <xs:documentation>
+ This group is for the
+ elements which occur freely at the top level of schemas.
+ All of their types are based on the "annotated" type by extension.</xs:documentation>
+ </xs:annotation>
+ <xs:choice>
+ <xs:group ref="xs:redefinable"/>
+ <xs:element ref="xs:element"/>
+ <xs:element ref="xs:attribute"/>
+ <xs:element ref="xs:notation"/>
+ </xs:choice>
+ </xs:group>
+
+ <xs:group name="redefinable">
+ <xs:annotation>
+ <xs:documentation>
+ This group is for the
+ elements which can self-redefine (see &lt;redefine> below).</xs:documentation>
+ </xs:annotation>
+ <xs:choice>
+ <xs:element ref="xs:simpleType"/>
+ <xs:element ref="xs:complexType"/>
+ <xs:element ref="xs:group"/>
+ <xs:element ref="xs:attributeGroup"/>
+ </xs:choice>
+ </xs:group>
+
+ <xs:simpleType name="formChoice">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="qualified"/>
+ <xs:enumeration value="unqualified"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="reducedDerivationControl">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:derivationControl">
+ <xs:enumeration value="extension"/>
+ <xs:enumeration value="restriction"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="derivationSet">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ <xs:documentation>
+ #all or (possibly empty) subset of {extension, restriction}</xs:documentation>
+ </xs:annotation>
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="#all"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:list itemType="xs:reducedDerivationControl"/>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+
+ <xs:element name="schema" id="schema">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-schema"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:openAttrs">
+ <xs:sequence>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="xs:include"/>
+ <xs:element ref="xs:import"/>
+ <xs:element ref="xs:redefine"/>
+ <xs:element ref="xs:annotation"/>
+ </xs:choice>
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:group ref="xs:schemaTop"/>
+ <xs:element ref="xs:annotation" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:sequence>
+ <xs:attribute name="targetNamespace" type="xs:anyURI"/>
+ <xs:attribute name="version" type="xs:normalizedString"/>
+ <xs:attribute name="finalDefault" type="xs:derivationSet" use="optional" default=""/>
+ <xs:attribute name="blockDefault" type="xs:blockSet" use="optional" default=""/>
+ <xs:attribute name="attributeFormDefault" type="xs:formChoice" use="optional" default="unqualified"/>
+ <xs:attribute name="elementFormDefault" type="xs:formChoice" use="optional" default="unqualified"/>
+ <xs:attribute name="id" type="xs:ID"/>
+ <xs:attribute ref="xml:lang"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:key name="element">
+ <xs:selector xpath="xs:element"/>
+ <xs:field xpath="@name"/>
+ </xs:key>
+
+ <xs:key name="attribute">
+ <xs:selector xpath="xs:attribute"/>
+ <xs:field xpath="@name"/>
+ </xs:key>
+
+ <xs:key name="type">
+ <xs:selector xpath="xs:complexType|xs:simpleType"/>
+ <xs:field xpath="@name"/>
+ </xs:key>
+
+ <xs:key name="group">
+ <xs:selector xpath="xs:group"/>
+ <xs:field xpath="@name"/>
+ </xs:key>
+
+ <xs:key name="attributeGroup">
+ <xs:selector xpath="xs:attributeGroup"/>
+ <xs:field xpath="@name"/>
+ </xs:key>
+
+ <xs:key name="notation">
+ <xs:selector xpath="xs:notation"/>
+ <xs:field xpath="@name"/>
+ </xs:key>
+
+ <xs:key name="identityConstraint">
+ <xs:selector xpath=".//xs:key|.//xs:unique|.//xs:keyref"/>
+ <xs:field xpath="@name"/>
+ </xs:key>
+
+ </xs:element>
+
+ <xs:simpleType name="allNNI">
+ <xs:annotation><xs:documentation>
+ for maxOccurs</xs:documentation></xs:annotation>
+ <xs:union memberTypes="xs:nonNegativeInteger">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="unbounded"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+
+ <xs:attributeGroup name="occurs">
+ <xs:annotation><xs:documentation>
+ for all particles</xs:documentation></xs:annotation>
+ <xs:attribute name="minOccurs" type="xs:nonNegativeInteger" use="optional" default="1"/>
+ <xs:attribute name="maxOccurs" type="xs:allNNI" use="optional" default="1"/>
+ </xs:attributeGroup>
+
+ <xs:attributeGroup name="defRef">
+ <xs:annotation><xs:documentation>
+ for element, group and attributeGroup,
+ which both define and reference</xs:documentation></xs:annotation>
+ <xs:attribute name="name" type="xs:NCName"/>
+ <xs:attribute name="ref" type="xs:QName"/>
+ </xs:attributeGroup>
+
+ <xs:group name="typeDefParticle">
+ <xs:annotation>
+ <xs:documentation>
+ 'complexType' uses this</xs:documentation></xs:annotation>
+ <xs:choice>
+ <xs:element name="group" type="xs:groupRef"/>
+ <xs:element ref="xs:all"/>
+ <xs:element ref="xs:choice"/>
+ <xs:element ref="xs:sequence"/>
+ </xs:choice>
+ </xs:group>
+
+
+
+ <xs:group name="nestedParticle">
+ <xs:choice>
+ <xs:element name="element" type="xs:localElement"/>
+ <xs:element name="group" type="xs:groupRef"/>
+ <xs:element ref="xs:choice"/>
+ <xs:element ref="xs:sequence"/>
+ <xs:element ref="xs:any"/>
+ </xs:choice>
+ </xs:group>
+
+ <xs:group name="particle">
+ <xs:choice>
+ <xs:element name="element" type="xs:localElement"/>
+ <xs:element name="group" type="xs:groupRef"/>
+ <xs:element ref="xs:all"/>
+ <xs:element ref="xs:choice"/>
+ <xs:element ref="xs:sequence"/>
+ <xs:element ref="xs:any"/>
+ </xs:choice>
+ </xs:group>
+
+ <xs:complexType name="attribute">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:sequence>
+ <xs:element name="simpleType" minOccurs="0" type="xs:localSimpleType"/>
+ </xs:sequence>
+ <xs:attributeGroup ref="xs:defRef"/>
+ <xs:attribute name="type" type="xs:QName"/>
+ <xs:attribute name="use" use="optional" default="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="prohibited"/>
+ <xs:enumeration value="optional"/>
+ <xs:enumeration value="required"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="default" type="xs:string"/>
+ <xs:attribute name="fixed" type="xs:string"/>
+ <xs:attribute name="form" type="xs:formChoice"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="topLevelAttribute">
+ <xs:complexContent>
+ <xs:restriction base="xs:attribute">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:element name="simpleType" minOccurs="0" type="xs:localSimpleType"/>
+ </xs:sequence>
+ <xs:attribute name="ref" use="prohibited"/>
+ <xs:attribute name="form" use="prohibited"/>
+ <xs:attribute name="use" use="prohibited"/>
+ <xs:attribute name="name" use="required" type="xs:NCName"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:group name="attrDecls">
+ <xs:sequence>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="attribute" type="xs:attribute"/>
+ <xs:element name="attributeGroup" type="xs:attributeGroupRef"/>
+ </xs:choice>
+ <xs:element ref="xs:anyAttribute" minOccurs="0"/>
+ </xs:sequence>
+ </xs:group>
+
+ <xs:element name="anyAttribute" type="xs:wildcard" id="anyAttribute">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-anyAttribute"/>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:group name="complexTypeModel">
+ <xs:choice>
+ <xs:element ref="xs:simpleContent"/>
+ <xs:element ref="xs:complexContent"/>
+ <xs:sequence>
+ <xs:annotation>
+ <xs:documentation>
+ This branch is short for
+ &lt;complexContent>
+ &lt;restriction base="xs:anyType">
+ ...
+ &lt;/restriction>
+ &lt;/complexContent></xs:documentation>
+ </xs:annotation>
+ <xs:group ref="xs:typeDefParticle" minOccurs="0"/>
+ <xs:group ref="xs:attrDecls"/>
+ </xs:sequence>
+ </xs:choice>
+ </xs:group>
+
+ <xs:complexType name="complexType" abstract="true">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:group ref="xs:complexTypeModel"/>
+ <xs:attribute name="name" type="xs:NCName">
+ <xs:annotation>
+ <xs:documentation>
+ Will be restricted to required or forbidden</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="mixed" type="xs:boolean" use="optional" default="false">
+ <xs:annotation>
+ <xs:documentation>
+ Not allowed if simpleContent child is chosen.
+ May be overriden by setting on complexContent child.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="abstract" type="xs:boolean" use="optional" default="false"/>
+ <xs:attribute name="final" type="xs:derivationSet"/>
+ <xs:attribute name="block" type="xs:derivationSet"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="topLevelComplexType">
+ <xs:complexContent>
+ <xs:restriction base="xs:complexType">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:group ref="xs:complexTypeModel"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:NCName" use="required"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="localComplexType">
+ <xs:complexContent>
+ <xs:restriction base="xs:complexType">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:group ref="xs:complexTypeModel"/>
+ </xs:sequence>
+ <xs:attribute name="name" use="prohibited"/>
+ <xs:attribute name="abstract" use="prohibited"/>
+ <xs:attribute name="final" use="prohibited"/>
+ <xs:attribute name="block" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="restrictionType">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:sequence>
+ <xs:choice minOccurs="0">
+ <xs:group ref="xs:typeDefParticle"/>
+ <xs:group ref="xs:simpleRestrictionModel"/>
+ </xs:choice>
+ <xs:group ref="xs:attrDecls"/>
+ </xs:sequence>
+ <xs:attribute name="base" type="xs:QName" use="required"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="complexRestrictionType">
+ <xs:complexContent>
+ <xs:restriction base="xs:restrictionType">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:choice minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>This choice is added simply to
+ make this a valid restriction per the REC</xs:documentation>
+ </xs:annotation>
+ <xs:group ref="xs:typeDefParticle"/>
+ </xs:choice>
+ <xs:group ref="xs:attrDecls"/>
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="extensionType">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:sequence>
+ <xs:group ref="xs:typeDefParticle" minOccurs="0"/>
+ <xs:group ref="xs:attrDecls"/>
+ </xs:sequence>
+ <xs:attribute name="base" type="xs:QName" use="required"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="complexContent" id="complexContent">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-complexContent"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:choice>
+ <xs:element name="restriction" type="xs:complexRestrictionType"/>
+ <xs:element name="extension" type="xs:extensionType"/>
+ </xs:choice>
+ <xs:attribute name="mixed" type="xs:boolean">
+ <xs:annotation>
+ <xs:documentation>
+ Overrides any setting on complexType parent.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name="simpleRestrictionType">
+ <xs:complexContent>
+ <xs:restriction base="xs:restrictionType">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:choice minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>This choice is added simply to
+ make this a valid restriction per the REC</xs:documentation>
+ </xs:annotation>
+ <xs:group ref="xs:simpleRestrictionModel"/>
+ </xs:choice>
+ <xs:group ref="xs:attrDecls"/>
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="simpleExtensionType">
+ <xs:complexContent>
+ <xs:restriction base="xs:extensionType">
+ <xs:sequence>
+ <xs:annotation>
+ <xs:documentation>
+ No typeDefParticle group reference</xs:documentation>
+ </xs:annotation>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:group ref="xs:attrDecls"/>
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="simpleContent" id="simpleContent">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-simpleContent"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:choice>
+ <xs:element name="restriction" type="xs:simpleRestrictionType"/>
+ <xs:element name="extension" type="xs:simpleExtensionType"/>
+ </xs:choice>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="complexType" type="xs:topLevelComplexType" id="complexType">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-complexType"/>
+ </xs:annotation>
+ </xs:element>
+
+
+ <xs:simpleType name="blockSet">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ <xs:documentation>
+ #all or (possibly empty) subset of {substitution, extension,
+ restriction}</xs:documentation>
+ </xs:annotation>
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="#all"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:list>
+ <xs:simpleType>
+ <xs:restriction base="xs:derivationControl">
+ <xs:enumeration value="extension"/>
+ <xs:enumeration value="restriction"/>
+ <xs:enumeration value="substitution"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:list>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+
+ <xs:complexType name="element" abstract="true">
+ <xs:annotation>
+ <xs:documentation>
+ The element element can be used either
+ at the top level to define an element-type binding globally,
+ or within a content model to either reference a globally-defined
+ element or type or declare an element-type binding locally.
+ The ref form is not allowed at the top level.</xs:documentation>
+ </xs:annotation>
+
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:sequence>
+ <xs:choice minOccurs="0">
+ <xs:element name="simpleType" type="xs:localSimpleType"/>
+ <xs:element name="complexType" type="xs:localComplexType"/>
+ </xs:choice>
+ <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attributeGroup ref="xs:defRef"/>
+ <xs:attribute name="type" type="xs:QName"/>
+ <xs:attribute name="substitutionGroup" type="xs:QName"/>
+ <xs:attributeGroup ref="xs:occurs"/>
+ <xs:attribute name="default" type="xs:string"/>
+ <xs:attribute name="fixed" type="xs:string"/>
+ <xs:attribute name="nillable" type="xs:boolean" use="optional" default="false"/>
+ <xs:attribute name="abstract" type="xs:boolean" use="optional" default="false"/>
+ <xs:attribute name="final" type="xs:derivationSet"/>
+ <xs:attribute name="block" type="xs:blockSet"/>
+ <xs:attribute name="form" type="xs:formChoice"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="topLevelElement">
+ <xs:complexContent>
+ <xs:restriction base="xs:element">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:choice minOccurs="0">
+ <xs:element name="simpleType" type="xs:localSimpleType"/>
+ <xs:element name="complexType" type="xs:localComplexType"/>
+ </xs:choice>
+ <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="ref" use="prohibited"/>
+ <xs:attribute name="form" use="prohibited"/>
+ <xs:attribute name="minOccurs" use="prohibited"/>
+ <xs:attribute name="maxOccurs" use="prohibited"/>
+ <xs:attribute name="name" use="required" type="xs:NCName"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="localElement">
+ <xs:complexContent>
+ <xs:restriction base="xs:element">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:choice minOccurs="0">
+ <xs:element name="simpleType" type="xs:localSimpleType"/>
+ <xs:element name="complexType" type="xs:localComplexType"/>
+ </xs:choice>
+ <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="substitutionGroup" use="prohibited"/>
+ <xs:attribute name="final" use="prohibited"/>
+ <xs:attribute name="abstract" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="element" type="xs:topLevelElement" id="element">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-element"/>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:complexType name="group" abstract="true">
+ <xs:annotation>
+ <xs:documentation>
+ group type for explicit groups, named top-level groups and
+ group references</xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:group ref="xs:particle" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:attributeGroup ref="xs:defRef"/>
+ <xs:attributeGroup ref="xs:occurs"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="realGroup">
+ <xs:complexContent>
+ <xs:restriction base="xs:group">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:choice minOccurs="0" maxOccurs="1">
+ <xs:element ref="xs:all"/>
+ <xs:element ref="xs:choice"/>
+ <xs:element ref="xs:sequence"/>
+ </xs:choice>
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="namedGroup">
+ <xs:complexContent>
+ <xs:restriction base="xs:realGroup">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:choice minOccurs="1" maxOccurs="1">
+ <xs:element name="all">
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:restriction base="xs:all">
+ <xs:group ref="xs:allModel"/>
+ <xs:attribute name="minOccurs" use="prohibited"/>
+ <xs:attribute name="maxOccurs" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="choice" type="xs:simpleExplicitGroup"/>
+ <xs:element name="sequence" type="xs:simpleExplicitGroup"/>
+ </xs:choice>
+ </xs:sequence>
+ <xs:attribute name="name" use="required" type="xs:NCName"/>
+ <xs:attribute name="ref" use="prohibited"/>
+ <xs:attribute name="minOccurs" use="prohibited"/>
+ <xs:attribute name="maxOccurs" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="groupRef">
+ <xs:complexContent>
+ <xs:restriction base="xs:realGroup">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="ref" use="required" type="xs:QName"/>
+ <xs:attribute name="name" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="explicitGroup">
+ <xs:annotation>
+ <xs:documentation>
+ group type for the three kinds of group</xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:restriction base="xs:group">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:group ref="xs:nestedParticle" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:NCName" use="prohibited"/>
+ <xs:attribute name="ref" type="xs:QName" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="simpleExplicitGroup">
+ <xs:complexContent>
+ <xs:restriction base="xs:explicitGroup">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:group ref="xs:nestedParticle" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="minOccurs" use="prohibited"/>
+ <xs:attribute name="maxOccurs" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:group name="allModel">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>This choice with min/max is here to
+ avoid a pblm with the Elt:All/Choice/Seq
+ Particle derivation constraint</xs:documentation>
+ </xs:annotation>
+ <xs:element name="element">
+ <xs:complexType>
+ <xs:annotation>
+ <xs:documentation>restricted max/min</xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:restriction base="xs:localElement">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:choice minOccurs="0">
+ <xs:element name="simpleType" type="xs:localSimpleType"/>
+ <xs:element name="complexType" type="xs:localComplexType"/>
+ </xs:choice>
+ <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="minOccurs" use="optional" default="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:nonNegativeInteger">
+ <xs:enumeration value="0"/>
+ <xs:enumeration value="1"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="maxOccurs" use="optional" default="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:allNNI">
+ <xs:enumeration value="0"/>
+ <xs:enumeration value="1"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ </xs:sequence>
+ </xs:group>
+
+ <xs:complexType name="all">
+ <xs:annotation>
+ <xs:documentation>
+ Only elements allowed inside</xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:restriction base="xs:explicitGroup">
+ <xs:group ref="xs:allModel"/>
+ <xs:attribute name="minOccurs" use="optional" default="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:nonNegativeInteger">
+ <xs:enumeration value="0"/>
+ <xs:enumeration value="1"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="maxOccurs" use="optional" default="1">
+ <xs:simpleType>
+ <xs:restriction base="xs:allNNI">
+ <xs:enumeration value="1"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="all" id="all" type="xs:all">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-all"/>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:element name="choice" type="xs:explicitGroup" id="choice">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-choice"/>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:element name="sequence" type="xs:explicitGroup" id="sequence">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-sequence"/>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:element name="group" type="xs:namedGroup" id="group">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-group"/>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:complexType name="wildcard">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:attribute name="namespace" type="xs:namespaceList" use="optional" default="##any"/>
+ <xs:attribute name="processContents" use="optional" default="strict">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="skip"/>
+ <xs:enumeration value="lax"/>
+ <xs:enumeration value="strict"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="any" id="any">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-any"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:wildcard">
+ <xs:attributeGroup ref="xs:occurs"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:annotation>
+ <xs:documentation>
+ simple type for the value of the 'namespace' attr of
+ 'any' and 'anyAttribute'</xs:documentation>
+ </xs:annotation>
+ <xs:annotation>
+ <xs:documentation>
+ Value is
+ ##any - - any non-conflicting WFXML/attribute at all
+
+ ##other - - any non-conflicting WFXML/attribute from
+ namespace other than targetNS
+
+ ##local - - any unqualified non-conflicting WFXML/attribute
+
+ one or - - any non-conflicting WFXML/attribute from
+ more URI the listed namespaces
+ references
+ (space separated)
+
+ ##targetNamespace or ##local may appear in the above list, to
+ refer to the targetNamespace of the enclosing
+ schema or an absent targetNamespace respectively</xs:documentation>
+ </xs:annotation>
+
+ <xs:simpleType name="namespaceList">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ </xs:annotation>
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="##any"/>
+ <xs:enumeration value="##other"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:list>
+ <xs:simpleType>
+ <xs:union memberTypes="xs:anyURI">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="##targetNamespace"/>
+ <xs:enumeration value="##local"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:list>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+
+ <xs:element name="attribute" type="xs:topLevelAttribute" id="attribute">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-attribute"/>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:complexType name="attributeGroup" abstract="true">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:group ref="xs:attrDecls"/>
+ <xs:attributeGroup ref="xs:defRef"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="namedAttributeGroup">
+ <xs:complexContent>
+ <xs:restriction base="xs:attributeGroup">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:group ref="xs:attrDecls"/>
+ </xs:sequence>
+ <xs:attribute name="name" use="required" type="xs:NCName"/>
+ <xs:attribute name="ref" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="attributeGroupRef">
+ <xs:complexContent>
+ <xs:restriction base="xs:attributeGroup">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="ref" use="required" type="xs:QName"/>
+ <xs:attribute name="name" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="attributeGroup" type="xs:namedAttributeGroup" id="attributeGroup">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-attributeGroup"/>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:element name="include" id="include">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-include"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:attribute name="schemaLocation" type="xs:anyURI" use="required"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="redefine" id="redefine">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-redefine"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:openAttrs">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="xs:annotation"/>
+ <xs:group ref="xs:redefinable"/>
+ </xs:choice>
+ <xs:attribute name="schemaLocation" type="xs:anyURI" use="required"/>
+ <xs:attribute name="id" type="xs:ID"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="import" id="import">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-import"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:attribute name="namespace" type="xs:anyURI"/>
+ <xs:attribute name="schemaLocation" type="xs:anyURI"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="selector" id="selector">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-selector"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:attribute name="xpath" use="required">
+ <xs:simpleType>
+ <xs:annotation>
+ <xs:documentation>A subset of XPath expressions for use
+in selectors</xs:documentation>
+ <xs:documentation>A utility type, not for public
+use</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:token">
+ <xs:annotation>
+ <xs:documentation>The following pattern is intended to allow XPath
+ expressions per the following EBNF:
+ Selector ::= Path ( '|' Path )*
+ Path ::= ('.//')? Step ( '/' Step )*
+ Step ::= '.' | NameTest
+ NameTest ::= QName | '*' | NCName ':' '*'
+ child:: is also allowed
+ </xs:documentation>
+ </xs:annotation>
+ <xs:pattern value="(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)*">
+ </xs:pattern>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="field" id="field">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-field"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:attribute name="xpath" use="required">
+ <xs:simpleType>
+ <xs:annotation>
+ <xs:documentation>A subset of XPath expressions for use
+in fields</xs:documentation>
+ <xs:documentation>A utility type, not for public
+use</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:token">
+ <xs:annotation>
+ <xs:documentation>The following pattern is intended to allow XPath
+ expressions per the same EBNF as for selector,
+ with the following change:
+ Path ::= ('.//')? ( Step '/' )* ( Step | '@' NameTest )
+ </xs:documentation>
+ </xs:annotation>
+ <xs:pattern value="(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*))))(\|(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*)))))*">
+ </xs:pattern>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name="keybase">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:sequence>
+ <xs:element ref="xs:selector"/>
+ <xs:element ref="xs:field" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:NCName" use="required"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:group name="identityConstraint">
+ <xs:annotation>
+ <xs:documentation>The three kinds of identity constraints, all with
+ type of or derived from 'keybase'.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:choice>
+ <xs:element ref="xs:unique"/>
+ <xs:element ref="xs:key"/>
+ <xs:element ref="xs:keyref"/>
+ </xs:choice>
+ </xs:group>
+
+ <xs:element name="unique" type="xs:keybase" id="unique">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-unique"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="key" type="xs:keybase" id="key">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-key"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="keyref" id="keyref">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-keyref"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:keybase">
+ <xs:attribute name="refer" type="xs:QName" use="required"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="notation" id="notation">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-notation"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:attribute name="name" type="xs:NCName" use="required"/>
+ <xs:attribute name="public" type="xs:public" use="required"/>
+ <xs:attribute name="system" type="xs:anyURI"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:simpleType name="public">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ <xs:documentation>
+ A public identifier, per ISO 8879</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:token"/>
+ </xs:simpleType>
+
+ <xs:element name="appinfo" id="appinfo">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-appinfo"/>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:any processContents="lax"/>
+ </xs:sequence>
+ <xs:attribute name="source" type="xs:anyURI"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="documentation" id="documentation">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-documentation"/>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:any processContents="lax"/>
+ </xs:sequence>
+ <xs:attribute name="source" type="xs:anyURI"/>
+ <xs:attribute ref="xml:lang"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="annotation" id="annotation">
+ <xs:annotation>
+ <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-annotation"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="xs:openAttrs">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="xs:appinfo"/>
+ <xs:element ref="xs:documentation"/>
+ </xs:choice>
+ <xs:attribute name="id" type="xs:ID"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:annotation>
+ <xs:documentation>
+ notations for use within XML Schema schemas</xs:documentation>
+ </xs:annotation>
+
+ <xs:notation name="XMLSchemaStructures" public="structures" system="http://www.w3.org/2000/08/XMLSchema.xsd"/>
+ <xs:notation name="XML" public="REC-xml-19980210" system="http://www.w3.org/TR/1998/REC-xml-19980210"/>
+
+ <xs:complexType name="anyType" mixed="true">
+ <xs:annotation>
+ <xs:documentation>
+ Not the real urType, but as close an approximation as we can
+ get in the XML representation</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:any minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:anyAttribute/>
+ </xs:complexType>
+
+ <xs:annotation>
+ <xs:documentation>
+ First the built-in primitive datatypes. These definitions are for
+ information only, the real built-in definitions are magic. Note in
+ particular that there is no type named 'anySimpleType'. The
+ primitives should really be derived from no type at all, and
+ anySimpleType should be derived as a union of all the primitives.
+ </xs:documentation>
+
+ <xs:documentation>
+ For each built-in datatype in this schema (both primitive and
+ derived) can be uniquely addressed via a URI constructed
+ as follows:
+ 1) the base URI is the URI of the XML Schema namespace
+ 2) the fragment identifier is the name of the datatype
+
+ For example, to address the int datatype, the URI is:
+
+ http://www.w3.org/2001/XMLSchema#int
+
+ Additionally, each facet definition element can be uniquely
+ addressed via a URI constructed as follows:
+ 1) the base URI is the URI of the XML Schema namespace
+ 2) the fragment identifier is the name of the facet
+
+ For example, to address the maxInclusive facet, the URI is:
+
+ http://www.w3.org/2001/XMLSchema#maxInclusive
+
+ Additionally, each facet usage in a built-in datatype definition
+ can be uniquely addressed via a URI constructed as follows:
+ 1) the base URI is the URI of the XML Schema namespace
+ 2) the fragment identifier is the name of the datatype, followed
+ by a period (".") followed by the name of the facet
+
+ For example, to address the usage of the maxInclusive facet in
+ the definition of int, the URI is:
+
+ http://www.w3.org/2001/XMLSchema#int.maxInclusive
+
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:simpleType name="string" id="string">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="length"/>
+ <hfp:hasFacet name="minLength"/>
+ <hfp:hasFacet name="maxLength"/>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#string"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="preserve" id="string.preserve"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="boolean" id="boolean">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality" value="finite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#boolean"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="collapse" fixed="true"
+ id="boolean.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="float" id="float">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="total"/>
+ <hfp:hasProperty name="bounded" value="true"/>
+ <hfp:hasProperty name="cardinality" value="finite"/>
+ <hfp:hasProperty name="numeric" value="true"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#float"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="collapse" fixed="true"
+ id="float.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="double" id="double">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="total"/>
+ <hfp:hasProperty name="bounded" value="true"/>
+ <hfp:hasProperty name="cardinality" value="finite"/>
+ <hfp:hasProperty name="numeric" value="true"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#double"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="collapse" fixed="true"
+ id="double.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="decimal" id="decimal">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="totalDigits"/>
+ <hfp:hasFacet name="fractionDigits"/>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="total"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality"
+ value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="true"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#decimal"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="collapse" fixed="true"
+ id="decimal.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="duration" id="duration">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality"
+ value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#duration"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="collapse" fixed="true"
+ id="duration.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="dateTime" id="dateTime">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality"
+ value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#dateTime"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="collapse" fixed="true"
+ id="dateTime.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="time" id="time">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality"
+ value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#time"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="collapse" fixed="true"
+ id="time.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="date" id="date">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality"
+ value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#date"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="collapse" fixed="true"
+ id="date.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="gYearMonth" id="gYearMonth">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality"
+ value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#gYearMonth"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="collapse" fixed="true"
+ id="gYearMonth.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="gYear" id="gYear">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality"
+ value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#gYear"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="collapse" fixed="true"
+ id="gYear.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="gMonthDay" id="gMonthDay">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality"
+ value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#gMonthDay"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="collapse" fixed="true"
+ id="gMonthDay.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="gDay" id="gDay">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality"
+ value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#gDay"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="collapse" fixed="true"
+ id="gDay.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="gMonth" id="gMonth">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasFacet name="maxInclusive"/>
+ <hfp:hasFacet name="maxExclusive"/>
+ <hfp:hasFacet name="minInclusive"/>
+ <hfp:hasFacet name="minExclusive"/>
+ <hfp:hasProperty name="ordered" value="partial"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality"
+ value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#gMonth"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="collapse" fixed="true"
+ id="gMonth.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="hexBinary" id="hexBinary">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="length"/>
+ <hfp:hasFacet name="minLength"/>
+ <hfp:hasFacet name="maxLength"/>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality"
+ value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#binary"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="collapse" fixed="true"
+ id="hexBinary.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="base64Binary" id="base64Binary">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="length"/>
+ <hfp:hasFacet name="minLength"/>
+ <hfp:hasFacet name="maxLength"/>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality"
+ value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#base64Binary"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="collapse" fixed="true"
+ id="base64Binary.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="anyURI" id="anyURI">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="length"/>
+ <hfp:hasFacet name="minLength"/>
+ <hfp:hasFacet name="maxLength"/>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality"
+ value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#anyURI"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="collapse" fixed="true"
+ id="anyURI.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="QName" id="QName">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="length"/>
+ <hfp:hasFacet name="minLength"/>
+ <hfp:hasFacet name="maxLength"/>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality"
+ value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#QName"/>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="collapse" fixed="true"
+ id="QName.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="NOTATION" id="NOTATION">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="length"/>
+ <hfp:hasFacet name="minLength"/>
+ <hfp:hasFacet name="maxLength"/>
+ <hfp:hasFacet name="pattern"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality"
+ value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#NOTATION"/>
+ <xs:documentation>
+ NOTATION cannot be used directly in a schema; rather a type
+ must be derived from it by specifying at least one enumeration
+ facet whose value is the name of a NOTATION declared in the
+ schema.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:anySimpleType">
+ <xs:whiteSpace value="collapse" fixed="true"
+ id="NOTATION.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:annotation>
+ <xs:documentation>
+ Now the derived primitive types
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:simpleType name="normalizedString" id="normalizedString">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#normalizedString"/>
+ </xs:annotation>
+ <xs:restriction base="xs:string">
+ <xs:whiteSpace value="replace"
+ id="normalizedString.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="token" id="token">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#token"/>
+ </xs:annotation>
+ <xs:restriction base="xs:normalizedString">
+ <xs:whiteSpace value="collapse" id="token.whiteSpace"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="language" id="language">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#language"/>
+ </xs:annotation>
+ <xs:restriction base="xs:token">
+ <xs:pattern
+ value="([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{1,8})*"
+ id="language.pattern">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/REC-xml#NT-LanguageID">
+ pattern specifies the content of section 2.12 of XML 1.0e2
+ and RFC 1766
+ </xs:documentation>
+ </xs:annotation>
+ </xs:pattern>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="IDREFS" id="IDREFS">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="length"/>
+ <hfp:hasFacet name="minLength"/>
+ <hfp:hasFacet name="maxLength"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality"
+ value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#IDREFS"/>
+ </xs:annotation>
+ <xs:restriction>
+ <xs:simpleType>
+ <xs:list itemType="xs:IDREF"/>
+ </xs:simpleType>
+ <xs:minLength value="1" id="IDREFS.minLength"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="ENTITIES" id="ENTITIES">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="length"/>
+ <hfp:hasFacet name="minLength"/>
+ <hfp:hasFacet name="maxLength"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality"
+ value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#ENTITIES"/>
+ </xs:annotation>
+ <xs:restriction>
+ <xs:simpleType>
+ <xs:list itemType="xs:ENTITY"/>
+ </xs:simpleType>
+ <xs:minLength value="1" id="ENTITIES.minLength"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="NMTOKEN" id="NMTOKEN">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#NMTOKEN"/>
+ </xs:annotation>
+ <xs:restriction base="xs:token">
+ <xs:pattern value="\c+" id="NMTOKEN.pattern">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/REC-xml#NT-Nmtoken">
+ pattern matches production 7 from the XML spec
+ </xs:documentation>
+ </xs:annotation>
+ </xs:pattern>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="NMTOKENS" id="NMTOKENS">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasFacet name="length"/>
+ <hfp:hasFacet name="minLength"/>
+ <hfp:hasFacet name="maxLength"/>
+ <hfp:hasFacet name="enumeration"/>
+ <hfp:hasFacet name="whiteSpace"/>
+ <hfp:hasProperty name="ordered" value="false"/>
+ <hfp:hasProperty name="bounded" value="false"/>
+ <hfp:hasProperty name="cardinality"
+ value="countably infinite"/>
+ <hfp:hasProperty name="numeric" value="false"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#NMTOKENS"/>
+ </xs:annotation>
+ <xs:restriction>
+ <xs:simpleType>
+ <xs:list itemType="xs:NMTOKEN"/>
+ </xs:simpleType>
+ <xs:minLength value="1" id="NMTOKENS.minLength"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="Name" id="Name">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#Name"/>
+ </xs:annotation>
+ <xs:restriction base="xs:token">
+ <xs:pattern value="\i\c*" id="Name.pattern">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/REC-xml#NT-Name">
+ pattern matches production 5 from the XML spec
+ </xs:documentation>
+ </xs:annotation>
+ </xs:pattern>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="NCName" id="NCName">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#NCName"/>
+ </xs:annotation>
+ <xs:restriction base="xs:Name">
+ <xs:pattern value="[\i-[:]][\c-[:]]*" id="NCName.pattern">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/REC-xml-names/#NT-NCName">
+ pattern matches production 4 from the Namespaces in XML spec
+ </xs:documentation>
+ </xs:annotation>
+ </xs:pattern>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="ID" id="ID">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#ID"/>
+ </xs:annotation>
+ <xs:restriction base="xs:NCName"/>
+ </xs:simpleType>
+
+ <xs:simpleType name="IDREF" id="IDREF">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#IDREF"/>
+ </xs:annotation>
+ <xs:restriction base="xs:NCName"/>
+ </xs:simpleType>
+
+ <xs:simpleType name="ENTITY" id="ENTITY">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#ENTITY"/>
+ </xs:annotation>
+ <xs:restriction base="xs:NCName"/>
+ </xs:simpleType>
+
+ <xs:simpleType name="integer" id="integer">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#integer"/>
+ </xs:annotation>
+ <xs:restriction base="xs:decimal">
+ <xs:fractionDigits value="0" fixed="true" id="integer.fractionDigits"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="nonPositiveInteger" id="nonPositiveInteger">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#nonPositiveInteger"/>
+ </xs:annotation>
+ <xs:restriction base="xs:integer">
+ <xs:maxInclusive value="0" id="nonPositiveInteger.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="negativeInteger" id="negativeInteger">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#negativeInteger"/>
+ </xs:annotation>
+ <xs:restriction base="xs:nonPositiveInteger">
+ <xs:maxInclusive value="-1" id="negativeInteger.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="long" id="long">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasProperty name="bounded" value="true"/>
+ <hfp:hasProperty name="cardinality" value="finite"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#long"/>
+ </xs:annotation>
+ <xs:restriction base="xs:integer">
+ <xs:minInclusive value="-9223372036854775808" id="long.minInclusive"/>
+ <xs:maxInclusive value="9223372036854775807" id="long.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="int" id="int">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#int"/>
+ </xs:annotation>
+ <xs:restriction base="xs:long">
+ <xs:minInclusive value="-2147483648" id="int.minInclusive"/>
+ <xs:maxInclusive value="2147483647" id="int.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="short" id="short">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#short"/>
+ </xs:annotation>
+ <xs:restriction base="xs:int">
+ <xs:minInclusive value="-32768" id="short.minInclusive"/>
+ <xs:maxInclusive value="32767" id="short.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="byte" id="byte">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#byte"/>
+ </xs:annotation>
+ <xs:restriction base="xs:short">
+ <xs:minInclusive value="-128" id="byte.minInclusive"/>
+ <xs:maxInclusive value="127" id="byte.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="nonNegativeInteger" id="nonNegativeInteger">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger"/>
+ </xs:annotation>
+ <xs:restriction base="xs:integer">
+ <xs:minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="unsignedLong" id="unsignedLong">
+ <xs:annotation>
+ <xs:appinfo>
+ <hfp:hasProperty name="bounded" value="true"/>
+ <hfp:hasProperty name="cardinality" value="finite"/>
+ </xs:appinfo>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#unsignedLong"/>
+ </xs:annotation>
+ <xs:restriction base="xs:nonNegativeInteger">
+ <xs:maxInclusive value="18446744073709551615"
+ id="unsignedLong.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="unsignedInt" id="unsignedInt">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#unsignedInt"/>
+ </xs:annotation>
+ <xs:restriction base="xs:unsignedLong">
+ <xs:maxInclusive value="4294967295"
+ id="unsignedInt.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="unsignedShort" id="unsignedShort">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#unsignedShort"/>
+ </xs:annotation>
+ <xs:restriction base="xs:unsignedInt">
+ <xs:maxInclusive value="65535"
+ id="unsignedShort.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="unsignedByte" id="unsignedByte">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#unsignedByte"/>
+ </xs:annotation>
+ <xs:restriction base="xs:unsignedShort">
+ <xs:maxInclusive value="255" id="unsignedByte.maxInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="positiveInteger" id="positiveInteger">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#positiveInteger"/>
+ </xs:annotation>
+ <xs:restriction base="xs:nonNegativeInteger">
+ <xs:minInclusive value="1" id="positiveInteger.minInclusive"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="derivationControl">
+ <xs:annotation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="substitution"/>
+ <xs:enumeration value="extension"/>
+ <xs:enumeration value="restriction"/>
+ <xs:enumeration value="list"/>
+ <xs:enumeration value="union"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:group name="simpleDerivation">
+ <xs:choice>
+ <xs:element ref="xs:restriction"/>
+ <xs:element ref="xs:list"/>
+ <xs:element ref="xs:union"/>
+ </xs:choice>
+ </xs:group>
+
+ <xs:simpleType name="simpleDerivationSet">
+ <xs:annotation>
+ <xs:documentation>
+ #all or (possibly empty) subset of {restriction, union, list}
+ </xs:documentation>
+ <xs:documentation>
+ A utility type, not for public use</xs:documentation>
+ </xs:annotation>
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="#all"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:restriction base="xs:derivationControl">
+ <xs:enumeration value="list"/>
+ <xs:enumeration value="union"/>
+ <xs:enumeration value="restriction"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+
+ <xs:complexType name="simpleType" abstract="true">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:group ref="xs:simpleDerivation"/>
+ <xs:attribute name="final" type="xs:simpleDerivationSet"/>
+ <xs:attribute name="name" type="xs:NCName">
+ <xs:annotation>
+ <xs:documentation>
+ Can be restricted to required or forbidden
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="topLevelSimpleType">
+ <xs:complexContent>
+ <xs:restriction base="xs:simpleType">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:group ref="xs:simpleDerivation"/>
+ </xs:sequence>
+ <xs:attribute name="name" use="required"
+ type="xs:NCName">
+ <xs:annotation>
+ <xs:documentation>
+ Required at the top level
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="localSimpleType">
+ <xs:complexContent>
+ <xs:restriction base="xs:simpleType">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ <xs:group ref="xs:simpleDerivation"/>
+ </xs:sequence>
+ <xs:attribute name="name" use="prohibited">
+ <xs:annotation>
+ <xs:documentation>
+ Forbidden when nested
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="final" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="simpleType" type="xs:topLevelSimpleType" id="simpleType">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-simpleType"/>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:group name="facets">
+ <xs:annotation>
+ <xs:documentation>
+ We should use a substitution group for facets, but
+ that's ruled out because it would allow users to
+ add their own, which we're not ready for yet.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:choice>
+ <xs:element ref="xs:minExclusive"/>
+ <xs:element ref="xs:minInclusive"/>
+ <xs:element ref="xs:maxExclusive"/>
+ <xs:element ref="xs:maxInclusive"/>
+ <xs:element ref="xs:totalDigits"/>
+ <xs:element ref="xs:fractionDigits"/>
+ <xs:element ref="xs:length"/>
+ <xs:element ref="xs:minLength"/>
+ <xs:element ref="xs:maxLength"/>
+ <xs:element ref="xs:enumeration"/>
+ <xs:element ref="xs:whiteSpace"/>
+ <xs:element ref="xs:pattern"/>
+ </xs:choice>
+ </xs:group>
+
+ <xs:group name="simpleRestrictionModel">
+ <xs:sequence>
+ <xs:element name="simpleType" type="xs:localSimpleType" minOccurs="0"/>
+ <xs:group ref="xs:facets" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:group>
+
+ <xs:element name="restriction" id="restriction">
+ <xs:complexType>
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-restriction">
+ base attribute and simpleType child are mutually
+ exclusive, but one or other is required
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:group ref="xs:simpleRestrictionModel"/>
+ <xs:attribute name="base" type="xs:QName" use="optional"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="list" id="list">
+ <xs:complexType>
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-list">
+ itemType attribute and simpleType child are mutually
+ exclusive, but one or other is required
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:sequence>
+ <xs:element name="simpleType" type="xs:localSimpleType"
+ minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="itemType" type="xs:QName" use="optional"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="union" id="union">
+ <xs:complexType>
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-union">
+ memberTypes attribute must be non-empty or there must be
+ at least one simpleType child
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:sequence>
+ <xs:element name="simpleType" type="xs:localSimpleType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="memberTypes" use="optional">
+ <xs:simpleType>
+ <xs:list itemType="xs:QName"/>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name="facet">
+ <xs:complexContent>
+ <xs:extension base="xs:annotated">
+ <xs:attribute name="value" use="required"/>
+ <xs:attribute name="fixed" type="xs:boolean" use="optional"
+ default="false"/>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="noFixedFacet">
+ <xs:complexContent>
+ <xs:restriction base="xs:facet">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="fixed" use="prohibited"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="minExclusive" id="minExclusive" type="xs:facet">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-minExclusive"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="minInclusive" id="minInclusive" type="xs:facet">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-minInclusive"/>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:element name="maxExclusive" id="maxExclusive" type="xs:facet">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-maxExclusive"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="maxInclusive" id="maxInclusive" type="xs:facet">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-maxInclusive"/>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:complexType name="numFacet">
+ <xs:complexContent>
+ <xs:restriction base="xs:facet">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="value" type="xs:nonNegativeInteger" use="required"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="totalDigits" id="totalDigits">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-totalDigits"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:restriction base="xs:numFacet">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="value" type="xs:positiveInteger" use="required"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="fractionDigits" id="fractionDigits" type="xs:numFacet">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-fractionDigits"/>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:element name="length" id="length" type="xs:numFacet">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-length"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="minLength" id="minLength" type="xs:numFacet">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-minLength"/>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="maxLength" id="maxLength" type="xs:numFacet">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-maxLength"/>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:element name="enumeration" id="enumeration" type="xs:noFixedFacet">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-enumeration"/>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:element name="whiteSpace" id="whiteSpace">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-whiteSpace"/>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:restriction base="xs:facet">
+ <xs:sequence>
+ <xs:element ref="xs:annotation" minOccurs="0"/>
+ </xs:sequence>
+ <xs:attribute name="value" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:NMTOKEN">
+ <xs:enumeration value="preserve"/>
+ <xs:enumeration value="replace"/>
+ <xs:enumeration value="collapse"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:restriction>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="pattern" id="pattern" type="xs:noFixedFacet">
+ <xs:annotation>
+ <xs:documentation
+ source="http://www.w3.org/TR/xmlschema-2/#element-pattern"/>
+ </xs:annotation>
+ </xs:element>
+
+</xs:schema>
diff --git a/spec/xs3p/examples/address.xsd b/spec/xs3p/examples/address.xsd
new file mode 100644
index 00000000..61456139
--- /dev/null
+++ b/spec/xs3p/examples/address.xsd
@@ -0,0 +1,55 @@
+<schema targetNamespace="http://www.example.com/IPO"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ipo="http://www.example.com/IPO">
+
+ <annotation>
+ <documentation xml:lang="en">
+ Addresses for International Purchase order schema
+ Copyright 2000 Example.com. All rights reserved.
+ </documentation>
+ </annotation>
+
+ <complexType name="Address">
+ <sequence>
+ <element name="name" type="string"/>
+ <element name="street" type="string"/>
+ <element name="city" type="string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="USAddress">
+ <complexContent>
+ <extension base="ipo:Address">
+ <sequence>
+ <element name="state" type="ipo:USState"/>
+ <element name="zip" type="positiveInteger"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="UKAddress">
+ <complexContent>
+ <extension base="ipo:Address">
+ <sequence>
+ <element name="postcode" type="ipo:UKPostcode"/>
+ </sequence>
+ <attribute name="exportCode" type="positiveInteger" fixed="1"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- other Address derivations for more countries -->
+
+ <simpleType name="USState">
+ <restriction base="string">
+ <enumeration value="AK"/>
+ <enumeration value="AL"/>
+ <enumeration value="AR"/>
+ <!-- and so on ... -->
+ </restriction>
+ </simpleType>
+
+ <!-- simple type definition for UKPostcode -->
+
+</schema> \ No newline at end of file
diff --git a/spec/xs3p/examples/build.xml b/spec/xs3p/examples/build.xml
new file mode 100644
index 00000000..8b4a4e57
--- /dev/null
+++ b/spec/xs3p/examples/build.xml
@@ -0,0 +1,40 @@
+<project name="TestAnt" default="all" basedir=".">
+ <description>Script to generate documentation for example schema files using Ant.</description>
+
+ <property name="original-loc" value=".."/>
+ <property name="xslt-file" value="xs3p.xsl"/>
+ <property name="target-dir" value="ant-results"/>
+
+ <target name="all" description="Generates documentation for all *.xsd files.">
+ <xslt basedir="." destdir="${target-dir}"
+ extension=".html" style="${original-loc}/${xslt-file}">
+ <include name="*.xsd"/>
+ </xslt>
+ </target>
+
+ <target name="test-external-links" description="Test linking between schema files.">
+ <!-- Copy xslt file to local dir. -->
+ <copy file="${original-loc}/${xslt-file}" todir="${basedir}"/>
+ <!-- address.xsd -->
+ <xslt in="address.xsd" out="${target-dir}/address.xsd.html" style="${xslt-file}">
+ <param name="searchImportedSchemas" expression="true"/>
+ <param name="searchIncludedSchemas" expression="true"/>
+ <param name="linksFile" expression="links.xml"/>
+ </xslt>
+ <!-- ipo.xsd -->
+ <xslt in="ipo.xsd" out="${target-dir}/ipo.xsd.html" style="${xslt-file}">
+ <param name="searchImportedSchemas" expression="true"/>
+ <param name="searchIncludedSchemas" expression="true"/>
+ <param name="linksFile" expression="links.xml"/>
+ </xslt>
+ <!-- report.xsd -->
+ <xslt in="report.xsd" out="${target-dir}/report.xsd.html" style="${xslt-file}">
+ <param name="searchImportedSchemas" expression="true"/>
+ <param name="searchIncludedSchemas" expression="true"/>
+ <param name="linksFile" expression="links.xml"/>
+ </xslt>
+ <!-- Delete local copy of xslt file. -->
+ <delete file="${basedir}/${xslt-file}"/>
+ </target>
+
+</project>
diff --git a/spec/xs3p/examples/ipo.xsd b/spec/xs3p/examples/ipo.xsd
new file mode 100644
index 00000000..419416ea
--- /dev/null
+++ b/spec/xs3p/examples/ipo.xsd
@@ -0,0 +1,59 @@
+<schema targetNamespace="http://www.example.com/IPO"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ipo="http://www.example.com/IPO">
+
+ <annotation>
+ <documentation xml:lang="en">
+ International Purchase order schema for Example.com
+ Copyright 2000 Example.com. All rights reserved.
+ </documentation>
+ </annotation>
+
+ <!-- include address constructs -->
+ <include
+ schemaLocation="address.xsd"/>
+
+ <element name="purchaseOrder" type="ipo:PurchaseOrderType"/>
+
+ <element name="comment" type="string"/>
+
+ <complexType name="PurchaseOrderType">
+ <sequence>
+ <element name="shipTo" type="ipo:Address"/>
+ <element name="billTo" type="ipo:Address"/>
+ <element ref="ipo:comment" minOccurs="0"/>
+ <element name="items" type="ipo:Items"/>
+ </sequence>
+ <attribute name="orderDate" type="date"/>
+ </complexType>
+
+ <complexType name="Items">
+ <sequence>
+ <element name="item" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <sequence>
+ <element name="productName" type="string"/>
+ <element name="quantity">
+ <simpleType>
+ <restriction base="positiveInteger">
+ <maxExclusive value="100"/>
+ </restriction>
+ </simpleType>
+ </element>
+ <element name="USPrice" type="decimal"/>
+ <element ref="ipo:comment" minOccurs="0"/>
+ <element name="shipDate" type="date" minOccurs="0"/>
+ </sequence>
+ <attribute name="partNum" type="ipo:SKU" use="required"/>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+
+ <simpleType name="SKU">
+ <restriction base="string">
+ <pattern value="\d{3}-[A-Z]{2}"/>
+ </restriction>
+ </simpleType>
+
+</schema> \ No newline at end of file
diff --git a/spec/xs3p/examples/links.xml b/spec/xs3p/examples/links.xml
new file mode 100644
index 00000000..5bea6b8c
--- /dev/null
+++ b/spec/xs3p/examples/links.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<links xmlns="http://titanium.dstc.edu.au/xml/xs3p">
+ <schema file-location="address.xsd" docfile-location="address.xsd.html"/>
+ <schema file-location="ipo.xsd" docfile-location="ipo.xsd.html"/>
+ <schema file-location="report.xsd" docfile-location="report.xsd.html"/>
+</links> \ No newline at end of file
diff --git a/spec/xs3p/examples/po.xsd b/spec/xs3p/examples/po.xsd
new file mode 100644
index 00000000..65ed8616
--- /dev/null
+++ b/spec/xs3p/examples/po.xsd
@@ -0,0 +1,66 @@
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Purchase order schema for Example.com.
+ Copyright 2000 Example.com. All rights reserved.
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
+
+ <xsd:element name="comment" type="xsd:string"/>
+
+ <xsd:complexType name="PurchaseOrderType">
+ <xsd:sequence>
+ <xsd:element name="shipTo" type="USAddress"/>
+ <xsd:element name="billTo" type="USAddress"/>
+ <xsd:element ref="comment" minOccurs="0"/>
+ <xsd:element name="items" type="Items"/>
+ </xsd:sequence>
+ <xsd:attribute name="orderDate" type="xsd:date"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="USAddress">
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="street" type="xsd:string"/>
+ <xsd:element name="city" type="xsd:string"/>
+ <xsd:element name="state" type="xsd:string"/>
+ <xsd:element name="zip" type="xsd:decimal"/>
+ </xsd:sequence>
+ <xsd:attribute name="country" type="xsd:NMTOKEN"
+ fixed="US"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="Items">
+ <xsd:sequence>
+ <xsd:element name="item" minOccurs="0" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="productName" type="xsd:string"/>
+ <xsd:element name="quantity">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:positiveInteger">
+ <xsd:maxExclusive value="100"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:element>
+ <xsd:element name="USPrice" type="xsd:decimal"/>
+ <xsd:element ref="comment" minOccurs="0"/>
+ <xsd:element name="shipDate" type="xsd:date" minOccurs="0"/>
+ </xsd:sequence>
+ <xsd:attribute name="partNum" type="SKU" use="required"/>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <!-- Stock Keeping Unit, a code for identifying products -->
+ <xsd:simpleType name="SKU">
+ <xsd:restriction base="xsd:string">
+ <xsd:pattern value="\d{3}-[A-Z]{2}"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+</xsd:schema> \ No newline at end of file
diff --git a/spec/xs3p/examples/recursion.xsd b/spec/xs3p/examples/recursion.xsd
new file mode 100644
index 00000000..cbe14b36
--- /dev/null
+++ b/spec/xs3p/examples/recursion.xsd
@@ -0,0 +1,85 @@
+<?xml version="1.0"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://example.com" targetNamespace="http://example.com">
+ <xsd:element name="x">
+ <xsd:simpleType>
+ <xsd:restriction base="X">
+ <xsd:enumeration value="abc"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:element>
+ <xsd:simpleType name="X">
+ <xsd:restriction base="Z">
+ <xsd:enumeration value="abc"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ <xsd:simpleType name="Y">
+ <xsd:restriction base="X">
+ <xsd:enumeration value="abc"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ <xsd:simpleType name="Z">
+ <xsd:restriction base="Y">
+ <xsd:enumeration value="abc"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:complexType name="A">
+ <xsd:complexContent>
+ <xsd:extension base="C">
+ <xsd:sequence>
+ <xsd:element name="a" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:complexType name="B">
+ <xsd:complexContent>
+ <xsd:extension base="A">
+ <xsd:sequence>
+ <xsd:element name="b" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:complexType name="C">
+ <xsd:complexContent>
+ <xsd:extension base="B">
+ <xsd:sequence>
+ <xsd:element name="c" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:group name="A">
+ <xsd:sequence>
+ <xsd:group ref="C"/>
+ <xsd:element name="a" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:group>
+ <xsd:group name="B">
+ <xsd:sequence>
+ <xsd:group ref="A"/>
+ <xsd:element name="b" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:group>
+ <xsd:group name="C">
+ <xsd:sequence>
+ <xsd:group ref="B"/>
+ <xsd:element name="c" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:group>
+
+ <xsd:attributeGroup name="A">
+ <xsd:attributeGroup ref="C"/>
+ <xsd:attribute name="a" type="xsd:string"/>
+ </xsd:attributeGroup>
+ <xsd:attributeGroup name="B">
+ <xsd:attributeGroup ref="A"/>
+ <xsd:attribute name="b" type="xsd:string"/>
+ </xsd:attributeGroup>
+ <xsd:attributeGroup name="C">
+ <xsd:attributeGroup ref="B"/>
+ <xsd:attribute name="c" type="xsd:string"/>
+ </xsd:attributeGroup>
+</xsd:schema> \ No newline at end of file
diff --git a/spec/xs3p/examples/report.xsd b/spec/xs3p/examples/report.xsd
new file mode 100644
index 00000000..9cc6cca2
--- /dev/null
+++ b/spec/xs3p/examples/report.xsd
@@ -0,0 +1,84 @@
+<?xml version="1.0"?>
+<schema targetNamespace="http://www.example.com/Report" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:r="http://www.example.com/Report" xmlns:xipo="http://www.example.com/IPO" elementFormDefault="qualified">
+ <!-- for SKU -->
+ <import namespace="http://www.example.com/IPO" schemaLocation="ipo.xsd"/>
+
+ <annotation>
+ <documentation xml:lang="en">Report schema for Example.com
+ Copyright 2000 Example.com. All rights reserved.</documentation>
+ </annotation>
+
+ <element name="purchaseReport">
+ <complexType>
+ <sequence>
+ <element name="regions" type="r:RegionsType">
+ <keyref name="dummy2" refer="r:pNumKey">
+ <selector xpath="r:zip/r:part"/>
+ <field xpath="@number"/>
+ </keyref>
+ </element>
+ <element name="parts" type="r:PartsType"/>
+ <element ref="xipo:comment"/>
+ </sequence>
+ <attribute name="period" type="duration"/>
+ <attribute name="periodEnding" type="date"/>
+ </complexType>
+
+ <unique name="dummy1">
+ <selector xpath="r:regions/r:zip"/>
+ <field xpath="@code"/>
+ </unique>
+
+ <key name="pNumKey">
+ <selector xpath="r:parts/r:part"/>
+ <field xpath="@number"/>
+ </key>
+ </element>
+
+ <complexType name="RegionsType">
+ <sequence>
+ <element name="zip" maxOccurs="unbounded">
+ <complexType>
+ <sequence>
+ <element name="part" maxOccurs="unbounded">
+ <complexType>
+ <complexContent>
+ <restriction base="anyType">
+ <attribute name="number" type="xipo:SKU"/>
+ <attribute name="quantity" type="positiveInteger"/>
+ </restriction>
+ </complexContent>
+ </complexType>
+ </element>
+ </sequence>
+ <attribute name="code" type="positiveInteger"/>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+
+ <complexType name="PartsType">
+ <sequence>
+ <element name="part" maxOccurs="unbounded">
+ <complexType>
+ <simpleContent>
+ <extension base="string">
+ <attribute name="number" type="xipo:SKU"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+
+ <complexType name="ExtendedPurchaseOrderType">
+ <complexContent>
+ <extension base="xipo:PurchaseOrderType">
+ <sequence>
+ <element name="shipper" type="xipo:Address"/>
+ </sequence>
+ <attribute name="shipToDate" type="date"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema> \ No newline at end of file
diff --git a/spec/xs3p/examples/test_msxsl.bat b/spec/xs3p/examples/test_msxsl.bat
new file mode 100644
index 00000000..70f847cc
--- /dev/null
+++ b/spec/xs3p/examples/test_msxsl.bat
@@ -0,0 +1,19 @@
+set RESULTS_DIR=msxsl-results
+set LINKS_FILE=links.xml
+set XSLT_FILE=xs3p.xsl
+set ORIGINAL_XSLT_FILE=..\%XSLT_FILE%
+rem Copy XSLT file to local directory
+copy %ORIGINAL_XSLT_FILE% .
+rem Create results directory
+if not exist %RESULTS_DIR% mkdir %RESULTS_DIR%
+rem Loop through schema files
+for %%f in (*.xsd) do msxsl %%f %XSLT_FILE% -t -o %RESULTS_DIR%\%%f.html
+rem Test external links
+rem set XSD_FILE=address.xsd
+rem msxsl %XSD_FILE% %XSLT_FILE% -t -o %RESULTS_DIR%\%XSD_FILE%.html searchImportedSchemas=true searchIncludedSchemas=true linksFile=%LINKS_FILE%
+rem set XSD_FILE=ipo.xsd
+rem msxsl %XSD_FILE% %XSLT_FILE% -t -o %RESULTS_DIR%\%XSD_FILE%.html searchImportedSchemas=true searchIncludedSchemas=true linksFile=%LINKS_FILE%
+rem set XSD_FILE=report.xsd
+rem msxsl %XSD_FILE% %XSLT_FILE% -t -o %RESULTS_DIR%\%XSD_FILE%.html searchImportedSchemas=true searchIncludedSchemas=true linksFile=%LINKS_FILE%
+rem Delete local copy of stylesheet
+del %XSLT_FILE%
diff --git a/spec/xs3p/examples/test_xalanj.bat b/spec/xs3p/examples/test_xalanj.bat
new file mode 100644
index 00000000..3a3f0769
--- /dev/null
+++ b/spec/xs3p/examples/test_xalanj.bat
@@ -0,0 +1,19 @@
+set RESULTS_DIR=xalanj-results
+set LINKS_FILE=links.xml
+set XSLT_FILE=xs3p.xsl
+set ORIGINAL_XSLT_FILE=..\%XSLT_FILE%
+rem Copy XSLT file to local directory
+copy %ORIGINAL_XSLT_FILE% .
+rem Create results directory
+if not exist %RESULTS_DIR% mkdir %RESULTS_DIR%
+rem Loop through schema files
+for %%f in (*.xsd) do java org.apache.xalan.xslt.Process -IN %%f -XSL %XSLT_FILE% -OUT %RESULTS_DIR%\%%f.html
+rem Test external links
+rem set XSD_FILE=address.xsd
+rem java org.apache.xalan.xslt.Process -IN %XSD_FILE% -XSL %XSLT_FILE% -OUT %RESULTS_DIR%\%XSD_FILE%.html -PARAM searchImportedSchemas true -PARAM searchIncludedSchemas true -PARAM linksFile %LINKS_FILE%
+rem set XSD_FILE=ipo.xsd
+rem java org.apache.xalan.xslt.Process -IN %XSD_FILE% -XSL %XSLT_FILE% -OUT %RESULTS_DIR%\%XSD_FILE%.html -PARAM searchImportedSchemas true -PARAM searchIncludedSchemas true -PARAM linksFile %LINKS_FILE%
+rem set XSD_FILE=report.xsd
+rem java org.apache.xalan.xslt.Process -IN %XSD_FILE% -XSL %XSLT_FILE% -OUT %RESULTS_DIR%\%XSD_FILE%.html -PARAM searchImportedSchemas true -PARAM searchIncludedSchemas true -PARAM linksFile %LINKS_FILE%
+rem Delete local copy of stylesheet
+del %XSLT_FILE%
diff --git a/spec/xs3p/examples/test_xsltproc.sh b/spec/xs3p/examples/test_xsltproc.sh
new file mode 100644
index 00000000..f2e3120a
--- /dev/null
+++ b/spec/xs3p/examples/test_xsltproc.sh
@@ -0,0 +1,30 @@
+#!bin/bash
+RESULTS_DIR=xsltproc-results
+LINKS_FILE=links.xml
+XSLT_FILE=xs3p.xsl
+ORIGINAL_XSLT_FILE=../$XSLT_FILE
+# Copy XSLT file to local directory
+cp $ORIGINAL_XSLT_FILE .
+# Create results directory
+if [ ! -d $RESULTS_DIR ] ;
+then
+ mkdir $RESULTS_DIR
+fi
+# Loop through schema files
+for f in *.xsd
+do
+ echo "Generating documentation for: $f"
+ xsltproc --nonet --output $RESULTS_DIR/$f.html $XSLT_FILE $f
+done
+# Test external links
+# XSD_FILE=address.xsd
+# echo "Generating documentation for: $XSD_FILE"
+# xsltproc --nonet --output $RESULTS_DIR/$XSD_FILE.html $XSLT_FILE $XSD_FILE
+# XSD_FILE=ipo.xsd
+# echo "Generating documentation for: $XSD_FILE"
+# xsltproc --param searchIncludedSchemas "'true'" --param linksFile "'links.xml'" --nonet --output $RESULTS_DIR/$XSD_FILE.html $XSLT_FILE $XSD_FILE
+# XSD_FILE=report.xsd
+# echo "Generating documentation for: $XSD_FILE"
+# xsltproc --param searchIncludedSchemas "'true'" --param linksFile "'links.xml'" --nonet --output $RESULTS_DIR/$XSD_FILE.html $XSLT_FILE $XSD_FILE
+# Delete local copy of stylesheet
+rm $XSLT_FILE
diff --git a/spec/xs3p/examples/xml.xsd b/spec/xs3p/examples/xml.xsd
new file mode 100644
index 00000000..8e4d6665
--- /dev/null
+++ b/spec/xs3p/examples/xml.xsd
@@ -0,0 +1,80 @@
+<?xml version='1.0'?>
+<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en">
+
+ <xs:annotation>
+ <xs:documentation>
+ See http://www.w3.org/XML/1998/namespace.html and
+ http://www.w3.org/TR/REC-xml for information about this namespace.
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+ <xs:documentation>This schema defines attributes and an attribute group
+ suitable for use by
+ schemas wishing to allow xml:base, xml:lang or xml:space attributes
+ on elements they define.
+
+ To enable this, such a schema must import this schema
+ for the XML namespace, e.g. as follows:
+ &lt;schema . . .>
+ . . .
+ &lt;import namespace="http://www.w3.org/XML/1998/namespace"
+ schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
+
+ Subsequently, qualified reference to any of the attributes
+ or the group defined below will have the desired effect, e.g.
+
+ &lt;type . . .>
+ . . .
+ &lt;attributeGroup ref="xml:specialAttrs"/>
+
+ will define a type which will schema-validate an instance
+ element with any of those attributes</xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+ <xs:documentation>In keeping with the XML Schema WG's standard versioning
+ policy, this schema document will persist at
+ http://www.w3.org/2001/03/xml.xsd.
+ At the date of issue it can also be found at
+ http://www.w3.org/2001/xml.xsd.
+ The schema document at that URI may however change in the future,
+ in order to remain compatible with the latest version of XML Schema
+ itself. In other words, if the XML Schema namespace changes, the version
+ of this document at
+ http://www.w3.org/2001/xml.xsd will change
+ accordingly; the version at
+ http://www.w3.org/2001/03/xml.xsd will not change.
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:attribute name="lang" type="xs:language">
+ <xs:annotation>
+ <xs:documentation>In due course, we should install the relevant ISO 2- and 3-letter
+ codes as the enumerated possible values . . .</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attribute name="space" default="preserve">
+ <xs:simpleType>
+ <xs:restriction base="xs:NCName">
+ <xs:enumeration value="default"/>
+ <xs:enumeration value="preserve"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="base" type="xs:anyURI">
+ <xs:annotation>
+ <xs:documentation>See http://www.w3.org/TR/xmlbase/ for
+ information about this attribute.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attributeGroup name="specialAttrs">
+ <xs:attribute ref="xml:base"/>
+ <xs:attribute ref="xml:lang"/>
+ <xs:attribute ref="xml:space"/>
+ </xs:attributeGroup>
+
+</xs:schema>
diff --git a/spec/xs3p/links.dtd b/spec/xs3p/links.dtd
new file mode 100644
index 00000000..c9f348ac
--- /dev/null
+++ b/spec/xs3p/links.dtd
@@ -0,0 +1,7 @@
+<!ELEMENT links (schema)+>
+<!ATTLIST links
+ xmlns CDATA #FIXED "http://titanium.dstc.edu.au/xml/xs3p">
+<!ELEMENT schema EMPTY>
+<!ATTLIST schema
+ file-location CDATA #REQUIRED
+ docfile-location CDATA #REQUIRED> \ No newline at end of file
diff --git a/spec/xs3p/links.xsd b/spec/xs3p/links.xsd
new file mode 100644
index 00000000..7928bc3e
--- /dev/null
+++ b/spec/xs3p/links.xsd
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://titanium.dstc.edu.au/xml/xs3p" targetNamespace="http://titanium.dstc.edu.au/xml/xs3p">
+ <xsd:element name="links">
+ <xsd:annotation>
+ <xsd:documentation>
+ <html:p>List of mappings from schema file locations (<html:code style="color:blue;">@file-location</html:code>) to their documentation file locations (<html:code style="color:blue;">@docfile-location</html:code>)</html:p>
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="schema" minOccurs="1" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:attribute name="file-location" type="xsd:string" use="required"/>
+ <xsd:attribute name="docfile-location" type="xsd:string" use="required"/>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+</xsd:schema> \ No newline at end of file
diff --git a/spec/xs3p/xs3p.xsl b/spec/xs3p/xs3p.xsl
new file mode 100644
index 00000000..b127948b
--- /dev/null
+++ b/spec/xs3p/xs3p.xsl
@@ -0,0 +1,8503 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ Copyright (C) DSTC Pty Ltd (ACN 052 372 577) 2002
+
+ The software contained on this media is the property of the
+ DSTC Pty Ltd. Use of this software is strictly in accordance
+ with the license agreement in the accompanying LICENSE file.
+ If your distribution of this software does not contain a
+ LICENSE file then you have no rights to use this software
+ in any manner and should contact DSTC at the address below
+ to determine an appropriate licensing arrangement.
+
+ DSTC Pty Ltd
+ Level 7, General Purpose South
+ The University of Queensland
+ QLD 4072 Australia
+ Tel: +61 7 3365 4310
+ Fax: +61 7 3365 4311
+ Email: titanium_enquiries@dstc.edu.au
+
+ This software is being provided "AS IS" without warranty of
+ any kind. In no event shall DSTC Pty Ltd be liable for
+ damage of any kind arising out of or in connection with
+ the use or performance of this software.
+-->
+<!--
+ File:
+ xs3p.xsl
+ Description:
+ Stylesheet that generates XHTML documentation, given an XML
+ Schema document
+ Assumptions:
+ -Resulting documentation will only be displayed properly with
+ the latest browsers that support XHTML and CSS. Older
+ browsers are not supported.
+ -Assumed that XSD document conforms to the XSD recommendation.
+ No validity checking is done.
+ Constraints:
+ -Local schema components cannot contain two dashes in
+ 'documentation' elements within their 'annotation' element.
+ This is because the contents of those 'documentation'
+ elements are displayed in a separate window using Javascript.
+ This Javascript code is enclosed in comments, which do not
+ allow two dashes inside themselves.
+ Notes:
+ -Javascript code is placed within comments, even though in
+ strict XHTML, JavaScript code should be placed within CDATA
+ sections. This is because current browsers generate a syntax
+ error if the page contains CDATA sections. Placing Javascript
+ code within comments means that the code cannot contain two
+ dashes.
+ (See 'PrintJSCode' named template.)
+ Stylesheet Sections:
+ -Global Parameters
+ Specify parameters that can be set externally to customise
+ stylesheet
+ -Constants
+ Constants used by the stylesheet
+ -Main Document
+ Templates to generate the overall document and the top-level
+ sections within it
+ -Hierarchy table
+ Templates for displaying type hierarchy for simple and
+ complex types, and substitution group hierarchy for elements
+ -Properties table
+ Templates for displaying the properties of top-level schema
+ components
+ -XML Instance Representation table
+ Templates for displaying how an XML instance conforming to
+ the schema component would look like
+ -Schema Component Representation table
+ Templates for displaying the XML representation of the schema
+ component
+ -XML Pretty Printer
+ Templates for displaying arbitrary XML instances
+ -Handling Schema Component References
+ Templates for generating internal and external links
+ -General Utility Templates
+ General templates used by other templates in this stylesheet
+ To Do List:
+ -It is not clever when printing out element and attribute
+ wildcards in the XML Instance Representation tables. It prints
+ out all wildcards, rather than working out the actual wildcard
+ is from multiple wildcard instances.
+ -Same as above for simple type constraints, e.g. it doesn't
+ summarise multiple pattern constraints.
+-->
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:ppp="http://titanium.dstc.edu.au/xml/xs3p"
+ version="1.0"
+ exclude-result-prefixes="xsd ppp html">
+
+ <xsl:output
+ method="xml"
+ encoding="ISO-8859-1"
+ standalone="yes"
+ version="1.0"
+ doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
+ doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
+ indent="yes"/>
+
+ <xsl:key name="type" match="/xsd:schema/xsd:complexType | /xsd:schema/xsd:simpleType | /xsd:schema/xsd:redefine/xsd:complexType | /xsd:schema/xsd:redefine/xsd:simpleType" use="@name" />
+ <xsl:key name="complexType" match="/xsd:schema/xsd:complexType | /xsd:schema/xsd:redefine/xsd:complexType" use="@name" />
+ <xsl:key name="simpleType" match="/xsd:schema/xsd:simpleType | /xsd:schema/xsd:redefine/xsd:simpleType" use="@name" />
+ <xsl:key name="attributeGroup" match="/xsd:schema/xsd:attributeGroup | /xsd:schema/xsd:redefine/xsd:attributeGroup" use="@name" />
+ <xsl:key name="group" match="/xsd:schema/xsd:group | /xsd:schema/xsd:redefine/xsd:group" use="@name" />
+ <xsl:key name="attribute" match="/xsd:schema/xsd:attribute" use="@name" />
+ <xsl:key name="element" match="/xsd:schema/xsd:element" use="@name" />
+
+ <!-- ******** Global Parameters ******** -->
+
+ <!-- Title of XHTML document. -->
+ <xsl:param name="title"></xsl:param>
+
+ <!-- If 'true', sorts the top-level schema components by type,
+ then name. Otherwise, displays the components by the order that
+ they appear in the schema. -->
+ <xsl:param name="sortByComponent">true</xsl:param>
+
+ <!-- If 'true', XHTML document uses JavaScript for added
+ functionality, such as pop-up windows and information-
+ hiding.
+ Otherwise, XHTML document does not use JavaScript. -->
+ <xsl:param name="useJavaScript">true</xsl:param>
+
+ <!-- If 'true', prints all super-types in the
+ type hierarchy box.
+ Otherwise, prints the parent type only in the
+ type hierarchy box. -->
+ <xsl:param name="printAllSuperTypes">true</xsl:param>
+
+ <!-- If 'true', prints all sub-types in the
+ type hierarchy box.
+ Otherwise, prints the direct sub-types only in the
+ type hierarchy box. -->
+ <xsl:param name="printAllSubTypes">true</xsl:param>
+
+ <!-- If 'true', prints out the Glossary section. -->
+ <xsl:param name="printGlossary">true</xsl:param>
+
+ <!-- If 'true', prints out the Legend section. -->
+ <xsl:param name="printLegend">true</xsl:param>
+
+ <!-- If 'true', prints prefix matching namespace of schema
+ components in XML Instance Representation tables. -->
+ <xsl:param name="printNSPrefixes">true</xsl:param>
+
+ <!-- If 'true', searches 'included' schemas for schema components
+ when generating links and XML Instance Representation tables. -->
+ <xsl:param name="searchIncludedSchemas">false</xsl:param>
+
+ <!-- If 'true', searches 'imported' schemas for schema components
+ when generating links and XML Instance Representation tables. -->
+ <xsl:param name="searchImportedSchemas">false</xsl:param>
+
+ <!-- File containing the mapping from file locations of external
+ (e.g. included, imported, refined) schemas to file locations
+ of their XHTML documentation. -->
+ <xsl:param name="linksFile"></xsl:param>
+
+ <!-- Set the base URL for resolving links. -->
+ <xsl:param name="baseURL"></xsl:param>
+
+ <!-- Uses an external CSS stylesheet rather than using
+ internally-declared CSS properties. -->
+ <xsl:param name="externalCSSURL"></xsl:param>
+
+
+ <!-- ******** Constants ******** -->
+
+ <!-- XML Schema Namespace -->
+ <xsl:variable name="XSD_NS">http://www.w3.org/2001/XMLSchema</xsl:variable>
+
+ <!-- XML Namespace -->
+ <xsl:variable name="XML_NS">http://www.w3.org/XML/1998/namespace</xsl:variable>
+
+ <!-- Number of 'em' to indent from parent element's start tag to
+ child element's start tag -->
+ <xsl:variable name="ELEM_INDENT">1.5</xsl:variable>
+
+ <!-- Number of 'em' to indent from parent element's start tag to
+ attribute's tag -->
+ <xsl:variable name="ATTR_INDENT">0.5</xsl:variable>
+
+ <!-- Title to use if none provided -->
+ <xsl:variable name="DEFAULT_TITLE">XML Schema Documentation</xsl:variable>
+
+ <!-- Prefixes used for anchor names -->
+ <!-- Type definitions -->
+ <xsl:variable name="TYPE_PREFIX">type_</xsl:variable>
+ <!-- Attribute declarations -->
+ <xsl:variable name="ATTR_PREFIX">attribute_</xsl:variable>
+ <!-- Attribute group definitions -->
+ <xsl:variable name="ATTR_GRP_PREFIX">attributeGroup_</xsl:variable>
+ <!-- Complex type definitions -->
+ <xsl:variable name="CTYPE_PREFIX" select="$TYPE_PREFIX"/>
+ <!-- Element declarations -->
+ <xsl:variable name="ELEM_PREFIX">element_</xsl:variable>
+ <!-- Key definitions -->
+ <xsl:variable name="KEY_PREFIX">key_</xsl:variable>
+ <!-- Group definitions -->
+ <xsl:variable name="GRP_PREFIX">group_</xsl:variable>
+ <!-- Notations -->
+ <xsl:variable name="NOTA_PREFIX">notation_</xsl:variable>
+ <!-- Namespace declarations -->
+ <xsl:variable name="NS_PREFIX">ns_</xsl:variable>
+ <!-- Simple type definitions -->
+ <xsl:variable name="STYPE_PREFIX" select="$TYPE_PREFIX"/>
+ <!-- Glossary terms -->
+ <xsl:variable name="TERM_PREFIX">term_</xsl:variable>
+
+ <!-- The original schema needs to be stored because when
+ calculating links for references, the links have to be
+ relative to the original schema. See 'PrintCompRef'
+ template. -->
+ <xsl:variable name="ORIGINAL_SCHEMA" select="/xsd:schema"/>
+
+ <!-- ******** Main Document ******** -->
+
+ <!--
+ Main template that starts the process
+ -->
+ <xsl:template match="/xsd:schema">
+ <!-- Check that links file is provided if searching external
+ schemas for components. -->
+ <xsl:if test="$linksFile='' and (normalize-space(translate($searchIncludedSchemas, 'TRUE', 'true'))='true' or normalize-space(translate($searchImportedSchemas, 'TRUE', 'true'))='true')">
+ <xsl:call-template name="HandleError">
+ <xsl:with-param name="isTerminating">true</xsl:with-param>
+ <xsl:with-param name="errorMsg">
+'linksFile' variable must be provided if either
+'searchIncludedSchemas' or 'searchImportedSchemas' is true.
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+
+ <!-- Get title of document -->
+ <xsl:variable name="actualTitle">
+ <xsl:choose>
+ <xsl:when test="$title != ''">
+ <xsl:value-of select="$title"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$DEFAULT_TITLE"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <html>
+ <head>
+ <!-- Set title bar -->
+ <title><xsl:value-of select="$actualTitle"/></title>
+
+ <!-- Set content type -->
+ <meta http-equiv="Content-Type" content="text/xml; charset=iso-8859-1"/>
+
+ <!-- Set base URL to use in working out relative paths -->
+ <xsl:if test="$baseURL != ''">
+ <xsl:element name="base">
+ <xsl:attribute name="href"><xsl:value-of select="$baseURL"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+
+ <!-- Set CSS styles -->
+ <style type="text/css">
+ <xsl:choose>
+ <!-- Use external CSS stylesheet -->
+ <xsl:when test="$externalCSSURL != ''">
+ <xsl:text>
+@import url(</xsl:text><xsl:value-of select="$externalCSSURL"/><xsl:text>);
+</xsl:text>
+ </xsl:when>
+ <!-- Use internal CSS styles -->
+ <xsl:otherwise>
+ <xsl:call-template name="DocumentCSSStyles"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </style>
+
+ <!-- Add Javascript code to make the collapseable boxes work -->
+ <xsl:if test="normalize-space(translate($useJavaScript,'TRUE','true'))='true'">
+ <xsl:call-template name="PrintJSCode">
+ <xsl:with-param name="code">
+ <xsl:call-template name="DocumentJSCode"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </head>
+ <body>
+ <!-- Title -->
+ <h1><a name="top"><xsl:value-of select="$actualTitle"/></a></h1>
+
+ <!-- Buttons for displaying printer-friendly version, and
+ expanding and collapsing all boxes -->
+ <xsl:call-template name="GlobalControlButtons"/>
+
+ <!-- Section: Table of Contents -->
+ <h2>Table of Contents</h2>
+ <xsl:apply-templates select="." mode="toc"/>
+ <xsl:call-template name="SectionFooter"/>
+
+ <!-- Section: Schema Document Properties -->
+ <h2><a name="SchemaProperties">Schema Document Properties</a></h2>
+ <!-- Sub-section: Properties table -->
+ <xsl:apply-templates select="." mode="properties"/>
+ <!-- Sub-section: Namespace Legend -->
+ <h3>Declared Namespaces</h3>
+ <xsl:apply-templates select="." mode="namespaces"/>
+ <!-- Sub-section: Schema Component Representation table -->
+ <xsl:call-template name="SchemaComponentTable">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ <xsl:call-template name="SectionFooter"/>
+
+ <!-- Section: Redefined Schema Components -->
+ <xsl:if test="xsd:redefine">
+ <h2><a name="Redefinitions">Redefined Schema Components</a></h2>
+ <xsl:apply-templates select="xsd:redefine/xsd:simpleType | xsd:redefine/xsd:complexType | xsd:redefine/xsd:attributeGroup | xsd:redefine/xsd:group" mode="topSection"/>
+ </xsl:if>
+
+ <!-- Sections: Top-level Schema Components -->
+ <xsl:choose>
+ <!-- Sort schema components -->
+ <xsl:when test="normalize-space(translate($sortByComponent,'TRUE','true'))='true'">
+ <!-- Declarations -->
+ <xsl:if test="xsd:attribute or xsd:element">
+ <h2><a name="SchemaDeclarations">Global Declarations</a></h2>
+ <xsl:apply-templates select="xsd:attribute | xsd:element" mode="topSection">
+ <xsl:sort select="local-name(.)" order="ascending"/>
+ <xsl:sort select="@name" order="ascending"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ <!-- Definitions -->
+ <xsl:if test="xsd:attributeGroup or xsd:complexType or xsd:group or xsd:notation or xsd:simpleType">
+ <h2><a name="SchemaDefinitions">Global Definitions</a></h2>
+ <xsl:apply-templates select="xsd:attributeGroup | xsd:complexType | xsd:group | xsd:notation | xsd:simpleType" mode="topSection">
+ <xsl:sort select="local-name(.)" order="ascending"/>
+ <xsl:sort select="@name" order="ascending"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ </xsl:when>
+ <!-- Display schema components as they occur -->
+ <xsl:otherwise>
+ <h2><a name="SchemaComponents">Global Schema Components</a></h2>
+ <xsl:apply-templates select="xsd:attribute | xsd:attributeGroup | xsd:complexType | xsd:element | xsd:group | xsd:notation | xsd:simpleType" mode="topSection"/>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <!-- Section: Legend -->
+ <xsl:if test="normalize-space(translate($printLegend,'TRUE','true'))='true'">
+ <div id="legend">
+ <h2><a name="Legend">Legend</a></h2>
+ <xsl:call-template name="Legend"/>
+ <xsl:call-template name="SectionFooter"/>
+ </div>
+ </xsl:if>
+
+ <!-- Section: Glossary -->
+ <xsl:if test="normalize-space(translate($printGlossary,'TRUE','true'))='true'">
+ <div id="glossary">
+ <h2><a name="Glossary">Glossary</a></h2>
+ <xsl:call-template name="Glossary"/>
+ <xsl:call-template name="SectionFooter"/>
+ </div>
+ </xsl:if>
+
+ <!-- Document Footer -->
+ <p class="footer">
+ <xsl:text>Generated by </xsl:text>
+ <a href="http://xml.fiforms.org/xs3p/">xs3p</a> (<a href="http://titanium.dstc.edu.au/xml/xs3p">old link</a>)
+ <xsl:text>.</xsl:text>
+ <xsl:if test="normalize-space(translate($useJavaScript,'TRUE','true'))='true'">
+ <xsl:text> Last modified: </xsl:text>
+ <xsl:call-template name="PrintJSCode">
+ <xsl:with-param name="code">document.write(document.lastModified);</xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </p>
+ </body>
+ </html>
+ </xsl:template>
+
+ <!--
+ Prints out the table of Declared Namespaces for the
+ current schema.
+ -->
+ <xsl:template match="xsd:schema" mode="namespaces">
+ <table class="namespaces">
+ <tr>
+ <th>Prefix</th>
+ <th>Namespace</th>
+ </tr>
+ <!-- Default namespace (no prefix) -->
+ <xsl:if test="namespace::*[local-name(.)='']">
+ <xsl:variable name="ns" select="namespace::*[local-name(.)='']"/>
+ <tr>
+ <td>
+ <a name="{$NS_PREFIX}">Default namespace</a>
+ </td>
+ <td>
+ <xsl:choose>
+ <xsl:when test="/xsd:schema/@targetNamespace and $ns=normalize-space(/xsd:schema/@targetNamespace)">
+ <span class="targetNS">
+ <xsl:value-of select="$ns"/>
+ </span>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$ns"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </td>
+ </tr>
+ </xsl:if>
+ <!-- Namespaces with prefixes -->
+ <xsl:for-each select="namespace::*[local-name(.)!='']">
+ <xsl:variable name="prefix" select="local-name(.)"/>
+ <xsl:variable name="ns" select="."/>
+ <tr>
+ <td>
+ <a name="{concat($NS_PREFIX, $prefix)}">
+ <xsl:value-of select="$prefix"/>
+ </a>
+ </td>
+ <td>
+ <xsl:choose>
+ <xsl:when test="/xsd:schema/@targetNamespace and $ns=normalize-space(/xsd:schema/@targetNamespace)">
+ <span class="targetNS">
+ <xsl:value-of select="$ns"/>
+ </span>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$ns"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </td>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </xsl:template>
+
+ <!--
+ Prints out the Table of Contents.
+ -->
+ <xsl:template match="xsd:schema" mode="toc">
+ <ul>
+ <!-- Section: Schema Document Properties -->
+ <li>
+ <a href="#SchemaProperties">Schema Document Properties</a>
+ </li>
+
+ <!-- Section: Redefined Schema Components -->
+ <xsl:if test="xsd:redefine">
+ <li>
+ <a href="#Redefinitions">Redefined Schema Components</a>
+ </li>
+ </xsl:if>
+
+ <!-- Sections: Top-level Schema Components -->
+ <xsl:choose>
+ <!-- Sort schema components -->
+ <xsl:when test="normalize-space(translate($sortByComponent,'TRUE','true'))='true'">
+ <!-- Declarations -->
+ <xsl:if test="xsd:attribute or xsd:element">
+ <li><a href="#SchemaDeclarations">Global Declarations</a>
+ <ul>
+ <xsl:apply-templates select="xsd:attribute | xsd:element" mode="toc">
+ <xsl:sort select="local-name(.)" order="ascending"/>
+ <xsl:sort select="@name" order="ascending"/>
+ </xsl:apply-templates>
+ </ul>
+ </li>
+ </xsl:if>
+ <!-- Definitions -->
+ <xsl:if test="xsd:attributeGroup or xsd:complexType or xsd:group or xsd:notation or xsd:simpleType">
+ <li><a href="#SchemaDefinitions">Global Definitions</a>
+ <ul>
+ <xsl:apply-templates select="xsd:attributeGroup | xsd:complexType | xsd:group | xsd:notation | xsd:simpleType" mode="toc">
+ <xsl:sort select="local-name(.)" order="ascending"/>
+ <xsl:sort select="@name" order="ascending"/>
+ </xsl:apply-templates>
+ </ul>
+ </li>
+ </xsl:if>
+ </xsl:when>
+ <!-- Display schema components in order as they appear in schema -->
+ <xsl:otherwise>
+ <li><a href="#SchemaComponents">Global Schema Components</a>
+ <ul>
+ <xsl:apply-templates select="xsd:attribute | xsd:attributeGroup | xsd:complexType | xsd:element | xsd:group | xsd:notation | xsd:simpleType" mode="toc"/>
+ </ul>
+ </li>
+ </xsl:otherwise>
+ </xsl:choose>
+ </ul>
+
+ <!-- Section: Legend -->
+ <xsl:if test="normalize-space(translate($printLegend,'TRUE','true'))='true'">
+ <ul id="legendTOC" style="margin-top: 0em">
+ <li><a href="#Legend">Legend</a></li>
+ </ul>
+ </xsl:if>
+
+ <!-- Section: Glossary -->
+ <xsl:if test="normalize-space(translate($printGlossary,'TRUE','true'))='true'">
+ <ul id="glossaryTOC" style="margin-top: 0em">
+ <li><a href="#Glossary">Glossary</a></li>
+ </ul>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Prints out a link to a top-level schema component section in the
+ Table of Contents.
+ -->
+ <xsl:template match="xsd:*[@name]" mode="toc">
+ <xsl:variable name="componentID">
+ <xsl:call-template name="GetComponentID">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <li>
+ <a href="#{$componentID}">
+ <xsl:call-template name="GetComponentDescription">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ <xsl:text>: </xsl:text>
+ <strong><xsl:value-of select="@name"/></strong>
+ </a>
+ </li>
+ </xsl:template>
+
+ <!--
+ Prints out the section for a top-level schema component.
+ -->
+ <xsl:template match="xsd:*[@name]" mode="topSection">
+ <!-- Header -->
+ <xsl:call-template name="ComponentSectionHeader">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+
+ <!-- Hierarchy table (for types and elements) -->
+ <xsl:apply-templates select="." mode="hierarchy"/>
+
+ <!-- Properties table -->
+ <xsl:apply-templates select="." mode="properties"/>
+
+ <!-- XML Instance Representation table -->
+ <xsl:call-template name="SampleInstanceTable">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+
+ <!-- Schema Component Representation table -->
+ <xsl:call-template name="SchemaComponentTable">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+
+ <!-- Footer -->
+ <xsl:call-template name="SectionFooter"/>
+ </xsl:template>
+
+ <!--
+ Prints out the buttons that can expand and collapse all boxes in
+ this page.
+ -->
+ <xsl:template name="GlobalControlButtons">
+ <xsl:if test="normalize-space(translate($useJavaScript,'TRUE','true'))='true'">
+ <div style="float: right;">
+ <!-- Printer-friendly Version -->
+ <div id="printerControls" style="display:none;">
+ <input type="checkbox" onclick="displayMode(this.checked)"/>
+ <xsl:text>Printer-friendly Version</xsl:text>
+ </div>
+ <xsl:call-template name="PrintJSCode">
+ <xsl:with-param name="code">
+var pc = getElementObject("printerControls");
+if (pc != null) {
+ pc.style.display="block";
+}
+ </xsl:with-param>
+ </xsl:call-template>
+
+ <!-- Expand/Collapse All buttons -->
+ <div id="globalControls" style="display:none">
+ <strong>XML Instance Representation:</strong><br/>
+ <span style="margin-left: 1em; white-space: nowrap">
+ <xsl:text>[ </xsl:text>
+ <a href="javascript:void(0)" onclick="expandAll(xiBoxes)">Expand All</a>
+ <xsl:text> | </xsl:text>
+ <a href="javascript:void(0)" onclick="collapseAll(xiBoxes)">Collapse All</a>
+ <xsl:text> ]</xsl:text>
+ </span><br/><br/>
+ <strong>Schema Component Representation:</strong><br/>
+ <span style="margin-left: 1em; white-space: nowrap">
+ <xsl:text>[ </xsl:text>
+ <a href="javascript:void(0)" onclick="expandAll(scBoxes)">Expand All</a>
+ <xsl:text> | </xsl:text>
+ <a href="javascript:void(0)" onclick="collapseAll(scBoxes)">Collapse All</a>
+ <xsl:text> ]</xsl:text>
+ </span>
+ </div>
+ <xsl:call-template name="PrintJSCode">
+ <xsl:with-param name="code">
+var gc = getElementObject("globalControls");
+if (gc != null) {
+ gc.style.display="block";
+}
+ </xsl:with-param>
+ </xsl:call-template>
+ </div>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Prints out the section header of a top-level schema component.
+ Param(s):
+ component (Node) required
+ Top-level schema component
+ -->
+ <xsl:template name="ComponentSectionHeader">
+ <xsl:param name="component"/>
+
+ <xsl:variable name="componentID">
+ <xsl:call-template name="GetComponentID">
+ <xsl:with-param name="component" select="$component"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="componentDescription">
+ <xsl:call-template name="GetComponentDescription">
+ <xsl:with-param name="component" select="$component"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="componentTermRef">
+ <xsl:call-template name="GetComponentTermRef">
+ <xsl:with-param name="component" select="$component"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <h3>
+ <!-- Description -->
+ <xsl:choose>
+ <xsl:when test="$componentTermRef != ''">
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code" select="$componentTermRef"/>
+ <xsl:with-param name="term" select="$componentDescription"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$componentDescription"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>: </xsl:text>
+ <!-- Name -->
+ <a name="{$componentID}" class="name">
+ <xsl:value-of select="$component/@name"/>
+ </a>
+ </h3>
+ </xsl:template>
+
+ <!--
+ Prints out footer for top-level sections.
+ -->
+ <xsl:template name="SectionFooter">
+ <!-- Link to top of page-->
+ <div style="text-align: right; clear: both;"><a href="#top">top</a></div>
+ <hr/>
+ </xsl:template>
+
+ <!--
+ Java Script code required by the entire HTML document.
+ -->
+ <xsl:template name="DocumentJSCode">
+ <!-- Get all IDs of XML Instance Representation boxes
+ and place them in an array. -->
+ <xsl:text>/* IDs of XML Instance Representation boxes */
+</xsl:text>
+ <xsl:text>var xiBoxes = new Array(</xsl:text>
+ <xsl:for-each select="/xsd:schema/xsd:*[@name]">
+ <xsl:if test="position()!=1">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ <xsl:text>'</xsl:text>
+ <xsl:call-template name="GetComponentID">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ <xsl:text>_xibox'</xsl:text>
+ </xsl:for-each>
+ <xsl:text>);
+</xsl:text>
+ <!-- Get all IDs of Schema Component Representation boxes
+ and place them in an array. -->
+ <xsl:text>/* IDs of Schema Component Representation boxes */
+</xsl:text>
+ <xsl:text>var scBoxes = new Array('schema_scbox'</xsl:text>
+ <xsl:for-each select="/xsd:schema/xsd:*[@name]">
+ <xsl:text>, '</xsl:text>
+ <xsl:call-template name="GetComponentID">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ <xsl:text>_scbox'</xsl:text>
+ </xsl:for-each>
+ <xsl:text>);
+</xsl:text>
+ <!-- Functions -->
+ <xsl:text>
+/**
+ * Can get the ID of the button controlling
+ * a collapseable box by concatenating
+ * this string onto the ID of the box itself.
+ */
+var B_SFIX = "_button";
+
+/**
+ * Counter of documentation windows
+ * Used to give each window a unique name
+ */
+var windowCount = 0;
+
+/**
+ * Returns an element in the current HTML document.
+ *
+ * @param elementID Identifier of HTML element
+ * @return HTML element object
+ */
+function getElementObject(elementID) {
+ var elemObj = null;
+ if (document.getElementById) {
+ elemObj = document.getElementById(elementID);
+ }
+ return elemObj;
+}
+
+/**
+ * Closes a collapseable box.
+ *
+ * @param boxObj Collapseable box
+ * @param buttonObj Button controlling box
+ */
+function closeBox(boxObj, buttonObj) {
+ if (boxObj == null || buttonObj == null) {
+ // Box or button not found
+ } else {
+ // Change 'display' CSS property of box
+ boxObj.style.display="none";
+
+ // Change text of button
+ if (boxObj.style.display=="none") {
+ buttonObj.value=" + ";
+ }
+ }
+}
+
+/**
+ * Opens a collapseable box.
+ *
+ * @param boxObj Collapseable box
+ * @param buttonObj Button controlling box
+ */
+function openBox(boxObj, buttonObj) {
+ if (boxObj == null || buttonObj == null) {
+ // Box or button not found
+ } else {
+ // Change 'display' CSS property of box
+ boxObj.style.display="block";
+
+ // Change text of button
+ if (boxObj.style.display=="block") {
+ buttonObj.value=" - ";
+ }
+ }
+}
+
+/**
+ * Sets the state of a collapseable box.
+ *
+ * @param boxID Identifier of box
+ * @param open If true, box is "opened",
+ * Otherwise, box is "closed".
+ */
+function setState(boxID, open) {
+ var boxObj = getElementObject(boxID);
+ var buttonObj = getElementObject(boxID+B_SFIX);
+ if (boxObj == null || buttonObj == null) {
+ // Box or button not found
+ } else if (open) {
+ openBox(boxObj, buttonObj);
+ // Make button visible
+ buttonObj.style.display="inline";
+ } else {
+ closeBox(boxObj, buttonObj);
+ // Make button visible
+ buttonObj.style.display="inline";
+ }
+}
+
+/**
+ * Switches the state of a collapseable box, e.g.
+ * if it's opened, it'll be closed, and vice versa.
+ *
+ * @param boxID Identifier of box
+ */
+function switchState(boxID) {
+ var boxObj = getElementObject(boxID);
+ var buttonObj = getElementObject(boxID+B_SFIX);
+ if (boxObj == null || buttonObj == null) {
+ // Box or button not found
+ } else if (boxObj.style.display=="none") {
+ // Box is closed, so open it
+ openBox(boxObj, buttonObj);
+ } else if (boxObj.style.display=="block") {
+ // Box is opened, so close it
+ closeBox(boxObj, buttonObj);
+ }
+}
+
+/**
+ * Closes all boxes in a given list.
+ *
+ * @param boxList Array of box IDs
+ */
+function collapseAll(boxList) {
+ var idx;
+ for (idx = 0; idx &lt; boxList.length; idx++) {
+ var boxObj = getElementObject(boxList[idx]);
+ var buttonObj = getElementObject(boxList[idx]+B_SFIX);
+ closeBox(boxObj, buttonObj);
+ }
+}
+
+/**
+ * Open all boxes in a given list.
+ *
+ * @param boxList Array of box IDs
+ */
+function expandAll(boxList) {
+ var idx;
+ for (idx = 0; idx &lt; boxList.length; idx++) {
+ var boxObj = getElementObject(boxList[idx]);
+ var buttonObj = getElementObject(boxList[idx]+B_SFIX);
+ openBox(boxObj, buttonObj);
+ }
+}
+
+/**
+ * Makes all the control buttons of boxes appear.
+ *
+ * @param boxList Array of box IDs
+ */
+function viewControlButtons(boxList) {
+ var idx;
+ for (idx = 0; idx &lt; boxList.length; idx++) {
+ buttonObj = getElementObject(boxList[idx]+B_SFIX);
+ if (buttonObj != null) {
+ buttonObj.style.display = "inline";
+ }
+ }
+}
+
+/**
+ * Makes all the control buttons of boxes disappear.
+ *
+ * @param boxList Array of box IDs
+ */
+function hideControlButtons(boxList) {
+ var idx;
+ for (idx = 0; idx &lt; boxList.length; idx++) {
+ buttonObj = getElementObject(boxList[idx]+B_SFIX);
+ if (buttonObj != null) {
+ buttonObj.style.display = "none";
+ }
+ }
+}
+
+/**
+ * Sets the page for either printing mode
+ * or viewing mode. In printing mode, the page
+ * is made to be more readable when printing it out.
+ * In viewing mode, the page is more browsable.
+ *
+ * @param isPrinterVersion If true, display in
+ * printing mode; otherwise,
+ * in viewing mode
+ */
+function displayMode(isPrinterVersion) {
+ var obj;
+ if (isPrinterVersion) {
+ // Hide global control buttons
+ obj = getElementObject("globalControls");
+ if (obj != null) {
+ obj.style.visibility = "hidden";
+ }
+ // Hide Legend
+ obj = getElementObject("legend");
+ if (obj != null) {
+ obj.style.display = "none";
+ }
+ obj = getElementObject("legendTOC");
+ if (obj != null) {
+ obj.style.display = "none";
+ }
+ // Hide Glossary
+ obj = getElementObject("glossary");
+ if (obj != null) {
+ obj.style.display = "none";
+ }
+ obj = getElementObject("glossaryTOC");
+ if (obj != null) {
+ obj.style.display = "none";
+ }
+
+ // Expand all XML Instance Representation tables
+ expandAll(xiBoxes);
+ // Expand all Schema Component Representation tables
+ expandAll(scBoxes);
+
+ // Hide Control buttons
+ hideControlButtons(xiBoxes);
+ hideControlButtons(scBoxes);
+ } else {
+ // View global control buttons
+ obj = getElementObject("globalControls");
+ if (obj != null) {
+ obj.style.visibility = "visible";
+ }
+ // View Legend
+ obj = getElementObject("legend");
+ if (obj != null) {
+ obj.style.display = "block";
+ }
+ obj = getElementObject("legendTOC");
+ if (obj != null) {
+ obj.style.display = "block";
+ }
+ // View Glossary
+ obj = getElementObject("glossary");
+ if (obj != null) {
+ obj.style.display = "block";
+ }
+ obj = getElementObject("glossaryTOC");
+ if (obj != null) {
+ obj.style.display = "block";
+ }
+
+ // Expand all XML Instance Representation tables
+ expandAll(xiBoxes);
+ // Collapse all Schema Component Representation tables
+ collapseAll(scBoxes);
+
+ // View Control buttons
+ viewControlButtons(xiBoxes);
+ viewControlButtons(scBoxes);
+ }
+}
+
+/**
+ * Opens up a window displaying the documentation
+ * of a schema component in the XML Instance
+ * Representation table.
+ *
+ * @param compDesc Description of schema component
+ * @param compName Name of schema component
+ * @param docTextArray Array containing the paragraphs
+ * of the new document
+ */
+function viewDocumentation(compDesc, compName, docTextArray) {
+ var width = 400;
+ var height = 200;
+ var locX = 100;
+ var locY = 200;
+
+ /* Generate content */
+ var actualText = "&lt;html>";
+ actualText += "&lt;head>&lt;title>";
+ actualText += compDesc;
+ if (compName != '') {
+ actualText += ": " + compName;
+ }
+ actualText += "&lt;/title>&lt;/head>";
+ actualText += "&lt;body bgcolor=\"#FFFFEE\">";
+ // Title
+ actualText += "&lt;p style=\"font-family: Arial, sans-serif; font-size: 12pt; font-weight: bold; letter-spacing:1px;\">";
+ actualText += compDesc;
+ if (compName != '') {
+ actualText += ": &lt;span style=\"color:#006699\">" + compName + "&lt;/span>";
+ }
+ actualText += "&lt;/p>";
+ // Documentation
+ var idx;
+ for (idx = 0; idx &lt; docTextArray.length; idx++) {
+ actualText += "&lt;p style=\"font-family: Arial, sans-serif; font-size: 10pt;\">" + docTextArray[idx] + "&lt;/p>";
+ }
+ // Link to close window
+ actualText += "&lt;a href=\"javascript:void(0)\" onclick=\"window.close();\" style=\"font-family: Arial, sans-serif; font-size: 8pt;\">Close&lt;/a>";
+ actualText += "&lt;/body>&lt;/html>";
+
+ /* Display window */
+ windowCount++;
+ var docWindow = window.open("", "documentation"+windowCount, "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable,alwaysRaised,dependent,titlebar=no,width="+width+",height="+height+",screenX="+locX+",left="+locX+",screenY="+locY+",top="+locY);
+ docWindow.document.write(actualText);
+}
+</xsl:text>
+ </xsl:template>
+
+ <!--
+ CSS properties for the entire HTML document.
+ -->
+ <xsl:template name="DocumentCSSStyles">
+ <xsl:text>
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+/* More-configurable styles */
+
+/******** General ********/
+
+/* Document body */
+body {
+ color: Black;
+ background-color: White;
+ font-family: Arial, sans-serif;
+ font-size: 10pt;
+}
+/* Horizontal rules */
+hr {
+ color: black;
+}
+/* Document title */
+h1 {
+ font-size: 18pt;
+ letter-spacing: 2px;
+ border-bottom: 1px #ccc solid;
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+/* Main section headers */
+h2 {
+ font-size: 14pt;
+ letter-spacing: 1px;
+}
+/* Sub-section headers */
+h3, h3 a, h3 span {
+ font-size: 12pt;
+ font-weight: bold;
+ color: black;
+}
+/* Table displaying the properties of the schema components or the
+ schema document itself */
+table.properties th, table.properties th a {
+ color: black;
+ background-color: #F99; /* Pink */
+}
+table.properties td {
+ background-color: #eee; /* Gray */
+}
+
+
+/******** Table of Contents Section ********/
+
+/* Controls for switching between printing and viewing modes */
+div#printerControls {
+ color: #963; /* Orange-brown */
+}
+/* Controls that can collapse or expand all XML Instance
+ Representation and Schema Component Representation boxes */
+div#globalControls {
+ border: 2px solid #999;
+}
+
+
+/******** Schema Document Properties Section ********/
+
+/* Table displaying the namespaces declared in the schema */
+table.namespaces th {
+ background-color: #ccc;
+}
+table.namespaces td {
+ background-color: #eee;
+}
+/* Target namespace of the schema */
+span.targetNS {
+ color: #06C;
+ font-weight: bold;
+}
+
+
+/******** Schema Components' Sections ********/
+
+/* Name of schema component */
+.name {
+ color: #F93; /* Orange */
+}
+
+/* Hierarchy table */
+table.hierarchy {
+ border: 2px solid #999; /* Gray */
+}
+
+/* XML Instance Representation table */
+div.sample div.contents {
+ border: 2px dashed black;
+}
+
+/* Schema Component Representation table */
+div.schemaComponent div.contents {
+ border: 2px black solid;
+}
+
+
+/******** Glossary Section ********/
+
+/* Glossary Terms */
+.glossaryTerm {
+ color: #036; /* Blue */
+}
+
+
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+/* Printer-version styles */
+
+@media print {
+
+/* Ensures that controls are hidden when printing */
+div#printerControls {
+ visibility: hidden;
+}
+div#globalControls {
+ visibility: hidden;
+}
+#legend {
+ display: none;
+}
+#legendTOC {
+ display: none;
+}
+#glossary {
+ display: none;
+}
+#glossaryTOC {
+ display: none;
+}
+
+}
+
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+/* Base styles */
+
+/******** General ********/
+
+/* Unordered lists */
+ul {
+ margin-left: 1.5em;
+ margin-bottom: 0em;
+}
+/* Tables */
+table {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ margin-left: 2px;
+ margin-right: 2px;
+}
+table th, table td {
+ font-size: 10pt;
+ vertical-align: top;
+ padding-top: 3px;
+ padding-bottom: 3px;
+ padding-left: 10px;
+ padding-right: 10px;
+}
+table th {
+ font-weight: bold;
+ text-align: left;
+}
+/* Table displaying the properties of the schema components or the
+ schema document itself */
+table.properties {
+ width: 90%;
+}
+table.properties th {
+ width: 30%;
+}
+/* Boxes that can make its content appear and disappear*/
+div.box {
+ margin: 1em;
+}
+ /* Box caption */
+div.box span.caption {
+ font-weight: bold;
+}
+ /* Button to open and close the box */
+div.box input.control {
+ width: 1.4em;
+ height: 1.4em;
+ text-align: center;
+ vertical-align: middle;
+ font-size: 11pt;
+}
+ /* Box contents */
+div.box div.contents {
+ margin-top: 3px;
+}
+
+
+/******** Table of Contents Section ********/
+
+/* Controls for switching between printing and viewing modes */
+div#printerControls {
+ white-space: nowrap;
+ font-weight: bold;
+ padding: 5px;
+ margin: 5px;
+}
+/* Controls that can collapse or expand all XML Instance
+ Representation and Schema Component Representation boxes */
+div#globalControls {
+ padding: 10px;
+ margin: 5px;
+}
+
+
+/******** Schema Document Properties Section ********/
+
+/* Table displaying the namespaces declared in the schema */
+table.namespaces th {
+}
+table.namespaces td {
+}
+/* Target namespace of the schema */
+span.targetNS {
+}
+
+
+/******** Schema Components' Sections ********/
+
+/* Name of schema component */
+.name {
+}
+
+/* Hierarchy table */
+table.hierarchy {
+ width: 90%;
+}
+table.hierarchy th {
+ font-weight: normal;
+ font-style: italic;
+ width: 20%;
+}
+table.hierarchy th, table.hierarchy td {
+ padding: 5px;
+}
+
+/* XML Instance Representation table */
+div.sample {
+ width: 90%;
+}
+div.sample div.contents {
+ padding: 5px;
+ font-family: Courier New, sans-serif;
+ font-size: 10pt;
+}
+ /* Normal elements and attributes */
+div.sample div.contents, div.sample div.contents a {
+ color: black;
+}
+ /* Group Headers */
+div.sample div.contents .group, div.sample div.contents .group a {
+ color: #999; /* Light gray */
+}
+ /* Type Information */
+div.sample div.contents .type, div.sample div.contents .type a {
+ color: #999; /* Light gray */
+}
+ /* Occurrence Information */
+div.sample div.contents .occurs, div.sample div.contents .occurs a {
+ color: #999; /* Light gray */
+}
+ /* Fixed values */
+div.sample div.contents .fixed {
+ color: #063; /* Green */
+ font-weight: bold;
+}
+ /* Simple type constraints */
+div.sample div.contents .constraint, div.sample div.contents .constraint a {
+ color: #999; /* Light gray */
+}
+ /* Elements and attributes inherited from base type */
+div.sample div.contents .inherited, div.sample div.contents .inherited a {
+ color: #666; /* Dark gray */
+}
+ /* Elements and attributes added to or changed from base type */
+div.sample div.contents .newFields {
+ font-weight: bold;
+}
+ /* Other type of information */
+div.sample div.contents .other, div.sample div.contents .other a {
+ color: #369; /* Blue */
+ font-style: italic;
+}
+ /* Link to open up window displaying documentation */
+div.sample div.contents a.documentation {
+ text-decoration: none;
+ padding-left: 3px;
+ padding-right: 3px;
+ padding-top: 0px;
+ padding-bottom: 0px;
+ font-weight: bold;
+ font-size: 11pt;
+ background-color: #FFD;
+ color: #069;
+}
+ /* Invert colors when hovering over link to open up window
+ displaying documentation */
+div.sample div.contents a.documentation:hover {
+ color: #FFD;
+ background-color: #069;
+}
+
+/* Schema Component Representation table */
+div.schemaComponent {
+ width: 90%;
+}
+div.schemaComponent div.contents {
+ font-family: Courier New, sans-serif;
+ font-size: 10pt;
+ padding: 5px;
+}
+ /* Syntax characters */
+div.schemaComponent div.contents {
+ color: #00f; /* blue */
+}
+ /* Element and attribute tags */
+div.schemaComponent div.contents .scTag {
+ color: #933; /* maroon */
+}
+ /* Element and attribute content */
+div.schemaComponent div.contents .scContent, div.schemaComponent div.contents .scContent a {
+ color: black;
+ font-weight: bold;
+}
+ /* Comments */
+div.schemaComponent div.contents .comment {
+ color: #999; /* Light gray */
+}
+
+/******** Legend Section ********/
+
+div#legend table, div#legend div {
+ margin-bottom: 3px;
+}
+div#legend div.hint {
+ color: #999; /* Light gray */
+ width: 90%;
+ margin-left: 1em;
+ margin-bottom: 2em;
+}
+
+
+/******** Glossary Section ********/
+
+/* Glossary Terms */
+.glossaryTerm {
+ font-weight: bold;
+}
+
+
+/******** Footer ********/
+
+.footer {
+ font-size: 8pt;
+}
+</xsl:text>
+ </xsl:template>
+
+ <!--
+ Print outs a legend describing the meaning of colors, bold items,
+ etc. in the top-level sections.
+ -->
+ <xsl:template name="Legend">
+ <!-- Header -->
+ <div style="float: left; width: 15em;">
+ <h3 style="margin-bottom: 0px;">Complex Type:</h3>
+ <div class="hint" style="margin-left: 0em;">Schema Component Type</div>
+ </div>
+ <div style="float: left; width: 15em;">
+ <h3 style="margin-bottom: 0px;"><span class="name">AusAddress</span></h3>
+ <div class="hint" style="margin-left: 0em;">Schema Component Name</div>
+ </div>
+
+ <!-- Hierarchy Table -->
+ <table class="hierarchy" style="clear : both">
+ <tr>
+ <xsl:choose>
+ <xsl:when test="normalize-space(translate($printAllSuperTypes, 'TRUE', 'true'))='true'">
+ <th>Super-types:</th>
+ <td>
+ <span class="type" style="color: #0000FF; text-decoration:underline;">Address</span>
+ <xsl:text> &lt; </xsl:text>
+ <span class="current">AusAddress</span>
+ <xsl:text> (by extension)</xsl:text>
+ </td>
+ </xsl:when>
+ <xsl:otherwise>
+ <th>Parent type:</th>
+ <td>
+ <span class="type" style="color: #0000FF; text-decoration:underline;">Address</span>
+ <xsl:text> (derivation method: extension)</xsl:text>
+ </td>
+ </xsl:otherwise>
+ </xsl:choose>
+ </tr>
+ <tr>
+ <xsl:choose>
+ <xsl:when test="normalize-space(translate($printAllSubTypes, 'TRUE', 'true'))='true'">
+ <th>Sub-types:</th>
+ <td>
+ <ul>
+ <li>
+ <span class="type" style="color: #0000FF; text-decoration:underline;">QLDAddress</span>
+ <xsl:text> (by restriction)</xsl:text>
+ </li>
+ </ul>
+ </td>
+ </xsl:when>
+ <xsl:otherwise>
+ <th>Direct sub-types:</th>
+ <td>
+ <ul>
+ <li>
+ <span class="type" style="color: #0000FF; text-decoration:underline;">QLDAddress</span>
+ <xsl:text> (by restriction)</xsl:text>
+ </li>
+ </ul>
+ </td>
+ </xsl:otherwise>
+ </xsl:choose>
+ </tr>
+ </table>
+ <div class="hint">If this schema component is a type definition, its type hierarchy is shown in a gray-bordered box.</div>
+
+ <!-- Properties Table -->
+ <table class="properties">
+ <tr>
+ <th>Name</th>
+ <td>AusAddress</td>
+ </tr>
+ <tr>
+ <th>
+ <a title="Look up 'Abstract' in glossary" href="#term_Abstract">Abstract</a>
+ </th>
+ <td>no</td>
+ </tr>
+ </table>
+ <div class="hint">The table above displays the properties of this schema component.</div>
+
+ <!-- XML Instance Representation Table -->
+ <div class="sample box">
+ <div>
+ <span class="caption">XML Instance Representation</span>
+ </div>
+ <div class="contents">
+ <span style="margin-left: 0em">&lt;...</span>
+ <span class="newFields">
+ <span> country="<span class="fixed">Australia</span>"</span>
+ </span>
+ <xsl:text>&gt; </xsl:text><br/>
+ <span style="margin-left: 1.5em" class="inherited">&lt;unitNo&gt; <span class="type">string</span> &lt;/unitNo&gt; <span class="occurs">[0..1]</span></span><br/>
+ <span style="margin-left: 1.5em" class="inherited">&lt;houseNo&gt; <span class="type">string</span> &lt;/houseNo&gt; <span class="occurs">[1]</span></span><br/>
+ <span style="margin-left: 1.5em" class="inherited">&lt;street&gt; <span class="type">string</span> &lt;/street&gt; <span class="occurs">[1]</span></span><br/>
+ <span class="group" style="margin-left: 1.5em">Start <a title="Look up 'Choice' in glossary" href="#term_Choice">Choice</a> <span class="occurs">[1]</span></span><br/>
+ <span style="margin-left: 3em" class="inherited">&lt;city&gt; <span class="type">string</span> &lt;/city&gt; <span class="occurs">[1]</span></span><br/>
+ <span style="margin-left: 3em" class="inherited">&lt;town&gt; <span class="type">string</span> &lt;/town&gt; <span class="occurs">[1]</span></span><br/>
+ <span class="group" style="margin-left: 1.5em">End Choice</span><br/>
+ <span class="newFields">
+ <span style="margin-left: 1.5em">&lt;state&gt; <span class="type" style="text-decoration:underline;">AusStates</span> &lt;/state&gt; <span class="occurs">[1]</span></span><br/>
+ <span style="margin-left: 1.5em">&lt;postcode&gt; <span class="constraint">string &lt;&lt;<em>pattern</em> = [1-9][0-9]{3}>></span> &lt;/postcode&gt; <span class="occurs">[1]</span>
+ <xsl:if test="normalize-space(translate($useJavaScript,'TRUE','true'))='true'">
+ <a href="javascript:void(0)" title="View Documentation" class="documentation" onclick="docArray = new Array('Post code must be a four-digit number.'); viewDocumentation('Element', 'postcode', docArray);">?</a>
+ </xsl:if>
+ </span><br/>
+ </span>
+ <span style="margin-left: 0em">&lt;/...&gt;</span><br/>
+ </div>
+ </div>
+ <div class="hint">
+ <p>The XML Instance Representation table above shows the schema component's content as an XML instance.</p>
+ <ul>
+ <li>The minimum and maximum occurrence of elements and attributes are provided in square brackets, e.g. [0..1].</li>
+ <li>Model group information are shown in gray, e.g. Start Choice ... End Choice.</li>
+ <li>For type derivations, the elements and attributes that have been added to or changed from the base type's content are shown in <span style="font-weight: bold">bold</span>.</li>
+ <li>If an element/attribute has a fixed value, the fixed value is shown in green, e.g. country="Australia".</li>
+ <li>Otherwise, the type of the element/attribute is displayed.
+ <ul>
+ <li>If the element/attribute's type is in the schema, a link is provided to it.</li>
+ <!--<li>An <em>E</em> symbol is shown if the element/attribute's type is located in an external schema.</li>-->
+ <li>For local simple type definitions, the constraints are displayed in angle brackets, e.g. &lt;&lt;<em>pattern</em> = [1-9][0-9]{3}>>.</li>
+ </ul>
+ </li>
+ <xsl:if test="normalize-space(translate($useJavaScript,'TRUE','true'))='true'">
+ <li>If a local element/attribute has documentation, it will be displayed in a window that pops up when the question mark inside the attribute or next to the element is clicked, e.g. &lt;postcode>.</li>
+ </xsl:if>
+ </ul>
+ </div>
+
+ <!-- Schema Component Representation Table -->
+ <div class="schemaComponent box">
+ <div>
+ <span class="caption">Schema Component Representation</span>
+ </div>
+ <div class="contents">
+ <span style="margin-left: 0em">&lt;<span class="scTag">complexType</span> <span class="scTag">name</span>="<span class="scContent">AusAddress</span>"&gt;</span><br/>
+ <span style="margin-left: 1.5em">&lt;<span class="scTag">complexContent</span>&gt;</span><br/>
+ <span style="margin-left: 3em">&lt;<span class="scTag">extension</span> <span class="scTag">base</span>="<span class="scContent"><span class="type" style="text-decoration:underline;">Address</span></span>"&gt;</span><br/>
+ <span style="margin-left: 4.5em">&lt;<span class="scTag">sequence</span>&gt;</span><br/>
+ <span style="margin-left: 6em">&lt;<span class="scTag">element</span> <span class="scTag">name</span>="<span class="scContent">state</span>" <span class="scTag">type</span>="<span class="scContent"><span class="type" style="text-decoration:underline;">AusStates</span></span>"/&gt;</span><br/>
+ <span style="margin-left: 6em">&lt;<span class="scTag">element</span> <span class="scTag">name</span>="<span class="scContent">postcode</span>"&gt;</span><br/>
+ <span style="margin-left: 7.5em">&lt;<span class="scTag">simpleType</span>&gt;</span><br/>
+ <span style="margin-left: 9em">&lt;<span class="scTag">restriction</span> <span class="scTag">base</span>="<span class="scContent"><span class="type">string</span></span>"&gt;</span><br/>
+ <span style="margin-left: 10.5em">&lt;<span class="scTag">pattern</span> <span class="scTag">value</span>="<span class="scContent">[1-9][0-9]{3}</span>"/&gt;</span><br/>
+ <span style="margin-left: 9em">&lt;/<span class="scTag">restriction</span>&gt;</span><br/>
+ <span style="margin-left: 7.5em">&lt;/<span class="scTag">simpleType</span>&gt;</span><br/>
+ <span style="margin-left: 6em">&lt;/<span class="scTag">element</span>&gt;</span><br/>
+ <span style="margin-left: 4.5em">&lt;/<span class="scTag">sequence</span>&gt;</span><br/>
+ <span style="margin-left: 4.5em">&lt;<span class="scTag">attribute</span> <span class="scTag">name</span>="<span class="scContent">country</span>" <span class="scTag">type</span>="<span class="scContent"><span class="type">string</span></span>" <span class="scTag">fixed</span>="<span class="scContent">Australia</span>"/&gt;</span><br/>
+ <span style="margin-left: 3em">&lt;/<span class="scTag">extension</span>&gt;</span><br/>
+ <span style="margin-left: 1.5em">&lt;/<span class="scTag">complexContent</span>&gt;</span><br/>
+ <span style="margin-left: 0em">&lt;/<span class="scTag">complexType</span>&gt;</span><br/>
+ </div>
+ </div>
+ <div class="hint">The Schema Component Representation table above displays the underlying XML representation of the schema component. (Annotations are not shown.)</div>
+ </xsl:template>
+
+ <!--
+ Print outs all terms for the glossary section.
+ -->
+ <xsl:template name="Glossary">
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">Abstract</xsl:with-param>
+ <xsl:with-param name="term">Abstract</xsl:with-param>
+ <xsl:with-param name="description">
+ <xsl:text>(Applies to complex type definitions and element declarations).</xsl:text>
+ <xsl:text> An abstract element or complex type cannot used to validate an element instance.</xsl:text>
+ <xsl:text> If there is a reference to an abstract element, only element declarations that can substitute the abstract element can be used to validate the instance.</xsl:text>
+ <xsl:text> For references to abstract type definitions, only derived types can be used.</xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">All</xsl:with-param>
+ <xsl:with-param name="term">All Model Group</xsl:with-param>
+ <xsl:with-param name="description">
+ <xsl:text>Child elements can be provided </xsl:text>
+ <em>
+ <xsl:text>in any order</xsl:text>
+ </em>
+ <xsl:text> in instances.</xsl:text>
+ </xsl:with-param>
+ <xsl:with-param name="link">http://www.w3.org/TR/xmlschema-1/#element-all</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">Choice</xsl:with-param>
+ <xsl:with-param name="term">Choice Model Group</xsl:with-param>
+ <xsl:with-param name="description">
+ <em>
+ <xsl:text>Only one</xsl:text>
+ </em>
+ <xsl:text> from the list of child elements and model groups can be provided in instances.</xsl:text>
+ </xsl:with-param>
+ <xsl:with-param name="link">http://www.w3.org/TR/xmlschema-1/#element-choice</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">CollapseWS</xsl:with-param>
+ <xsl:with-param name="term">Collapse Whitespace Policy</xsl:with-param>
+ <xsl:with-param name="description">Replace tab, line feed, and carriage return characters with space character (Unicode character 32). Then, collapse contiguous sequences of space characters into single space character, and remove leading and trailing space characters.</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">ElemBlock</xsl:with-param>
+ <xsl:with-param name="term">Disallowed Substitutions</xsl:with-param>
+ <xsl:with-param name="description">
+ <xsl:text>(Applies to element declarations).</xsl:text>
+ <xsl:text> If </xsl:text>
+ <em>substitution</em>
+ <xsl:text> is specified, then </xsl:text>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">SubGroup</xsl:with-param>
+ <xsl:with-param name="term">substitution group</xsl:with-param>
+ </xsl:call-template>
+ <xsl:text> members cannot be used in place of the given element declaration to validate element instances.</xsl:text>
+
+ <xsl:text> If </xsl:text>
+ <em>derivation methods</em>
+ <xsl:text>, e.g. extension, restriction, are specified, then the given element declaration will not validate element instances that have types derived from the element declaration's type using the specified derivation methods.</xsl:text>
+ <xsl:text> Normally, element instances can override their declaration's type by specifying an </xsl:text>
+ <code>xsi:type</code>
+ <xsl:text> attribute.</xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">Key</xsl:with-param>
+ <xsl:with-param name="term">Key Constraint</xsl:with-param>
+ <xsl:with-param name="description">
+ <xsl:text>Like </xsl:text>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">Unique</xsl:with-param>
+ <xsl:with-param name="term">Uniqueness Constraint</xsl:with-param>
+ </xsl:call-template>
+ <xsl:text>, but additionally requires that the specified value(s) must be provided.</xsl:text>
+ </xsl:with-param>
+ <xsl:with-param name="link">http://www.w3.org/TR/xmlschema-1/#cIdentity-constraint_Definitions</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">KeyRef</xsl:with-param>
+ <xsl:with-param name="term">Key Reference Constraint</xsl:with-param>
+ <xsl:with-param name="description">
+ <xsl:text>Ensures that the specified value(s) must match value(s) from a </xsl:text>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">Key</xsl:with-param>
+ <xsl:with-param name="term">Key Constraint</xsl:with-param>
+ </xsl:call-template>
+ <xsl:text> or </xsl:text>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">Unique</xsl:with-param>
+ <xsl:with-param name="term">Uniqueness Constraint</xsl:with-param>
+ </xsl:call-template>
+ <xsl:text>.</xsl:text>
+ </xsl:with-param>
+ <xsl:with-param name="link">http://www.w3.org/TR/xmlschema-1/#cIdentity-constraint_Definitions</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">ModelGroup</xsl:with-param>
+ <xsl:with-param name="term">Model Group</xsl:with-param>
+ <xsl:with-param name="description">
+ <xsl:text>Groups together element content, specifying the order in which the element content can occur and the number of times the group of element content may be repeated.</xsl:text>
+ </xsl:with-param>
+ <xsl:with-param name="link">http://www.w3.org/TR/xmlschema-1/#Model_Groups</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">Nillable</xsl:with-param>
+ <xsl:with-param name="term">Nillable</xsl:with-param>
+ <xsl:with-param name="description">
+ <xsl:text>(Applies to element declarations). </xsl:text>
+ <xsl:text>If an element declaration is nillable, instances can use the </xsl:text>
+ <code>xsi:nil</code>
+ <xsl:text> attribute.</xsl:text>
+ <xsl:text> The </xsl:text>
+ <code>xsi:nil</code>
+ <xsl:text> attribute is the boolean attribute, </xsl:text>
+ <em>nil</em>
+ <xsl:text>, from the </xsl:text>
+ <em>http://www.w3.org/2001/XMLSchema-instance</em>
+ <xsl:text> namespace.</xsl:text>
+ <xsl:text> If an element instance has an </xsl:text>
+ <code>xsi:nil</code>
+ <xsl:text> attribute set to true, it can be left empty, even though its element declaration may have required content.</xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">Notation</xsl:with-param>
+ <xsl:with-param name="term">Notation</xsl:with-param>
+ <xsl:with-param name="description">A notation is used to identify the format of a piece of data. Values of elements and attributes that are of type, NOTATION, must come from the names of declared notations.</xsl:with-param>
+ <xsl:with-param name="link">http://www.w3.org/TR/xmlschema-1/#cNotation_Declarations</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">PreserveWS</xsl:with-param>
+ <xsl:with-param name="term">Preserve Whitespace Policy</xsl:with-param>
+ <xsl:with-param name="description">Preserve whitespaces exactly as they appear in instances.</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">TypeFinal</xsl:with-param>
+ <xsl:with-param name="term">Prohibited Derivations</xsl:with-param>
+ <xsl:with-param name="description">
+ <xsl:text>(Applies to type definitions). </xsl:text>
+ <xsl:text>Derivation methods that cannot be used to create sub-types from a given type definition.</xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">TypeBlock</xsl:with-param>
+ <xsl:with-param name="term">Prohibited Substitutions</xsl:with-param>
+ <xsl:with-param name="description">
+ <xsl:text>(Applies to complex type definitions). </xsl:text>
+ <xsl:text>Prevents sub-types that have been derived using the specified derivation methods from validating element instances in place of the given type definition.</xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">ReplaceWS</xsl:with-param>
+ <xsl:with-param name="term">Replace Whitespace Policy</xsl:with-param>
+ <xsl:with-param name="description">Replace tab, line feed, and carriage return characters with space character (Unicode character 32).</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">Sequence</xsl:with-param>
+ <xsl:with-param name="term">Sequence Model Group</xsl:with-param>
+ <xsl:with-param name="description">
+ <xsl:text>Child elements and model groups must be provided </xsl:text>
+ <em>
+ <xsl:text>in the specified order</xsl:text>
+ </em>
+ <xsl:text> in instances.</xsl:text>
+ </xsl:with-param>
+ <xsl:with-param name="link">http://www.w3.org/TR/xmlschema-1/#element-sequence</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">SubGroup</xsl:with-param>
+ <xsl:with-param name="term">Substitution Group</xsl:with-param>
+ <xsl:with-param name="description">
+ <xsl:text>Elements that are </xsl:text>
+ <em>
+ <xsl:text>members</xsl:text>
+ </em>
+ <xsl:text> of a substitution group can be used wherever the </xsl:text>
+ <em>
+ <xsl:text>head</xsl:text>
+ </em>
+ <xsl:text> element of the substitution group is referenced.</xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">ElemFinal</xsl:with-param>
+ <xsl:with-param name="term">Substitution Group Exclusions</xsl:with-param>
+ <xsl:with-param name="description">
+ <xsl:text>(Applies to element declarations). </xsl:text>
+ <xsl:text>Prohibits element declarations from nominating themselves as being able to substitute a given element declaration, if they have types that are derived from the original element's type using the specified derivation methods.</xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">TargetNS</xsl:with-param>
+ <xsl:with-param name="term">Target Namespace</xsl:with-param>
+ <xsl:with-param name="description">The target namespace identifies the namespace that components in this schema belongs to. If no target namespace is provided, then the schema components do not belong to any namespace.</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:call-template name="PrintGlossaryTerm">
+ <xsl:with-param name="code">Unique</xsl:with-param>
+ <xsl:with-param name="term">Uniqueness Constraint</xsl:with-param>
+ <xsl:with-param name="description">Ensures uniqueness of an element/attribute value, or a combination of values, within a specified scope.</xsl:with-param>
+ <xsl:with-param name="link">http://www.w3.org/TR/xmlschema-1/#cIdentity-constraint_Definitions</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Prints out a term in the glossary section.
+ Param(s):
+ code (String) required
+ Unique ID of glossary term
+ term (String) required
+ Glossary term
+ description (Result Tree Fragment) required
+ Meaning of term; may contain HTML tags and links
+ link (String) optional
+ URI containing more info about term
+ -->
+ <xsl:template name="PrintGlossaryTerm">
+ <xsl:param name="code"/>
+ <xsl:param name="term"/>
+ <xsl:param name="description"/>
+ <xsl:param name="link"/>
+
+ <p>
+ <span class="glossaryTerm">
+ <a name="{concat($TERM_PREFIX, $code)}"><xsl:value-of select="$term"/></a>
+ <xsl:text> </xsl:text>
+ </span>
+ <xsl:copy-of select="$description"/>
+ <xsl:if test="$link != ''">
+ <xsl:text> See: </xsl:text>
+ <xsl:call-template name="PrintURI">
+ <xsl:with-param name="uri" select="$link"/>
+ </xsl:call-template>
+ <xsl:text>.</xsl:text>
+ </xsl:if>
+ </p>
+ </xsl:template>
+
+
+ <!-- ******** Hierarchy table ******** -->
+
+ <!--
+ Prints out substitution group hierarchy for
+ element declarations.
+ -->
+ <xsl:template match="xsd:element" mode="hierarchy">
+ <!--
+ Find out members of substitution group that this element
+ heads.
+ -->
+ <xsl:variable name="members">
+ <ul>
+ <xsl:call-template name="PrintSGroupMembers">
+ <xsl:with-param name="element" select="."/>
+ </xsl:call-template>
+ </ul>
+ </xsl:variable>
+ <xsl:variable name="hasMembers">
+ <xsl:if test="normalize-space($members)!=''">
+ <xsl:text>true</xsl:text>
+ </xsl:if>
+ </xsl:variable>
+ <!-- Print hierarchy table -->
+ <xsl:if test="@substitutionGroup or normalize-space($hasMembers)='true'">
+ <table class="hierarchy">
+ <tr>
+ <td>
+ <ul>
+ <!-- Print substitution group that this element belongs to -->
+ <xsl:if test="@substitutionGroup">
+ <li>
+ <em>This element can be used wherever the following element is referenced:</em>
+ <ul>
+ <li>
+ <xsl:call-template name="PrintElementRef">
+ <xsl:with-param name="ref" select="@substitutionGroup"/>
+ </xsl:call-template>
+ </li>
+ </ul>
+ </li>
+ </xsl:if>
+ <!-- Print substitution group that this element heads -->
+ <xsl:if test="normalize-space($hasMembers)='true'">
+ <li>
+ <em>The following elements can be used wherever this element is referenced:</em>
+ <xsl:copy-of select="$members"/>
+ </li>
+ </xsl:if>
+ </ul>
+ </td>
+ </tr>
+ </table>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Prints out Hierarchy table for complex type definitions.
+ -->
+ <xsl:template match="xsd:complexType" mode="hierarchy">
+ <table class="hierarchy">
+ <!-- Print super types -->
+ <tr>
+ <th>
+ <xsl:choose>
+ <xsl:when test="normalize-space(translate($printAllSuperTypes, 'TRUE', 'true'))='true'">
+ <xsl:text>Super-types:</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>Parent type:</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </th>
+ <td>
+ <xsl:choose>
+ <xsl:when test="xsd:simpleContent or xsd:complexContent">
+ <xsl:call-template name="PrintSupertypes">
+ <xsl:with-param name="type" select="."/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>None</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </td>
+ </tr>
+ <!-- Print sub types -->
+ <tr>
+ <th>
+ <xsl:choose>
+ <xsl:when test="normalize-space(translate($printAllSubTypes, 'TRUE', 'true'))='true'">
+ <xsl:text>Sub-types:</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>Direct sub-types:</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </th>
+ <td>
+ <xsl:call-template name="PrintComplexSubtypes">
+ <xsl:with-param name="type" select="."/>
+ </xsl:call-template>
+ </td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <!--
+ Prints out Hierarchy table for simple type definitions.
+ -->
+ <xsl:template match="xsd:simpleType" mode="hierarchy">
+ <table class="hierarchy">
+ <!-- Print super types -->
+ <tr>
+ <th>
+ <xsl:choose>
+ <xsl:when test="normalize-space(translate($printAllSuperTypes, 'TRUE', 'true'))='true'">
+ <xsl:text>Super-types:</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>Parent type:</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </th>
+ <td>
+ <xsl:choose>
+ <xsl:when test="xsd:restriction">
+ <xsl:call-template name="PrintSupertypes">
+ <xsl:with-param name="type" select="."/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>None</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </td>
+ </tr>
+ <!-- Print sub types -->
+ <tr>
+ <th>
+ <xsl:choose>
+ <xsl:when test="normalize-space(translate($printAllSubTypes, 'TRUE', 'true'))='true'">
+ <xsl:text>Sub-types:</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>Direct sub-types:</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </th>
+ <td>
+ <xsl:call-template name="PrintSimpleSubtypes">
+ <xsl:with-param name="type" select="."/>
+ </xsl:call-template>
+ </td>
+ </tr>
+ </table>
+ </xsl:template>
+
+ <!--
+ Unmatched template for 'hierarchy' mode
+ -->
+ <xsl:template match="*" mode="hierarchy"/>
+
+ <!--
+ Prints out members, if any, of the substitution group that a
+ given element declaration heads.
+ Assumes it will be called within XHTML <ul> tags.
+ Param(s):
+ element (Node) required
+ Top-level element declaration
+ elementList (String) optional
+ List of elements in this call chain. Name of element starts
+ with '*', and ends with '+'. (Used to prevent infinite
+ recursive loop.)
+ -->
+ <xsl:template name="PrintSGroupMembers">
+ <xsl:param name="element"/>
+ <xsl:param name="elementList"/>
+
+ <xsl:variable name="elemName" select="normalize-space($element/@name)"/>
+ <xsl:choose>
+ <xsl:when test="contains($elementList, concat('*', $elemName, '+'))">
+ <!-- Circular element substitution group hierarchy -->
+ <li>
+ <xsl:call-template name="HandleError">
+ <xsl:with-param name="isTerminating">false</xsl:with-param>
+ <xsl:with-param name="errorMsg">
+ <xsl:text>Circular element reference to: </xsl:text>
+ <xsl:value-of select="$elemName"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </li>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Get 'block' attribute. -->
+ <xsl:variable name="block">
+ <xsl:call-template name="PrintBlockSet">
+ <xsl:with-param name="EBV">
+ <xsl:choose>
+ <xsl:when test="$element/@block">
+ <xsl:value-of select="$element/@block"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="/xsd:schema/@blockDefault"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:for-each select="/xsd:schema/xsd:element[normalize-space(@substitutionGroup)=$elemName or normalize-space(substring-after(@substitutionGroup, ':'))=$elemName]">
+ <li>
+ <xsl:call-template name="PrintElementRef">
+ <xsl:with-param name="name" select="@name"/>
+ </xsl:call-template>
+ </li>
+ <!-- Recursively find members of a substitution group that
+ current element in list might head, since substitution
+ groups are transitive (unless 'substitution' is
+ blocked).
+ -->
+ <xsl:if test="not(contains($block, 'substitution'))">
+ <xsl:call-template name="PrintSGroupMembers">
+ <xsl:with-param name="element" select="."/>
+ <xsl:with-param name="elementList" select="concat($elementList, '*', $elemName, '+')"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Prints out the super types of a given type definition.
+ Param(s):
+ type (Node) required
+ Type definition
+ isCallingType (boolean) optional
+ If true, 'type' is the type definition that starts
+ this call. Otherwise, this is a recursive call from
+ 'PrintSupertypes' itself.
+ typeList (String) optional
+ List of types in this call chain. Name of type starts
+ with '*', and ends with '+'. (Used to prevent infinite
+ recursive loop.)
+ -->
+ <xsl:template name="PrintSupertypes">
+ <xsl:param name="type"/>
+ <xsl:param name="isCallingType">true</xsl:param>
+ <xsl:param name="typeList"/>
+
+ <xsl:variable name="typeName" select="$type/@name"/>
+ <xsl:choose>
+ <!-- Circular type hierarchy -->
+ <xsl:when test="contains($typeList, concat('*', $typeName, '+'))">
+ <!-- Note: Error message will be written out in the Sample Instance table. -->
+ <xsl:value-of select="$typeName"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Get base type reference -->
+ <xsl:variable name="baseTypeRef">
+ <xsl:choose>
+ <!-- Complex type definition -->
+ <xsl:when test="local-name($type)='complexType'">
+ <xsl:choose>
+ <xsl:when test="$type/xsd:simpleContent/xsd:extension">
+ <xsl:value-of select="$type/xsd:simpleContent/xsd:extension/@base"/>
+ </xsl:when>
+ <xsl:when test="$type/xsd:simpleContent/xsd:restriction">
+ <xsl:value-of select="$type/xsd:simpleContent/xsd:restriction/@base"/>
+ </xsl:when>
+ <xsl:when test="$type/xsd:complexContent/xsd:extension">
+ <xsl:value-of select="$type/xsd:complexContent/xsd:extension/@base"/>
+ </xsl:when>
+ <xsl:when test="$type/xsd:complexContent/xsd:restriction">
+ <xsl:value-of select="$type/xsd:complexContent/xsd:restriction/@base"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <!-- Simple type definition -->
+ <xsl:when test="local-name($type)='simpleType'">
+ <xsl:choose>
+ <xsl:when test="$type/xsd:restriction/@base">
+ <xsl:value-of select="$type/xsd:restriction/@base"/>
+ </xsl:when>
+ <xsl:when test="$type/xsd:restriction/xsd:simpleType">
+ <xsl:text>Local type definition</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- Get derivation method -->
+ <xsl:variable name="derive">
+ <!-- Complex type definition -->
+ <xsl:choose>
+ <xsl:when test="local-name($type)='complexType'">
+ <xsl:choose>
+ <xsl:when test="$type/xsd:simpleContent/xsd:extension or $type/xsd:complexContent/xsd:extension">
+ <xsl:text>extension</xsl:text>
+ </xsl:when>
+ <xsl:when test="$type/xsd:simpleContent/xsd:restriction or $type/xsd:complexContent/xsd:restriction">
+ <xsl:text>restriction</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <!-- Simple type definition -->
+ <xsl:when test="local-name($type)='simpleType'">
+ <xsl:text>restriction</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:choose>
+ <!-- Print out entire hierarchy -->
+ <xsl:when test="normalize-space(translate($printAllSuperTypes, 'TRUE', 'true'))='true'">
+ <xsl:choose>
+ <xsl:when test="normalize-space($baseTypeRef)='Local type definition'">
+ <xsl:value-of select="$baseTypeRef"/>
+ <!-- Symbol to indicate type derivation-->
+ <xsl:text> &lt; </xsl:text>
+ </xsl:when>
+ <xsl:when test="normalize-space($baseTypeRef)!=''">
+ <!-- Get base type name from reference -->
+ <xsl:variable name="baseTypeName">
+ <xsl:call-template name="GetRefName">
+ <xsl:with-param name="ref" select="$baseTypeRef"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- Get base type definition from schema -->
+ <xsl:variable name="baseType" select="key('type', $baseTypeName)"/>
+ <xsl:choose>
+ <!-- Base type was found in this schema -->
+ <xsl:when test="$baseType">
+ <!-- Make recursive call to print out base type and itself -->
+ <xsl:call-template name="PrintSupertypes">
+ <xsl:with-param name="type" select="$baseType"/>
+ <xsl:with-param name="isCallingType">false</xsl:with-param>
+ <xsl:with-param name="typeList" select="concat($typeList, '*', $typeName, '+')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Base type was not found in this schema -->
+ <xsl:otherwise>
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="$baseTypeRef"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!-- Symbol to indicate type derivation -->
+ <xsl:text> &lt; </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- IGNORE: Base type may not be exist probably because
+ current type does not be derived from another type.
+ -->
+ </xsl:otherwise>
+ </xsl:choose>
+ <!-- Print out current type's name -->
+ <xsl:choose>
+ <xsl:when test="$isCallingType='true'">
+ <strong><xsl:value-of select="$typeName"/></strong>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="name" select="$typeName"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!-- Print out derivation method -->
+ <xsl:if test="$derive != ''">
+ <xsl:text> (by </xsl:text>
+ <xsl:value-of select="$derive"/>
+ <xsl:text>)</xsl:text>
+ </xsl:if>
+ </xsl:when>
+ <!-- Print out parent type only -->
+ <xsl:otherwise>
+ <!-- Print out base type reference -->
+ <xsl:choose>
+ <xsl:when test="normalize-space($baseTypeRef)='Local type definition'">
+ <xsl:value-of select="$baseTypeRef"/>
+ </xsl:when>
+ <xsl:when test="$baseTypeRef!=''">
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="$baseTypeRef"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- IGNORE: Base type may not be exist probably because
+ current type does not be derived from another type.
+ -->
+ </xsl:otherwise>
+ </xsl:choose>
+ <!-- Print out derivation method -->
+ <xsl:if test="$derive != ''">
+ <xsl:text> (derivation method: </xsl:text>
+ <xsl:value-of select="$derive"/>
+ <xsl:text>)</xsl:text>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Prints out the sub types of a given complex type definition.
+ Param(s):
+ type (Node) required
+ Complex type definition
+ isCallingType (boolean) optional
+ If true, 'type' is the type definition that starts this
+ call. Otherwise, this is a recursive call from
+ 'PrintComplexSubtypes' itself.
+ typeList (String) optional
+ List of types in this call chain. Name of type starts
+ with '*', and ends with '+'. (Used to prevent infinite
+ recursive loop.)
+ -->
+ <xsl:template name="PrintComplexSubtypes">
+ <xsl:param name="type"/>
+ <xsl:param name="isCallingType">true</xsl:param>
+ <xsl:param name="typeList"/>
+
+ <xsl:variable name="typeName" select="normalize-space($type/@name)"/>
+ <xsl:choose>
+ <!-- Circular type hierarchy -->
+ <xsl:when test="contains($typeList, concat('*', $typeName, '+'))">
+ <!-- Do nothing. Note: Error message will be written out in the Sample Instance table. -->
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Find sub types -->
+ <xsl:variable name="subTypes">
+ <ul>
+ <xsl:for-each select="/xsd:schema/xsd:complexType/xsd:complexContent/xsd:restriction[normalize-space(@base)=$typeName or normalize-space(substring-after(@base, ':'))=$typeName] | /xsd:schema/xsd:complexType/xsd:complexContent/xsd:extension[normalize-space(@base)=$typeName or normalize-space(substring-after(@base, ':'))=$typeName]">
+ <li>
+ <xsl:variable name="subType" select="../.."/>
+ <!-- Write out type name -->
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="name" select="$subType/@name"/>
+ </xsl:call-template>
+ <!-- Write derivation method -->
+ <xsl:text> (by </xsl:text>
+ <xsl:value-of select="local-name(.)"/>
+ <xsl:text>)</xsl:text>
+ <!-- Make recursive call to write sub-types of this sub-type -->
+ <xsl:if test="normalize-space(translate($printAllSubTypes, 'TRUE', 'true'))='true'">
+ <xsl:call-template name="PrintComplexSubtypes">
+ <xsl:with-param name="type" select="$subType"/>
+ <xsl:with-param name="isCallingType">false</xsl:with-param>
+ <xsl:with-param name="typeList" select="concat($typeList, '*', $typeName, '+')"/>
+ </xsl:call-template>
+ </xsl:if>
+ </li>
+ </xsl:for-each>
+ </ul>
+ </xsl:variable>
+ <!-- Print out sub types -->
+ <xsl:choose>
+ <xsl:when test="normalize-space($subTypes)!=''">
+ <xsl:copy-of select="$subTypes"/>
+ </xsl:when>
+ <xsl:when test="$isCallingType='true'">
+ <xsl:text>None</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Prints out the sub types of a given simple type definition.
+ Param(s):
+ type (Node) required
+ Simple type definition
+ isCallingType (boolean) optional
+ If true, 'type' is the type definition that starts this
+ call. Otherwise, this is a recursive call from
+ 'PrintSimpleSubtypes'
+ typeList (String) optional
+ List of types in this call chain. Name of type starts
+ with '*', and ends with '+'. (Used to prevent infinite
+ recursive loop.)
+ -->
+ <xsl:template name="PrintSimpleSubtypes">
+ <xsl:param name="type"/>
+ <xsl:param name="isCallingType">true</xsl:param>
+ <xsl:param name="typeList"/>
+
+ <xsl:variable name="typeName" select="normalize-space($type/@name)"/>
+ <xsl:choose>
+ <!-- Circular type hierarchy -->
+ <xsl:when test="contains($typeList, concat('*', $typeName, '+'))">
+ <!-- Do nothing. Note: Error message will be written out in the Sample Instance table. -->
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Find sub-types that are simple type definitions -->
+ <xsl:variable name="simpleSubTypes">
+ <ul>
+ <xsl:for-each select="/xsd:schema/xsd:simpleType/xsd:restriction[normalize-space(@base)=$typeName or normalize-space(substring-after(@base, ':'))=$typeName]">
+ <li>
+ <xsl:variable name="subType" select=".."/>
+ <!-- Write out type name -->
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="name" select="$subType/@name"/>
+ </xsl:call-template>
+ <!-- Write derivation method -->
+ <xsl:text> (by restriction)</xsl:text>
+ <!-- Make recursive call to write sub-types of this sub-type -->
+ <xsl:if test="normalize-space(translate($printAllSubTypes, 'TRUE', 'true'))='true'">
+ <xsl:call-template name="PrintSimpleSubtypes">
+ <xsl:with-param name="type" select="$subType"/>
+ <xsl:with-param name="isCallingType">false</xsl:with-param>
+ <xsl:with-param name="typeList" select="concat($typeList, '*', $typeName, '+')"/>
+ </xsl:call-template>
+ </xsl:if>
+ </li>
+ </xsl:for-each>
+ </ul>
+ </xsl:variable>
+ <!-- Find sub-types that are complex type definitions -->
+ <xsl:variable name="complexSubTypes">
+ <ul>
+ <xsl:for-each select="/xsd:schema/xsd:complexType/xsd:simpleContent/xsd:restriction[normalize-space(@base)=$typeName or normalize-space(substring-after(@base, ':'))=$typeName] | /xsd:schema/xsd:complexType/xsd:simpleContent/xsd:extension[normalize-space(@base)=$typeName or normalize-space(substring-after(@base, ':'))=$typeName]">
+ <li>
+ <xsl:variable name="subType" select="../.."/>
+ <!-- Write out type name -->
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="name" select="$subType/@name"/>
+ </xsl:call-template>
+ <!-- Write derivation method -->
+ <xsl:text> (by </xsl:text>
+ <xsl:value-of select="local-name(.)"/>
+ <xsl:text>)</xsl:text>
+ <!-- Make recursive call to write sub-types of this sub-type -->
+ <xsl:if test="normalize-space(translate($printAllSubTypes, 'TRUE', 'true'))='true'">
+ <xsl:call-template name="PrintComplexSubtypes">
+ <xsl:with-param name="type" select="$subType"/>
+ <xsl:with-param name="isCallingType">false</xsl:with-param>
+ <xsl:with-param name="typeList" select="concat($typeList, '*', $typeName, '+')"/>
+ </xsl:call-template>
+ </xsl:if>
+ </li>
+ </xsl:for-each>
+ </ul>
+ </xsl:variable>
+
+ <xsl:variable name="hasSimpleSubTypes">
+ <xsl:if test="normalize-space($simpleSubTypes)!=''">
+ <xsl:text>true</xsl:text>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="hasComplexSubTypes">
+ <xsl:if test="normalize-space($complexSubTypes)!=''">
+ <xsl:text>true</xsl:text>
+ </xsl:if>
+ </xsl:variable>
+ <!-- Print out sub types -->
+ <xsl:choose>
+ <xsl:when test="$hasSimpleSubTypes='true' or $hasComplexSubTypes='true'">
+ <xsl:if test="$hasSimpleSubTypes='true'">
+ <xsl:copy-of select="$simpleSubTypes"/>
+ </xsl:if>
+ <xsl:if test="$hasComplexSubTypes='true'">
+ <xsl:copy-of select="$complexSubTypes"/>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="$isCallingType='true'">
+ <xsl:text>None</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <!-- ******** Properties table ******** -->
+
+ <!--
+ Prints out the contents of an 'appinfo' or a 'documentation'
+ element in the Properties table.
+ -->
+ <xsl:template match="xsd:appinfo | xsd:documentation" mode="properties">
+ <!-- Print out children using XML pretty printer templates -->
+ <xsl:choose>
+ <xsl:when test="local-name(.)='appinfo'">
+ <xsl:apply-templates select="* | text()" mode="xpp"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="* | text()" mode="html"/>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <!-- Print out URL in the source attribute. -->
+ <xsl:if test="@source">
+ <xsl:if test="* | text()"><br/></xsl:if>
+ <xsl:text> More information at: </xsl:text>
+ <xsl:call-template name="PrintURI">
+ <xsl:with-param name="uri" select="@source"/>
+ </xsl:call-template>
+ <xsl:text>.</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Prints out the Properties table for a top-level
+ attribute declaration.
+ -->
+ <xsl:template match="xsd:attribute" mode="properties">
+ <table class="properties">
+ <!-- Name -->
+ <tr>
+ <th>Name</th>
+ <td><xsl:value-of select="@name"/></td>
+ </tr>
+ <!-- Type -->
+ <tr>
+ <th>Type</th>
+ <td>
+ <xsl:choose>
+ <xsl:when test="xsd:simpleType">
+ <xsl:text>Locally-defined simple type</xsl:text>
+ </xsl:when>
+ <xsl:when test="@type">
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="@type"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>anySimpleType</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </td>
+ </tr>
+ <!-- Default Value -->
+ <xsl:if test="@default">
+ <tr>
+ <th>Default Value</th>
+ <td><xsl:value-of select="@default"/></td>
+ </tr>
+ </xsl:if>
+ <!-- Fixed Value -->
+ <xsl:if test="@fixed">
+ <tr>
+ <th>Fixed Value</th>
+ <td><xsl:value-of select="@fixed"/></td>
+ </tr>
+ </xsl:if>
+ <!-- Annotation -->
+ <xsl:call-template name="PrintAnnotation">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </table>
+ </xsl:template>
+
+ <!--
+ Prints out Properties table for a top-level
+ attribute group or model group definition.
+ -->
+ <xsl:template match="xsd:attributeGroup | xsd:group" mode="properties">
+ <table class="properties">
+ <!-- Name -->
+ <tr>
+ <th>Name</th>
+ <td><xsl:value-of select="@name"/></td>
+ </tr>
+ <!-- Annotation -->
+ <xsl:call-template name="PrintAnnotation">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </table>
+ </xsl:template>
+
+ <!--
+ Prints out the Properties table for a top-level
+ complex type definition.
+ -->
+ <xsl:template match="xsd:complexType" mode="properties">
+ <table class="properties">
+ <!-- Name -->
+ <tr>
+ <th>Name</th>
+ <td><xsl:value-of select="@name"/></td>
+ </tr>
+ <!-- Abstract -->
+ <tr>
+ <th>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">Abstract</xsl:with-param>
+ <xsl:with-param name="term">Abstract</xsl:with-param>
+ </xsl:call-template>
+ </th>
+ <td>
+ <xsl:call-template name="PrintBoolean">
+ <xsl:with-param name="boolean" select="@abstract"/>
+ </xsl:call-template>
+ </td>
+ </tr>
+ <!-- Final -->
+ <xsl:variable name="final">
+ <xsl:call-template name="PrintDerivationSet">
+ <xsl:with-param name="EBV">
+ <xsl:choose>
+ <xsl:when test="@final">
+ <xsl:value-of select="@final"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="/xsd:schema/@finalDefault"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="normalize-space($final)!=''">
+ <tr>
+ <th>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">TypeFinal</xsl:with-param>
+ <xsl:with-param name="term">Prohibited Derivations</xsl:with-param>
+ </xsl:call-template>
+ </th>
+ <td><xsl:value-of select="$final"/></td>
+ </tr>
+ </xsl:if>
+ <!-- Block -->
+ <xsl:variable name="block">
+ <xsl:call-template name="PrintDerivationSet">
+ <xsl:with-param name="EBV">
+ <xsl:choose>
+ <xsl:when test="@block">
+ <xsl:value-of select="@block"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="/xsd:schema/@blockDefault"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="normalize-space($block)!=''">
+ <tr>
+ <th>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">TypeBlock</xsl:with-param>
+ <xsl:with-param name="term">Prohibited Substitutions</xsl:with-param>
+ </xsl:call-template>
+ </th>
+ <td><xsl:value-of select="$block"/></td>
+ </tr>
+ </xsl:if>
+ <!-- Annotation -->
+ <xsl:call-template name="PrintAnnotation">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </table>
+ </xsl:template>
+
+ <!--
+ Prints out the Properties table for a top-level
+ element declaration.
+ -->
+ <xsl:template match="xsd:element" mode="properties">
+ <table class="properties">
+ <!-- Name -->
+ <tr>
+ <th>Name</th>
+ <td><xsl:value-of select="@name"/></td>
+ </tr>
+ <!-- Type -->
+ <tr>
+ <th>Type</th>
+ <td>
+ <xsl:choose>
+ <xsl:when test="xsd:simpleType">
+ <xsl:text>Locally-defined simple type</xsl:text>
+ </xsl:when>
+ <xsl:when test="xsd:complexType">
+ <xsl:text>Locally-defined complex type</xsl:text>
+ </xsl:when>
+ <xsl:when test="@type">
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="@type"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>anyType</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </td>
+ </tr>
+ <!-- Nillable -->
+ <tr>
+ <th>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">Nillable</xsl:with-param>
+ <xsl:with-param name="term">Nillable</xsl:with-param>
+ </xsl:call-template>
+ </th>
+ <td>
+ <xsl:call-template name="PrintBoolean">
+ <xsl:with-param name="boolean" select="@nillable"/>
+ </xsl:call-template>
+ </td>
+ </tr>
+ <!-- Abstract -->
+ <tr>
+ <th>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">Abstract</xsl:with-param>
+ <xsl:with-param name="term">Abstract</xsl:with-param>
+ </xsl:call-template>
+ </th>
+ <td>
+ <xsl:call-template name="PrintBoolean">
+ <xsl:with-param name="boolean" select="@abstract"/>
+ </xsl:call-template>
+ </td>
+ </tr>
+ <!-- Default Value -->
+ <xsl:if test="@default">
+ <tr>
+ <th>Default Value</th>
+ <td><xsl:value-of select="@default"/></td>
+ </tr>
+ </xsl:if>
+ <!-- Fixed Value -->
+ <xsl:if test="@fixed">
+ <tr>
+ <th>Fixed Value</th>
+ <td><xsl:value-of select="@fixed"/></td>
+ </tr>
+ </xsl:if>
+ <!-- Final -->
+ <xsl:variable name="final">
+ <xsl:call-template name="PrintDerivationSet">
+ <xsl:with-param name="EBV">
+ <xsl:choose>
+ <xsl:when test="@final">
+ <xsl:value-of select="@final"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="/xsd:schema/@finalDefault"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="normalize-space($final)!=''">
+ <tr>
+ <th>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">ElemFinal</xsl:with-param>
+ <xsl:with-param name="term">Substitution Group Exclusions</xsl:with-param>
+ </xsl:call-template>
+ </th>
+ <td><xsl:value-of select="$final"/></td>
+ </tr>
+ </xsl:if>
+ <!-- Block -->
+ <xsl:variable name="block">
+ <xsl:call-template name="PrintBlockSet">
+ <xsl:with-param name="EBV">
+ <xsl:choose>
+ <xsl:when test="@block">
+ <xsl:value-of select="@block"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="/xsd:schema/@blockDefault"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="normalize-space($block)!=''">
+ <tr>
+ <th>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">ElemBlock</xsl:with-param>
+ <xsl:with-param name="term">Disallowed Substitutions</xsl:with-param>
+ </xsl:call-template>
+ </th>
+ <td><xsl:value-of select="$block"/></td>
+ </tr>
+ </xsl:if>
+ <!-- Annotation -->
+ <xsl:call-template name="PrintAnnotation">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </table>
+ </xsl:template>
+
+ <!--
+ Prints out the Properties table for a top-level
+ notation declaration.
+ -->
+ <xsl:template match="xsd:notation" mode="properties">
+ <table class="properties">
+ <!-- Name -->
+ <tr>
+ <th>Name</th>
+ <td><xsl:value-of select="@name"/></td>
+ </tr>
+ <!-- Public Identifier -->
+ <tr>
+ <th>Public Identifier</th>
+ <td><xsl:value-of select="@public"/></td>
+ </tr>
+ <!-- System Identifier -->
+ <xsl:if test="@system">
+ <tr>
+ <th>System Identifier</th>
+ <td><xsl:value-of select="@system"/></td>
+ </tr>
+ </xsl:if>
+ <!-- Annotation -->
+ <xsl:call-template name="PrintAnnotation">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </table>
+ </xsl:template>
+
+ <!--
+ Prints out the Properties table for the root
+ schema element.
+ -->
+ <xsl:template match="xsd:schema" mode="properties">
+ <table class="properties">
+ <!-- Target Namespace -->
+ <tr>
+ <th>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">TargetNS</xsl:with-param>
+ <xsl:with-param name="term">Target Namespace</xsl:with-param>
+ </xsl:call-template>
+ </th>
+ <td>
+ <xsl:choose>
+ <xsl:when test="@targetNamespace">
+ <span class="targetNS">
+ <xsl:value-of select="@targetNamespace"/>
+ </span>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>None</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </td>
+ </tr>
+ <!-- Version -->
+ <xsl:if test="@version">
+ <tr>
+ <th>Version</th>
+ <td><xsl:value-of select="@version"/></td>
+ </tr>
+ </xsl:if>
+ <!-- Language -->
+ <xsl:if test="@xml:lang">
+ <tr>
+ <th>Language</th>
+ <td><xsl:value-of select="@xml:lang"/></td>
+ </tr>
+ </xsl:if>
+ <!-- Element/Attribute Form Defaults -->
+ <tr>
+ <th>Element and Attribute Namespaces</th>
+ <td>
+ <ul>
+ <li>Global element and attribute declarations belong to this schema's target namespace.</li>
+ <li>
+ <xsl:choose>
+ <xsl:when test="normalize-space(@elementFormDefault)='qualified'">
+ <xsl:text>By default, local element declarations belong to this schema's target namespace.</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>By default, local element declarations have no namespace.</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </li>
+ <li>
+ <xsl:choose>
+ <xsl:when test="normalize-space(@attributeFormDefault)='qualified'">
+ <xsl:text>By default, local attribute declarations belong to this schema's target namespace.</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>By default, local attribute declarations have no namespace.</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </li>
+ </ul>
+ </td>
+ </tr>
+ <!-- Schema Composition, e.g. include, import, redefine -->
+ <xsl:if test="xsd:include or xsd:import or xsd:redefine">
+ <tr>
+ <th>Schema Composition</th>
+ <td>
+ <ul>
+ <!-- Import -->
+ <xsl:if test="xsd:import">
+ <li>
+ <xsl:text>This schema imports schema(s) from the following namespace(s):</xsl:text>
+ <ul>
+ <xsl:for-each select="xsd:import">
+ <li>
+ <em><xsl:value-of select="@namespace"/></em>
+ <xsl:if test="@schemaLocation">
+ <xsl:text> (at </xsl:text>
+ <xsl:call-template name="PrintSchemaLink">
+ <xsl:with-param name="uri" select="@schemaLocation"/>
+ </xsl:call-template>
+ <xsl:text>)</xsl:text>
+ </xsl:if>
+ </li>
+ </xsl:for-each>
+ </ul>
+ </li>
+ </xsl:if>
+ <!-- Include -->
+ <xsl:if test="xsd:include">
+ <li>
+ <xsl:text>This schema includes components from the following schema document(s):</xsl:text>
+ <ul>
+ <xsl:for-each select="xsd:include">
+ <li>
+ <xsl:call-template name="PrintSchemaLink">
+ <xsl:with-param name="uri" select="@schemaLocation"/>
+ </xsl:call-template>
+ </li>
+ </xsl:for-each>
+ </ul>
+ </li>
+ </xsl:if>
+ <!-- Redefine -->
+ <xsl:if test="xsd:redefine">
+ <li>
+ <xsl:text>This schema includes components from the following schema document(s), where some of the components have been redefined:</xsl:text>
+ <ul>
+ <xsl:for-each select="xsd:redefine">
+ <li>
+ <xsl:call-template name="PrintSchemaLink">
+ <xsl:with-param name="uri" select="@schemaLocation"/>
+ </xsl:call-template>
+ </li>
+ </xsl:for-each>
+ </ul>
+ <xsl:text>See </xsl:text><a href="#Redefinitions">Redefined Schema Components</a><xsl:text> section.</xsl:text>
+ </li>
+ </xsl:if>
+ </ul>
+ </td>
+ </tr>
+ </xsl:if>
+ <!-- Annotation -->
+ <xsl:call-template name="PrintAnnotation">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </table>
+ </xsl:template>
+
+ <!--
+ Prints out the Properties table for a top-level
+ simple type definition.
+ -->
+ <xsl:template match="xsd:simpleType" mode="properties">
+ <table class="properties">
+ <!-- Name -->
+ <tr>
+ <th>Name</th>
+ <td><xsl:value-of select="@name"/></td>
+ </tr>
+ <!-- Constraints -->
+ <tr>
+ <th>Content</th>
+ <td>
+ <xsl:call-template name="PrintSimpleConstraints">
+ <xsl:with-param name="simpleContent" select="."/>
+ </xsl:call-template>
+ </td>
+ </tr>
+ <!-- Final -->
+ <xsl:variable name="final">
+ <xsl:call-template name="PrintSimpleDerivationSet">
+ <xsl:with-param name="EBV">
+ <xsl:choose>
+ <xsl:when test="@final">
+ <xsl:value-of select="@final"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="/xsd:schema/@finalDefault"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="normalize-space($final)!=''">
+ <tr>
+ <th>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">TypeFinal</xsl:with-param>
+ <xsl:with-param name="term">Prohibited Derivations</xsl:with-param>
+ </xsl:call-template>
+ </th>
+ <td><xsl:value-of select="$final"/></td>
+ </tr>
+ </xsl:if>
+ <!-- Annotation -->
+ <xsl:call-template name="PrintAnnotation">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </table>
+ </xsl:template>
+
+ <!--
+ Unmatched template for 'properties' mode
+ -->
+ <xsl:template match="*" mode="properties"/>
+
+ <!--
+ Prints out the rows to display 'annotation' elements of an
+ component in the Properties table. This template assumes it
+ will be called within an HTML 'table' element.
+ Param(s):
+ component (Node) required
+ Schema component
+ -->
+ <xsl:template name="PrintAnnotation">
+ <xsl:param name="component"/>
+
+ <xsl:if test="$component/xsd:annotation/xsd:documentation">
+ <tr>
+ <th>Documentation</th>
+ <td>
+ <xsl:for-each select="$component/xsd:annotation/xsd:documentation">
+ <xsl:if test="position()!=1"><br/><br/></xsl:if>
+ <xsl:apply-templates select="." mode="properties"/>
+ </xsl:for-each>
+ </td>
+ </tr>
+ </xsl:if>
+ <xsl:if test="$component/xsd:annotation/xsd:appinfo">
+ <tr>
+ <th>Application Data</th>
+ <td>
+ <xsl:for-each select="$component/xsd:annotation/xsd:appinfo">
+ <xsl:if test="position()!=1"><br/><br/></xsl:if>
+ <xsl:apply-templates select="." mode="properties"/>
+ </xsl:for-each>
+ </td>
+ </tr>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Prints out the constraints of simple content
+ to be displayed within a Properties table.
+ Param(s):
+ simpleContent (Node) required
+ Node containing the simple content
+ typeList (String) optional
+ List of types in this call chain. Name of type starts
+ with '*', and ends with '+'. (Used to prevent infinite
+ recursive loop.)
+ -->
+ <xsl:template name="PrintSimpleConstraints">
+ <xsl:param name="simpleContent"/>
+ <xsl:param name="typeList"/>
+
+ <xsl:choose>
+ <!-- Derivation by restriction -->
+ <xsl:when test="$simpleContent/xsd:restriction">
+ <xsl:call-template name="PrintSimpleRestriction">
+ <xsl:with-param name="restriction" select="$simpleContent/xsd:restriction"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Derivation by list -->
+ <xsl:when test="$simpleContent/xsd:list">
+ <ul><li>
+ <xsl:text>List of: </xsl:text>
+ <xsl:choose>
+ <!-- Globally-defined item type -->
+ <xsl:when test="$simpleContent/xsd:list/@itemType">
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="$simpleContent/xsd:list/@itemType"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Locally-defined item type -->
+ <xsl:otherwise>
+ <ul>
+ <li>
+ <xsl:text>Locally defined type:</xsl:text>
+ <xsl:call-template name="PrintSimpleConstraints">
+ <xsl:with-param name="simpleContent" select="$simpleContent/xsd:list/xsd:simpleType"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:call-template>
+ </li>
+ </ul>
+ </xsl:otherwise>
+ </xsl:choose>
+ </li></ul>
+ </xsl:when>
+ <!-- Derivation by union -->
+ <xsl:when test="$simpleContent/xsd:union">
+ <ul><li>
+ <xsl:text>Union of following types: </xsl:text>
+ <ul>
+ <!-- Globally-defined member types -->
+ <xsl:if test="$simpleContent/xsd:union/@memberTypes">
+ <xsl:call-template name="PrintWhitespaceList">
+ <xsl:with-param name="value" select="$simpleContent/xsd:union/@memberTypes"/>
+ <xsl:with-param name="compType">type</xsl:with-param>
+ <xsl:with-param name="isInList">true</xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- Locally-defined member types -->
+ <xsl:for-each select="$simpleContent/xsd:union/xsd:simpleType">
+ <li>
+ <xsl:text>Locally defined type:</xsl:text>
+ <xsl:call-template name="PrintSimpleConstraints">
+ <xsl:with-param name="simpleContent" select="."/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:call-template>
+ </li>
+ </xsl:for-each>
+ </ul>
+ </li></ul>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Prints out the constraints of simple content derived by
+ restriction, which is to be displayed in a Properties table.
+ Param(s):
+ restriction (Node) required
+ Node containing the restriction
+ typeList (String) optional
+ List of types in this call chain. Name of type starts
+ with '*', and ends with '+'. (Used to prevent infinite
+ recursive loop.)
+ -->
+ <xsl:template name="PrintSimpleRestriction">
+ <xsl:param name="restriction"/>
+ <xsl:param name="typeList"/>
+
+ <xsl:variable name="typeName" select="$restriction/parent::xsd:simpleType/@name"/>
+
+ <!-- Print out base type info -->
+ <xsl:choose>
+ <!-- Circular type hierarchy -->
+ <xsl:when test="$typeName != '' and contains($typeList, concat('*', $typeName, '+'))">
+ <li>
+ <xsl:call-template name="HandleError">
+ <xsl:with-param name="isTerminating">false</xsl:with-param>
+ <xsl:with-param name="errorMsg">
+ <xsl:text>Circular type reference to '</xsl:text>
+ <xsl:value-of select="$typeName"/>
+ <xsl:text>' in type hierarchy.</xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </li>
+ </xsl:when>
+ <!-- Locally-defined base type -->
+ <xsl:when test="$restriction/xsd:simpleType">
+ <xsl:call-template name="PrintSimpleConstraints">
+ <xsl:with-param name="simpleContent" select="$restriction/xsd:simpleType"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Base type reference -->
+ <xsl:when test="$restriction">
+ <xsl:variable name="baseTypeRef" select="$restriction/@base"/>
+ <xsl:variable name="baseTypeName">
+ <xsl:call-template name="GetRefName">
+ <xsl:with-param name="ref" select="$baseTypeRef"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="baseTypeNS">
+ <xsl:call-template name="GetRefNS">
+ <xsl:with-param name="ref" select="$baseTypeRef"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <!-- Base type is built-in XSD type -->
+ <xsl:when test="$baseTypeNS=$XSD_NS">
+ <ul><li>
+ <xsl:text>Base XSD Type: </xsl:text>
+ <xsl:choose>
+ <!-- Current schema is the schema for XSDL -->
+ <xsl:when test="normalize-space(/xsd:schema/@targetNamespace)=$XSD_NS">
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="$baseTypeRef"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Current schema is not XSD namespace -->
+ <xsl:otherwise>
+ <xsl:value-of select="$baseTypeName"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </li></ul>
+ </xsl:when>
+ <!-- Other types -->
+ <xsl:otherwise>
+ <xsl:variable name="baseType" select="key('simpleType', $baseTypeName)"/>
+ <xsl:choose>
+ <!-- Base type found -->
+ <xsl:when test="$baseType">
+ <xsl:call-template name="PrintSimpleConstraints">
+ <xsl:with-param name="simpleContent" select="$baseType"/>
+ <xsl:with-param name="typeList" select="concat($typeList, '*', $typeName, '+')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Base type not found -->
+ <xsl:otherwise>
+ <ul><li><strong>
+ <xsl:text>'</xsl:text>
+ <xsl:value-of select="$baseTypeName"/>
+ <xsl:text>' super type was not found in this schema. </xsl:text>
+ <xsl:text>Its facets could not be printed out.</xsl:text>
+ </strong></li></ul>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+
+ <!-- Find constraints in current restriction -->
+ <xsl:variable name="enumeration">
+ <xsl:call-template name="PrintEnumFacets">
+ <xsl:with-param name="simpleRestrict" select="$restriction"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="pattern">
+ <xsl:call-template name="PrintPatternFacet">
+ <xsl:with-param name="simpleRestrict" select="$restriction"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="range">
+ <xsl:call-template name="PrintRangeFacets">
+ <xsl:with-param name="simpleRestrict" select="$restriction"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="totalDigits">
+ <xsl:call-template name="PrintTotalDigitsFacet">
+ <xsl:with-param name="simpleRestrict" select="$restriction"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="fractionDigits">
+ <xsl:call-template name="PrintFractionDigitsFacet">
+ <xsl:with-param name="simpleRestrict" select="$restriction"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="length">
+ <xsl:call-template name="PrintLengthFacets">
+ <xsl:with-param name="simpleRestrict" select="$restriction"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="whitespace">
+ <xsl:call-template name="PrintWhitespaceFacet">
+ <xsl:with-param name="simpleRestrict" select="$restriction"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Print out facets -->
+ <xsl:if test="$enumeration!='' or $pattern!='' or $range!='' or $totalDigits!='' or $fractionDigits!='' or $length!='' or $whitespace!=''">
+ <ul>
+ <xsl:if test="$enumeration!=''">
+ <li>
+ <xsl:copy-of select="$enumeration"/>
+ </li>
+ </xsl:if>
+ <xsl:if test="$pattern!=''">
+ <li>
+ <xsl:copy-of select="$pattern"/>
+ </li>
+ </xsl:if>
+ <xsl:if test="$range!=''">
+ <li>
+ <xsl:copy-of select="$range"/>
+ </li>
+ </xsl:if>
+ <xsl:if test="$totalDigits!=''">
+ <li>
+ <xsl:copy-of select="$totalDigits"/>
+ </li>
+ </xsl:if>
+ <xsl:if test="$fractionDigits!=''">
+ <li>
+ <xsl:copy-of select="$fractionDigits"/>
+ </li>
+ </xsl:if>
+ <xsl:if test="$length!=''">
+ <li>
+ <xsl:copy-of select="$length"/>
+ </li>
+ </xsl:if>
+ <xsl:if test="$whitespace!=''">
+ <li>
+ <xsl:copy-of select="$whitespace"/>
+ </li>
+ </xsl:if>
+ </ul>
+ </xsl:if>
+ </xsl:template>
+
+
+ <!-- ******** XML Instance Representation table ******** -->
+
+ <!--
+ Prints out the XML Instance Representation table for a top-level
+ schema component.
+ Param(s):
+ component (Node) required
+ Top-level schema component
+ -->
+ <xsl:template name="SampleInstanceTable">
+ <xsl:param name="component"/>
+
+ <!-- Not applicable for simple type definitions and notation
+ declarations -->
+ <xsl:if test="local-name($component)!='simpleType' and local-name($component)!='notation'">
+ <xsl:variable name="componentID">
+ <xsl:call-template name="GetComponentID">
+ <xsl:with-param name="component" select="$component"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:call-template name="CollapseableBox">
+ <xsl:with-param name="id" select="concat($componentID, '_xibox')"/>
+ <xsl:with-param name="styleClass">sample</xsl:with-param>
+ <xsl:with-param name="caption">XML Instance Representation</xsl:with-param>
+ <xsl:with-param name="contents">
+ <xsl:apply-templates select="$component" mode="sample"/>
+ </xsl:with-param>
+ <xsl:with-param name="isOpened">true</xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Prints out a sample XML instance representation of an 'all'
+ model group.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ isInherited (boolean) optional
+ If true, display elements using 'inherited' CSS class.
+ isNewField (boolean) optional
+ If true, display elements using 'newFields' CSS class.
+ schemaLoc (String) optional
+ Schema file containing this all model group;
+ if in current schema, 'schemaLoc' is set to 'this'
+ typeList (String) optional
+ List of types in this call chain. Name of type starts
+ with '*', and ends with '+'. (Used to prevent infinite
+ recursive loop.)
+ -->
+ <xsl:template match="xsd:all" mode="sample">
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="isInherited">false</xsl:param>
+ <xsl:param name="isNewField">false</xsl:param>
+ <xsl:param name="schemaLoc">this</xsl:param>
+ <xsl:param name="typeList"/>
+
+ <xsl:if test="normalize-space(@maxOccurs)!='0'">
+ <!-- Header -->
+ <span class="group" style="margin-left: {$margin}em">
+ <xsl:text>Start </xsl:text>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">All</xsl:with-param>
+ <xsl:with-param name="term">All</xsl:with-param>
+ </xsl:call-template>
+ <!-- Min/max occurs information-->
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="PrintOccurs">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ <!-- Documentation -->
+ <xsl:call-template name="PrintSampleDocumentation">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </span><br/>
+
+ <!-- Content -->
+ <xsl:apply-templates select="xsd:*" mode="sample">
+ <xsl:with-param name="margin" select="number($margin) + number($ELEM_INDENT)"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:apply-templates>
+
+ <!-- Footer -->
+ <span class="group" style="margin-left: {$margin}em">
+ <xsl:text>End All</xsl:text>
+ </span><br/>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Prints out a sample XML instance representation of an element
+ content wild card.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ -->
+ <xsl:template match="xsd:any | xsd:anyAttribute" mode="sample">
+ <xsl:param name="margin">0</xsl:param>
+
+ <div class="other" style="margin-left: {$margin}em">
+ <xsl:call-template name="PrintWildcard">
+ <xsl:with-param name="componentType">
+ <xsl:choose>
+ <xsl:when test="local-name(.)='anyAttribute'">attribute</xsl:when>
+ <xsl:otherwise>element</xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="namespace" select="@namespace"/>
+ <xsl:with-param name="processContents" select="@processContents"/>
+ <xsl:with-param name="minOccurs" select="@minOccurs"/>
+ <xsl:with-param name="maxOccurs" select="@maxOccurs"/>
+ </xsl:call-template>
+ </div>
+ </xsl:template>
+
+ <!--
+ Prints out a sample XML instance representation
+ of an attribute declaration.
+ Param(s):
+ subTypeAttrs (String) optional
+ List of attributes in sub-types of the type that
+ contains this attribute
+ isInherited (boolean) optional
+ If true, display attribute using 'inherited' CSS
+ class.
+ isNewField (boolean) optional
+ If true, display attribute using 'newFields' CSS
+ class.
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ addBR (boolean) optional
+ If true, add <br/> before attribute.
+ schemaLoc (String) optional
+ Schema file containing this attribute declaration;
+ if in current schema, 'schemaLoc' is set to 'this'.
+ -->
+ <xsl:template match="xsd:attribute[@name]" mode="sample">
+ <xsl:param name="subTypeAttrs"/>
+ <xsl:param name="isInherited">false</xsl:param>
+ <xsl:param name="isNewField">false</xsl:param>
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="addBR">false</xsl:param>
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <!-- Get attribute namespace -->
+ <xsl:variable name="attrNS">
+ <xsl:call-template name="GetAttributeNS">
+ <xsl:with-param name="attribute" select="."/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="contains($subTypeAttrs, concat('*', normalize-space($attrNS), '+', normalize-space(@name), '+'))">
+ <!-- IGNORE: Sub type has attribute with same name;
+ Sub-type's attribute declaration will override this
+ one. -->
+ </xsl:when>
+ <xsl:when test="@use and normalize-space(@use)='prohibited'">
+ <!-- IGNORE: Attribute is prohibited. -->
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$addBR!='false'"><br/></xsl:if>
+
+ <span style="margin-left: {$margin}em">
+ <xsl:choose>
+ <xsl:when test="$isNewField!='false'">
+ <xsl:attribute name="class">newFields</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$isInherited!='false'">
+ <xsl:attribute name="class">inherited</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:text> </xsl:text>
+ <xsl:variable name="prefix">
+ <xsl:call-template name="GetAttributePrefix">
+ <xsl:with-param name="attribute" select="."/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="PrintNSPrefix">
+ <xsl:with-param name="prefix" select="$prefix"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ <xsl:value-of select="@name"/>
+ <xsl:text>="</xsl:text>
+
+ <xsl:choose>
+ <!-- Fixed value is provided -->
+ <xsl:when test="@fixed">
+ <span class="fixed">
+ <xsl:value-of select="@fixed"/>
+ </span>
+ </xsl:when>
+ <!-- Type reference is provided -->
+ <xsl:when test="@type">
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="@type"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Local type definition is provided -->
+ <xsl:when test="xsd:simpleType">
+ <xsl:apply-templates select="xsd:simpleType" mode="sample">
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <span class="type">anySimpleType</span>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <!-- Don't print occurrence info and documentation
+ for global attributes. -->
+ <xsl:if test="local-name(..)!='schema'">
+ <!-- Occurrence info-->
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="PrintOccurs">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ <!-- Documentation -->
+ <xsl:call-template name="PrintSampleDocumentation">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </xsl:if>
+
+ <xsl:text>"</xsl:text>
+ </span>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Prints out a sample XML instance representation
+ of an attribute reference.
+ Param(s):
+ subTypeAttrs (String) optional
+ List of attribute in sub-types of the type that
+ contains this attribute
+ isInherited (boolean) optional
+ If true, display attributes using 'inherited' CSS
+ class.
+ isNewField (boolean) optional
+ If true, display attributes using 'newFields' CSS
+ class.
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ addBR (boolean) optional
+ If true, add <br/> before attribute.
+ schemaLoc (String) optional
+ Schema file containing this attribute reference;
+ if in current schema, 'schemaLoc' is set to 'this'
+ -->
+ <xsl:template match="xsd:attribute[@ref]" mode="sample">
+ <xsl:param name="subTypeAttrs"/>
+ <xsl:param name="isInherited">false</xsl:param>
+ <xsl:param name="isNewField">false</xsl:param>
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="addBR">false</xsl:param>
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <!-- Get attribute name -->
+ <xsl:variable name="attrName">
+ <xsl:call-template name="GetRefName">
+ <xsl:with-param name="ref" select="@ref"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Get attribute namespace -->
+ <xsl:variable name="attrNS">
+ <xsl:call-template name="GetAttributeNS">
+ <xsl:with-param name="attribute" select="."/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="contains($subTypeAttrs, concat('*', normalize-space($attrNS), '+', normalize-space($attrName), '+'))">
+ <!-- IGNORE: Sub type has attribute with same name;
+ Sub-type's attribute declaration will override this
+ one. -->
+ </xsl:when>
+ <xsl:when test="@use and normalize-space(@use)='prohibited'">
+ <!-- IGNORE: Attribute is prohibited. -->
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$addBR!='false'"><br/></xsl:if>
+
+ <span style="margin-left: {$margin}em">
+ <xsl:choose>
+ <xsl:when test="$isNewField!='false'">
+ <xsl:attribute name="class">newFields</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$isInherited!='false'">
+ <xsl:attribute name="class">inherited</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="PrintAttributeRef">
+ <xsl:with-param name="ref" select="@ref"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ <xsl:text>="</xsl:text>
+ <!-- Fixed value is provided -->
+ <xsl:if test="@fixed">
+ <span class="fixed">
+ <xsl:value-of select="@fixed"/>
+ </span>
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ <!-- Print occurs info-->
+ <xsl:call-template name="PrintOccurs">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ <!-- Documentation -->
+ <xsl:call-template name="PrintSampleDocumentation">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+
+ <xsl:text>"</xsl:text>
+ </span>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Prints out a sample XML instance representation of an attribute
+ group definition.
+ Param(s):
+ schemaLoc (String) optional
+ Schema file containing this attribute group
+ definition; if in current schema, 'schemaLoc' is
+ set to 'this'.
+ -->
+ <xsl:template match="xsd:attributeGroup[@name]" mode="sample">
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <xsl:for-each select="xsd:attribute | xsd:attributeGroup | xsd:anyAttribute">
+ <xsl:variable name="addBR">
+ <xsl:choose>
+ <xsl:when test="position()!=1">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>false</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:apply-templates select="." mode="sample">
+ <xsl:with-param name="addBR" select="$addBR"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:apply-templates>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!--
+ Prints out a sample XML instance representation of an attribute
+ group reference.
+ Param(s):
+ subTypeAttrs (String) optional
+ List of attributes in sub-types of the type that
+ contains this attribute group
+ isInherited (boolean) optional
+ If true, display attributes using 'inherited' CSS
+ class.
+ isNewField (boolean) optional
+ If true, display attributes using 'newFields' CSS
+ class.
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ parentGroups (String) optional
+ List of parent attribute group definitions that
+ contain this attribute group. Used to prevent
+ infinite loops when displaying attribute group
+ definitions. In such a case, writes out an error
+ message and stops processing.
+ schemaLoc (String) optional
+ Schema file containing this attribute group
+ reference if in current schema, 'schemaLoc' is
+ set to 'this'.
+ -->
+ <xsl:template match="xsd:attributeGroup[@ref]" mode="sample">
+ <xsl:param name="subTypeAttrs"/>
+ <xsl:param name="isInherited">false</xsl:param>
+ <xsl:param name="isNewField">false</xsl:param>
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="parentGroups"/>
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <!-- Get attribute group name -->
+ <xsl:variable name="attrGrpName">
+ <xsl:call-template name="GetRefName">
+ <xsl:with-param name="ref" select="@ref"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="contains($parentGroups, concat('*', normalize-space($attrGrpName), '+'))">
+ <!-- Circular attribute group definition -->
+ <xsl:call-template name="HandleError">
+ <xsl:with-param name="isTerminating">false</xsl:with-param>
+ <xsl:with-param name="errorMsg">
+ <xsl:text>Circular attribute group reference: </xsl:text>
+ <xsl:value-of select="$attrGrpName"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Look for attribute group definition -->
+ <xsl:variable name="defLoc">
+ <xsl:call-template name="FindComponent">
+ <xsl:with-param name="ref" select="@ref"/>
+ <xsl:with-param name="compType">attribute group</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <!-- Not found -->
+ <xsl:when test="normalize-space($defLoc)='' or normalize-space($defLoc)='none' or normalize-space($defLoc)='xml' or normalize-space($defLoc)='xsd'">
+ <div class="other" style="margin-left: {$margin}em">
+ <xsl:text>Attribute group reference (not shown): </xsl:text>
+ <xsl:call-template name="PrintAttributeGroupRef">
+ <xsl:with-param name="ref" select="@ref"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ <!-- Documentation -->
+ <xsl:call-template name="PrintSampleDocumentation">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </div>
+ </xsl:when>
+ <!-- Found in current schema -->
+ <xsl:when test="normalize-space($defLoc)='this'">
+ <xsl:variable name="attrGrpDef" select="key('attributeGroup', $attrGrpName)"/>
+ <xsl:apply-templates select="$attrGrpDef/xsd:attribute | $attrGrpDef/xsd:attributeGroup" mode="sample">
+ <xsl:with-param name="subTypeAttrs" select="$subTypeAttrs"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="parentGroups" select="concat($parentGroups, concat('*', normalize-space($attrGrpName), '+'))"/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="addBR">true</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <!-- Found in external schema -->
+ <xsl:otherwise>
+ <xsl:variable name="attrGrpDef" select="document($defLoc)/xsd:schema/xsd:attributeGroup[@name=$attrGrpName]"/>
+ <xsl:apply-templates select="$attrGrpDef/xsd:attribute | $attrGrpDef/xsd:attributeGroup" mode="sample">
+ <xsl:with-param name="subTypeAttrs" select="$subTypeAttrs"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="parentGroups" select="concat($parentGroups, concat('*', normalize-space($attrGrpName), '+'))"/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="addBR">true</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$defLoc"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Prints out a sample XML instance representation of a 'choice'
+ model group.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ isInherited (boolean) optional
+ If true, display elements using'inherited' CSS class.
+ isNewField (boolean) optional
+ If true, display elements using 'newFields' CSS class.
+ parentGroups (String) optional
+ List of parent model group definitions that contain this
+ model group. Used to prevent infinite loops when
+ displaying model group definitions.
+ schemaLoc (String) optional
+ Schema file containing this choice model group;
+ if in current schema, 'schemaLoc' is set to 'this'
+ typeList (String) optional
+ List of types in this call chain. Name of type starts
+ with '*', and ends with '+'. (Used to prevent infinite
+ recursive loop.)
+ -->
+ <xsl:template match="xsd:choice" mode="sample">
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="isInherited">false</xsl:param>
+ <xsl:param name="isNewField">false</xsl:param>
+ <xsl:param name="parentGroups"/>
+ <xsl:param name="schemaLoc">this</xsl:param>
+ <xsl:param name="typeList"/>
+
+ <xsl:if test="normalize-space(@maxOccurs)!='0'">
+ <!-- Header -->
+ <span class="group" style="margin-left: {$margin}em">
+ <xsl:text>Start </xsl:text>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">Choice</xsl:with-param>
+ <xsl:with-param name="term">Choice</xsl:with-param>
+ </xsl:call-template>
+ <!-- Min/max occurrence -->
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="PrintOccurs">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ <!-- Documentation -->
+ <xsl:call-template name="PrintSampleDocumentation">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </span><br/>
+
+ <!-- Content -->
+ <xsl:apply-templates select="xsd:*" mode="sample">
+ <xsl:with-param name="margin" select="number($margin)+number($ELEM_INDENT)"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="parentGroups" select="$parentGroups"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:apply-templates>
+
+ <!-- Footer -->
+ <span class="group" style="margin-left: {$margin}em">
+ <xsl:text>End Choice</xsl:text>
+ </span><br/>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Prints out a sample XML instance from a complex type definition.
+ Param(s):
+ schemaLoc (String) optional
+ Schema file containing this complex type definition;
+ if in current schema, 'schemaLoc' is set to 'this'.
+ -->
+ <xsl:template match="xsd:complexType" mode="sample">
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <xsl:call-template name="PrintSampleComplexElement">
+ <xsl:with-param name="type" select="."/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Prints out a sample XML instance from an element declaration.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ isInherited (boolean) optional
+ If true, display elements using 'inherited' CSS class.
+ isNewField (boolean) optional
+ If true, display elements using 'newFields' CSS class.
+ schemaLoc (String) optional
+ Schema file containing this element declaration;
+ if in current schema, 'schemaLoc' is set to 'this'.
+ typeList (String) optional
+ List of types in this call chain. Name of type starts
+ with '*', and ends with '+'. (Used to prevent infinite
+ recursive loop.)
+ -->
+ <xsl:template match="xsd:element[@name]" mode="sample">
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="isInherited">false</xsl:param>
+ <xsl:param name="isNewField">false</xsl:param>
+ <xsl:param name="schemaLoc">this</xsl:param>
+ <xsl:param name="typeList"/>
+
+ <xsl:choose>
+ <!-- Prohibited element declaration -->
+ <xsl:when test="normalize-space(@maxOccurs)='0'">
+ <!-- IGNORE if max occurs is zero -->
+ </xsl:when>
+ <!-- Global element declaration -->
+ <xsl:when test="local-name(..)='schema'">
+ <xsl:choose>
+ <!-- With type reference -->
+ <xsl:when test="@type">
+ <xsl:variable name="elemTypeName">
+ <xsl:call-template name="GetRefName">
+ <xsl:with-param name="ref" select="@type"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Look for complex type definition -->
+ <xsl:variable name="defLoc">
+ <xsl:call-template name="FindComponent">
+ <xsl:with-param name="ref" select="@type"/>
+ <xsl:with-param name="compType">complex type</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <!-- Complex type was found in current
+ schema. -->
+ <xsl:when test="normalize-space($defLoc)='this'">
+ <xsl:variable name="ctype" select="key('complexType', $elemTypeName)"/>
+ <xsl:call-template name="PrintSampleComplexElement">
+ <xsl:with-param name="element" select="."/>
+ <xsl:with-param name="type" select="$ctype"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Complex type was not found. -->
+ <xsl:when test="normalize-space($defLoc)='' or normalize-space($defLoc)='none' or normalize-space($defLoc)='xml' or normalize-space($defLoc)='xsd'">
+ <xsl:call-template name="PrintSampleSimpleElement">
+ <xsl:with-param name="element" select="."/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Complex type was found in external
+ schema. -->
+ <xsl:otherwise>
+ <xsl:variable name="ctype" select="document($defLoc)/xsd:schema/xsd:complexType[@name=$elemTypeName]"/>
+ <xsl:call-template name="PrintSampleComplexElement">
+ <xsl:with-param name="element" select="."/>
+ <xsl:with-param name="type" select="$ctype"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <!-- With local complex type definition -->
+ <xsl:when test="xsd:complexType">
+ <xsl:call-template name="PrintSampleComplexElement">
+ <xsl:with-param name="element" select="."/>
+ <xsl:with-param name="type" select="xsd:complexType"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="PrintSampleSimpleElement">
+ <xsl:with-param name="element" select="."/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <!-- Local element declaration -->
+ <xsl:otherwise>
+ <xsl:choose>
+ <!-- With local complex type definition -->
+ <xsl:when test="xsd:complexType">
+ <xsl:call-template name="PrintSampleComplexElement">
+ <xsl:with-param name="element" select="."/>
+ <xsl:with-param name="type" select="xsd:complexType"/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="PrintSampleSimpleElement">
+ <xsl:with-param name="element" select="."/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Prints out a sample XML instance from an element
+ reference.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ isInherited (boolean) optional
+ If true, display elements using 'inherited' CSS class.
+ isNewField (boolean) optional
+ If true, display elements using 'newFields' CSS class.
+ schemaLoc (String) optional
+ Schema file containing this element reference;
+ if in current schema, 'schemaLoc' is set to 'this'.
+ -->
+ <xsl:template match="xsd:element[@ref]" mode="sample">
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="isInherited">false</xsl:param>
+ <xsl:param name="isNewField">false</xsl:param>
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <xsl:if test="normalize-space(@maxOccurs)!='0'">
+ <xsl:call-template name="PrintSampleSimpleElement">
+ <xsl:with-param name="element" select="."/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Prints out a sample XML instance from a group definition.
+ Param(s):
+ schemaLoc (String) optional
+ Schema file containing this model group definition;
+ if in current schema, 'schemaLoc' is set to 'this'
+ typeList (String) optional
+ List of types in this call chain. Name of type starts
+ with '*', and ends with '+'. (Used to prevent infinite
+ recursive loop.)
+ -->
+ <xsl:template match="xsd:group[@name]" mode="sample">
+ <xsl:param name="schemaLoc">this</xsl:param>
+ <xsl:param name="typeList"/>
+
+ <xsl:apply-templates select="xsd:*" mode="sample">
+ <xsl:with-param name="parentGroups" select="concat('*', normalize-space(@name), '+')"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <!--
+ Prints out a sample XML instance from a group reference.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ isInherited (boolean) optional
+ If true, display elements using 'inherited' CSS
+ class.
+ isNewField (boolean) optional
+ If true, display elements using 'newFields' CSS
+ class.
+ parentGroups (String) optional
+ List of parent model group definitions that contain
+ this model group. Used to prevent infinite loops
+ when displaying model group definitions.
+ schemaLoc (String) optional
+ Schema file containing this model group reference;
+ if in current schema, 'schemaLoc' is set to 'this'
+ typeList (String) optional
+ List of types in this call chain. Name of type starts
+ with '*', and ends with '+'. (Used to prevent infinite
+ recursive loop.)
+ -->
+ <xsl:template match="xsd:group[@ref]" mode="sample">
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="isInherited">false</xsl:param>
+ <xsl:param name="isNewField">false</xsl:param>
+ <xsl:param name="parentGroups"/>
+ <xsl:param name="schemaLoc">this</xsl:param>
+ <xsl:param name="typeList"/>
+
+ <!-- Get group name -->
+ <xsl:variable name="grpName">
+ <xsl:call-template name="GetRefName">
+ <xsl:with-param name="ref" select="@ref"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Create link to the group definition -->
+ <xsl:variable name="grpLink">
+ <xsl:call-template name="PrintGroupRef">
+ <xsl:with-param name="ref" select="@ref"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Get occurrence info -->
+ <xsl:variable name="occursInfo">
+ <xsl:call-template name="PrintOccurs">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <!-- Circular group definition -->
+ <xsl:when test="contains($parentGroups, concat('*', normalize-space($grpName), '+'))">
+ <!-- Don't show contents -->
+ <div class="other" style="margin-left: {$margin}em">
+ <xsl:text>Circular model group reference: </xsl:text>
+ <xsl:copy-of select="$grpLink"/>
+ <!-- Occurrence info -->
+ <xsl:text> </xsl:text>
+ <xsl:copy-of select="$occursInfo"/>
+ <!-- Documentation -->
+ <xsl:call-template name="PrintSampleDocumentation">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </div>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Look for group definition -->
+ <xsl:variable name="grpDefLoc">
+ <xsl:call-template name="FindComponent">
+ <xsl:with-param name="ref" select="@ref"/>
+ <xsl:with-param name="compType">group</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <!-- Not found -->
+ <xsl:when test="normalize-space($grpDefLoc)='' or normalize-space($grpDefLoc)='none' or normalize-space($grpDefLoc)='xml' or normalize-space($grpDefLoc)='xsd'">
+ <div class="other" style="margin-left: {$margin}em">
+ <xsl:text>Model group reference (not shown): </xsl:text>
+ <xsl:copy-of select="$grpLink"/>
+ <!-- Occurrence info -->
+ <xsl:text> </xsl:text>
+ <xsl:copy-of select="$occursInfo"/>
+ <!-- Documentation -->
+ <xsl:call-template name="PrintSampleDocumentation">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </div>
+ </xsl:when>
+ <!-- Found in current schema -->
+ <xsl:when test="normalize-space($grpDefLoc)='this'">
+ <xsl:variable name="grpDef" select="key('group', $grpName)"/>
+ <xsl:call-template name="PrintSampleGroup">
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="parentGroups" select="concat($parentGroups, concat('*', normalize-space($grpName), '+'))"/>
+ <xsl:with-param name="occursInfo" select="$occursInfo"/>
+ <xsl:with-param name="grpLink" select="$grpLink"/>
+ <xsl:with-param name="grpRef" select="."/>
+ <xsl:with-param name="grpDef" select="$grpDef"/>
+ <xsl:with-param name="grpDefLoc" select="$grpDefLoc"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Found in external schema -->
+ <xsl:otherwise>
+ <xsl:variable name="grpDef" select="document($grpDefLoc)/xsd:schema/xsd:group[@name=$grpName]"/>
+ <xsl:call-template name="PrintSampleGroup">
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="parentGroups" select="concat($parentGroups, concat('*', normalize-space($grpName), '+'))"/>
+ <xsl:with-param name="occursInfo" select="$occursInfo"/>
+ <xsl:with-param name="grpLink" select="$grpLink"/>
+ <xsl:with-param name="grpRef" select="."/>
+ <xsl:with-param name="grpDef" select="$grpDef"/>
+ <xsl:with-param name="grpDefLoc" select="$grpDefLoc"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Prints out a sample XML instance from a 'sequence' model group.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ isInherited (boolean) optional
+ If true, display elements using 'inherited' CSS class.
+ isNewField (boolean) optional
+ If true, display elements using 'newFields' CSS class.
+ parentGroups (String) optional
+ List of parent model group definitions that contain
+ this model group. Used to prevent infinite loops when
+ displaying model group definitions.
+ schemaLoc (String) optional
+ Schema file containing this sequence model group;
+ if in current schema, 'schemaLoc' is set to 'this'
+ typeList (String) optional
+ List of types in this call chain. Name of type starts
+ with '*', and ends with '+'. (Used to prevent infinite
+ recursive loop.)
+ -->
+ <xsl:template match="xsd:sequence" mode="sample">
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="isInherited">false</xsl:param>
+ <xsl:param name="isNewField">false</xsl:param>
+ <xsl:param name="parentGroups"/>
+ <xsl:param name="schemaLoc">this</xsl:param>
+ <xsl:param name="typeList"/>
+
+ <xsl:if test="normalize-space(@maxOccurs)!='0'">
+ <!-- Get occurrence info -->
+ <xsl:variable name="occursInfo">
+ <xsl:call-template name="PrintOccurs">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Header -->
+ <xsl:if test="normalize-space($occursInfo)!='[1]'">
+ <!-- Don't display header if min/max occurs is one. -->
+ <span class="group" style="margin-left: {$margin}em">
+ <xsl:text>Start </xsl:text>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">Sequence</xsl:with-param>
+ <xsl:with-param name="term">Sequence</xsl:with-param>
+ </xsl:call-template>
+
+ <xsl:text> </xsl:text>
+ <xsl:copy-of select="$occursInfo"/>
+ <!-- Documentation -->
+ <xsl:call-template name="PrintSampleDocumentation">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </span><br/>
+ </xsl:if>
+
+ <xsl:apply-templates select="xsd:*" mode="sample">
+ <xsl:with-param name="margin">
+ <xsl:choose>
+ <xsl:when test="normalize-space($occursInfo)='[1]'">
+ <xsl:value-of select="$margin"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="number($margin)+number($ELEM_INDENT)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="parentGroups" select="$parentGroups"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:apply-templates>
+
+ <!-- Footer -->
+ <xsl:if test="normalize-space($occursInfo)!='[1]'">
+ <!-- Don't display footer if min/max occurs is one. -->
+ <span class="group" style="margin-left: {$margin}em">
+ <xsl:text>End Sequence</xsl:text>
+ </span><br/>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Prints out the constraints of a complex type with simple content
+ to be displayed within a sample XML instance.
+ Param(s):
+ schemaLoc (String) optional
+ Schema file containing this simple content
+ restriction; if in current schema, 'schemaLoc' is
+ set to 'this'
+ -->
+ <xsl:template match="xsd:simpleContent[xsd:restriction]" mode="sample">
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <span class="constraint">
+ <xsl:call-template name="PrintSampleSimpleRestriction">
+ <xsl:with-param name="restriction" select="./xsd:restriction"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </span>
+ </xsl:template>
+
+ <!--
+ Prints out the constraints of a simple type definition to be
+ displayed within a sample XML instance.
+ Param(s):
+ schemaLoc (String) optional
+ Schema file containing this simple type definition;
+ if in current schema, 'schemaLoc' is set to 'this'
+ -->
+ <xsl:template match="xsd:simpleType" mode="sample">
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <span class="constraint">
+ <xsl:call-template name="PrintSampleSimpleConstraints">
+ <xsl:with-param name="simpleContent" select="."/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </span>
+ </xsl:template>
+
+ <!--
+ Prints out the identity constraints of an element to be displayed
+ within a sample XML instance.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ schemaLoc (String) optional
+ Schema file containing this simple type definition;
+ if in current schema, 'schemaLoc' is set to 'this'
+ -->
+ <xsl:template match="xsd:unique | xsd:key | xsd:keyref" mode="sample">
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <div class="other" style="margin-left: {$margin}em">
+ <xsl:text>&lt;!-- </xsl:text><br/>
+
+ <xsl:choose>
+ <xsl:when test="local-name(.)='unique'">
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">Unique</xsl:with-param>
+ <xsl:with-param name="term">Uniqueness</xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="local-name(.)='key'">
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">Key</xsl:with-param>
+ <xsl:with-param name="term">Key</xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">KeyRef</xsl:with-param>
+ <xsl:with-param name="term">Key Reference</xsl:with-param>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text> Constraint - </xsl:text>
+ <strong>
+ <xsl:choose>
+ <xsl:when test="local-name(.)='keyref'">
+ <xsl:value-of select="@name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="componentID">
+ <xsl:call-template name="GetComponentID">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </xsl:variable>
+ <a name="{$componentID}"><xsl:value-of select="@name"/></a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </strong><br/>
+
+ <xsl:text>Selector - </xsl:text>
+ <strong>
+ <xsl:value-of select="xsd:selector/@xpath"/>
+ </strong><br/>
+
+ <xsl:text>Field(s) - </xsl:text>
+ <xsl:for-each select="xsd:field">
+ <xsl:if test="position()!=1">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ <strong>
+ <xsl:value-of select="@xpath"/>
+ </strong>
+ </xsl:for-each>
+ <br/>
+
+ <xsl:if test="local-name(.)='keyref'">
+ <xsl:text>Refers to - </xsl:text>
+ <xsl:call-template name="PrintKeyRef">
+ <xsl:with-param name="ref" select="@refer"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ <br/>
+ </xsl:if>
+
+ <xsl:text>--></xsl:text>
+ </div>
+ </xsl:template>
+
+ <!--
+ Unmatched template for 'sample' mode
+ -->
+ <xsl:template match="*" mode="sample"/>
+
+ <!--
+ Prints out a link which will open up a window, displaying a
+ schema component's documentation.
+ Param(s):
+ component (Node) required
+ Schema component
+ -->
+ <xsl:template name="PrintSampleDocumentation">
+ <xsl:param name="component"/>
+
+ <xsl:if test="normalize-space(translate($useJavaScript,'TRUE','true'))='true' and $component and $component/xsd:annotation/xsd:documentation">
+ <xsl:variable name="documentation">
+ <xsl:for-each select="$component/xsd:annotation/xsd:documentation">
+ <!-- Check for two dashes, which will break the JavaScript
+ code -->
+ <xsl:if test="contains(., '--') or contains(@source, '--')">
+ <xsl:call-template name="HandleError">
+ <xsl:with-param name="isTerminating">true</xsl:with-param>
+ <xsl:with-param name="errorMsg">
+A local schema component contains two dashes in
+'documentation' elements within its 'annotation' element.
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+
+ <xsl:if test="position()!=1">
+ <xsl:text>,</xsl:text>
+ </xsl:if>
+ <xsl:text>'</xsl:text>
+ <xsl:choose>
+ <xsl:when test="@source">
+ <xsl:text>More information at: </xsl:text>
+ <xsl:call-template name="EscapeQuotes">
+ <xsl:with-param name="value" select="@source"/>
+ </xsl:call-template>
+ <xsl:text>.</xsl:text>
+ </xsl:when>
+ <xsl:when test="normalize-space(.)!=''">
+ <xsl:call-template name="EscapeQuotes">
+ <xsl:with-param name="value" select="normalize-space(.)"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:text>'</xsl:text>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:text> </xsl:text>
+ <a href="javascript:void(0)" title="View Documentation" class="documentation">
+ <!-- onclick attribute -->
+ <xsl:attribute name="onclick">
+ <xsl:text>docArray = new Array(</xsl:text>
+ <xsl:value-of select="$documentation"/>
+ <xsl:text>); viewDocumentation('</xsl:text>
+ <xsl:call-template name="GetComponentDescription">
+ <xsl:with-param name="component" select="$component"/>
+ </xsl:call-template>
+ <xsl:text>', '</xsl:text>
+ <xsl:choose>
+ <xsl:when test="$component/@name">
+ <xsl:value-of select="$component/@name"/>
+ </xsl:when>
+ <xsl:when test="$component/@ref">
+ <xsl:call-template name="GetRefName">
+ <xsl:with-param name="ref" select="$component/@ref"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:text>', docArray);</xsl:text>
+ </xsl:attribute>
+ <xsl:text>?</xsl:text>
+ </a>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Translates occurrences of single and double quotes
+ in a piece of text with single and double quote
+ escape characters.
+ Param(s):
+ value (String) required
+ Text to translate
+ -->
+ <xsl:template name="EscapeQuotes">
+ <xsl:param name="value"/>
+
+ <xsl:variable name="noSingleQuotes">
+ <xsl:call-template name="TranslateStr">
+ <xsl:with-param name="value" select="$value"/>
+ <xsl:with-param name="strToReplace">'</xsl:with-param>
+ <xsl:with-param name="replacementStr">\'</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="noDoubleQuotes">
+ <xsl:call-template name="TranslateStr">
+ <xsl:with-param name="value" select="$noSingleQuotes"/>
+ <xsl:with-param name="strToReplace">"</xsl:with-param>
+ <xsl:with-param name="replacementStr">\"</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="$noDoubleQuotes"/>
+ </xsl:template>
+
+ <!--
+ Helper template for template, match="xsd:group[@ref]"
+ mode="sample". Basically prints out a group reference, for
+ which we are able to look up the group definition that it
+ is referring to. This template is a work-around because XSLT
+ doesn't have variables (in the traditional sense of
+ programming languages) and it doesn't allow you to query
+ result tree fragments.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ isInherited (boolean) optional
+ If true, display elements using 'inherited' CSS class.
+ isNewField (boolean) optional
+ If true, display elements using 'newFields' CSS class.
+ parentGroups (String) optional
+ List of parent model group definitions that contain this
+ model group. Used to prevent infinite loops when
+ displaying model group definitions.
+ occursInfo (Result tree fragment) required
+ Pre-formatted occurrence info of group reference
+ grpLink (Result tree fragment) required
+ Pre-formatted <a> link representing group reference
+ grpRef (Node) required
+ Group reference
+ grpDef (Node) required
+ Group definition that the reference is pointing to
+ grpDefLoc (String) optional
+ Schema file containing 'grpDef' group definition;
+ if current schema, 'schemaLoc' is set to 'this'
+ typeList (String) optional
+ List of types in this call chain. Name of type starts
+ with '*', and ends with '+'. (Used to prevent infinite
+ recursive loop.)
+ -->
+ <xsl:template name="PrintSampleGroup">
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="isInherited">false</xsl:param>
+ <xsl:param name="isNewField">false</xsl:param>
+ <xsl:param name="parentGroups"/>
+ <xsl:param name="occursInfo"/>
+ <xsl:param name="grpLink"/>
+ <xsl:param name="grpRef"/>
+ <xsl:param name="grpDef"/>
+ <xsl:param name="grpDefLoc">this</xsl:param>
+ <xsl:param name="typeList"/>
+
+ <!-- Header -->
+ <xsl:if test="normalize-space($occursInfo)!='[1]'">
+ <!-- Don't print out header if min/max occurs is one. -->
+ <span class="group" style="margin-left: {$margin}em">
+ <xsl:text>Start Group: </xsl:text>
+ <xsl:copy-of select="$grpLink"/>
+ <!-- Occurrence info -->
+ <xsl:text> </xsl:text>
+ <xsl:copy-of select="$occursInfo"/>
+ <!-- Documentation -->
+ <xsl:call-template name="PrintSampleDocumentation">
+ <xsl:with-param name="component" select="$grpRef"/>
+ </xsl:call-template>
+ </span><br/>
+ </xsl:if>
+
+ <!-- Content -->
+ <xsl:apply-templates select="$grpDef/xsd:*" mode="sample">
+ <xsl:with-param name="margin">
+ <xsl:choose>
+ <xsl:when test="normalize-space($occursInfo)!='[1]'">
+ <xsl:value-of select="number($margin)+number($ELEM_INDENT)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$margin"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="parentGroups" select="$parentGroups"/>
+ <xsl:with-param name="schemaLoc" select="$grpDefLoc"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:apply-templates>
+
+ <!-- Footer -->
+ <xsl:if test="normalize-space($occursInfo)!='[1]'">
+ <!-- Don't print out footer if min/max occurs is one. -->
+ <span class="group" style="margin-left: {$margin}em">
+ <xsl:text>End Group: </xsl:text>
+ <xsl:copy-of select="$grpLink"/>
+ </span><br/>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Prints out a sample element instance in one line.
+ Param(s):
+ element (Node) required
+ Element declaration or reference
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ isInherited (boolean) optional
+ If true, display element using 'inherited' CSS class.
+ isNewField (boolean) optional
+ If true, display element using 'newFields' CSS class.
+ schemaLoc (String) optional
+ Schema file containing this element declaration
+ or reference; if in current schema, 'schemaLoc' is
+ set to 'this'.
+ -->
+ <xsl:template name="PrintSampleSimpleElement">
+ <xsl:param name="element"/>
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="isInherited">false</xsl:param>
+ <xsl:param name="isNewField">false</xsl:param>
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <!-- Element Tag -->
+ <xsl:variable name="elemTag">
+ <!-- Local Name -->
+ <xsl:choose>
+ <!-- Element reference -->
+ <xsl:when test="$element/@ref">
+ <!-- Note: Prefix will be automatically written out
+ in call to 'PrintElementRef'. -->
+ <xsl:call-template name="PrintElementRef">
+ <xsl:with-param name="ref" select="@ref"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Element declaration -->
+ <xsl:otherwise>
+ <!-- Prefix -->
+ <xsl:variable name="prefix">
+ <xsl:call-template name="GetElementPrefix">
+ <xsl:with-param name="element" select="$element"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="PrintNSPrefix">
+ <xsl:with-param name="prefix" select="$prefix"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ <xsl:value-of select="$element/@name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <div style="margin-left: {$margin}em">
+ <xsl:choose>
+ <xsl:when test="$isNewField!='false'">
+ <xsl:attribute name="class">newFields</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$isInherited!='false'">
+ <xsl:attribute name="class">inherited</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+
+ <!-- Start Tag -->
+ <xsl:text>&lt;</xsl:text>
+ <xsl:copy-of select="$elemTag"/>
+ <xsl:text>></xsl:text>
+
+ <!-- Contents -->
+ <xsl:text> </xsl:text>
+ <xsl:choose>
+ <!-- Fixed value is provided -->
+ <xsl:when test="$element/@fixed">
+ <span class="fixed">
+ <xsl:value-of select="$element/@fixed"/>
+ </span>
+ </xsl:when>
+ <!-- Type reference is provided -->
+ <xsl:when test="$element/@name and $element/@type">
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="$element/@type"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Local simple type definition is provided -->
+ <xsl:when test="$element/@name and $element/xsd:simpleType">
+ <xsl:apply-templates select="$element/xsd:simpleType" mode="sample">
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>...</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text> </xsl:text>
+
+ <!-- Identity Constraints -->
+ <xsl:if test="$element/xsd:unique or $element/xsd:key or $element/xsd:keyref">
+ <xsl:apply-templates select="$element/xsd:unique | $element/xsd:key | $element/xsd:keyref" mode="sample">
+ <xsl:with-param name="margin" select="$ELEM_INDENT"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:apply-templates>
+ </xsl:if>
+
+ <!-- End Tag -->
+ <xsl:text>&lt;/</xsl:text>
+ <xsl:copy-of select="$elemTag"/>
+ <xsl:text>></xsl:text>
+
+ <xsl:if test="local-name($element/..)!='schema'">
+ <!-- Min/max occurs information -->
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="PrintOccurs">
+ <xsl:with-param name="component" select="$element"/>
+ </xsl:call-template>
+ <!-- Documentation -->
+ <xsl:call-template name="PrintSampleDocumentation">
+ <xsl:with-param name="component" select="$element"/>
+ </xsl:call-template>
+ </xsl:if>
+ </div>
+ </xsl:template>
+
+ <!--
+ Prints out a sample element instance that has complex content.
+ Param(s):
+ type (Node) required
+ Complex type definition
+ element (Node) optional
+ Element declaration
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ isInherited (boolean) optional
+ If true, display element using 'inherited' CSS class.
+ isNewField (boolean) optional
+ If true, display element using 'newFields' CSS class.
+ schemaLoc (String) optional
+ Schema file containing this element declaration
+ or type definition; if in current schema, 'schemaLoc'
+ is set to 'this'.
+ typeList (String) optional
+ List of types in this call chain. Name of type starts
+ with '*', and ends with '+'. (Used to prevent infinite
+ recursive loop.)
+ -->
+ <xsl:template name="PrintSampleComplexElement">
+ <xsl:param name="type"/>
+ <xsl:param name="element"/>
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="isInherited">false</xsl:param>
+ <xsl:param name="isNewField">false</xsl:param>
+ <xsl:param name="schemaLoc">this</xsl:param>
+ <xsl:param name="typeList"/>
+
+ <xsl:choose>
+ <!-- Circular type hierarchy -->
+ <xsl:when test="$type/@name and contains($typeList, concat('*', $type/@name, '+'))"/>
+ <xsl:otherwise>
+ <xsl:variable name="tag">
+ <xsl:choose>
+ <xsl:when test="$element">
+ <!-- Prefix -->
+ <xsl:variable name="prefix">
+ <xsl:call-template name="GetElementPrefix">
+ <xsl:with-param name="element" select="$element"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="PrintNSPrefix">
+ <xsl:with-param name="prefix" select="$prefix"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ <xsl:value-of select="$element/@name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>...</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="fromTopCType">
+ <xsl:choose>
+ <xsl:when test="not($element) and local-name($type/..)='schema'">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>false</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <div style="margin-left: {$margin}em">
+ <xsl:choose>
+ <xsl:when test="$isNewField!='false'">
+ <xsl:attribute name="class">newFields</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$isInherited!='false'">
+ <xsl:attribute name="class">inherited</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+
+ <!-- Start Tag -->
+ <xsl:text>&lt;</xsl:text>
+ <xsl:copy-of select="$tag"/>
+
+ <!-- Print attributes -->
+ <xsl:call-template name="PrintSampleTypeAttrs">
+ <xsl:with-param name="type" select="$type"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="margin" select="$ATTR_INDENT"/>
+ <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:call-template>
+
+ <!-- Get content -->
+ <xsl:variable name="content">
+ <xsl:call-template name="PrintSampleTypeContent">
+ <xsl:with-param name="type" select="$type"/>
+ <xsl:with-param name="margin" select="$ELEM_INDENT"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Find out if content type is mixed -->
+ <xsl:variable name="mixed">
+ <xsl:choose>
+ <xsl:when test="normalize-space(translate($type/xsd:complexContent/@mixed, 'TRUE', 'true'))='true' or normalize-space($type/xsd:complexContent/@mixed)='1'">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <xsl:when test="normalize-space(translate($type/@mixed, 'TRUE', 'true'))='true' or normalize-space($type/@mixed)='1'">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>false</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- Find out if there are identity constraints -->
+ <xsl:variable name="hasIdConstraints">
+ <xsl:if test="$element and ($element/xsd:unique or $element/xsd:key or $element/xsd:keyref)">
+ <xsl:text>true</xsl:text>
+ </xsl:if>
+ </xsl:variable>
+
+ <!-- Print content -->
+ <xsl:choose>
+ <!-- Empty content -->
+ <xsl:when test="$hasIdConstraints!='true' and normalize-space($content)=''">
+ <!-- Close start tag -->
+ <xsl:text>/> </xsl:text>
+
+ <xsl:if test="$element and local-name($element/..)!='schema'">
+ <!-- Occurrence info -->
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="PrintOccurs">
+ <xsl:with-param name="component" select="$element"/>
+ </xsl:call-template>
+
+ <!-- Documentation -->
+ <xsl:call-template name="PrintSampleDocumentation">
+ <xsl:with-param name="component" select="$element"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Close start tag -->
+ <xsl:text>> </xsl:text>
+
+ <xsl:if test="$element and local-name($element/..)!='schema'">
+ <!-- Occurrence info -->
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="PrintOccurs">
+ <xsl:with-param name="component" select="$element"/>
+ </xsl:call-template>
+
+ <!-- Documentation -->
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="PrintSampleDocumentation">
+ <xsl:with-param name="component" select="$element"/>
+ </xsl:call-template>
+ </xsl:if>
+
+ <!-- Identity Constraints -->
+ <xsl:if test="$element">
+ <xsl:apply-templates select="$element/xsd:unique | $element/xsd:key | $element/xsd:keyref" mode="sample">
+ <xsl:with-param name="margin" select="$ELEM_INDENT"/>
+ </xsl:apply-templates>
+ </xsl:if>
+
+ <!-- Print out restriction/extension information -->
+ <xsl:choose>
+ <xsl:when test="false()">
+ <!--<xsl:when test="$type/xsd:complexContent/xsd:restriction/@base">-->
+ <br/><span class="other" style="margin-left: {$ELEM_INDENT}em">
+ <xsl:text>&lt;!-- Restricts : </xsl:text>
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="$type/xsd:complexContent/xsd:restriction/@base"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ <xsl:text> --></xsl:text>
+ </span>
+ </xsl:when>
+ <xsl:when test="false()">
+ <!--<xsl:when test="$type/xsd:complexContent/xsd:extension/@base">-->
+ <br/><span class="other" style="margin-left: {$ELEM_INDENT}em">
+ <xsl:text>&lt;!-- Extends : </xsl:text>
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="$type/xsd:complexContent/xsd:extension/@base"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ <xsl:text> --></xsl:text>
+ </span>
+ </xsl:when>
+ </xsl:choose>
+
+ <!-- Print out message if has mixed content -->
+ <xsl:if test="$mixed='true'">
+ <br/><span class="other" style="margin-left: {$ELEM_INDENT}em">
+ <xsl:text>&lt;!-- Mixed content --></xsl:text>
+ </span>
+ </xsl:if>
+
+ <!-- Element Content -->
+ <xsl:copy-of select="$content"/>
+
+ <!-- End Tag -->
+ <xsl:text>&lt;/</xsl:text>
+ <xsl:copy-of select="$tag"/>
+ <xsl:text>></xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Prints out attributes of a complex type definition, including
+ those inherited from a base type.
+ Param(s):
+ type (Node) required
+ Complex type definition
+ subTypeAttrs (String) optional
+ List of attributes in sub-types of this current type
+ definition
+ isInherited (boolean) optional
+ If true, display attributes using 'inherited' CSS class.
+ isNewField (boolean) optional
+ If true, display attributes using 'newFields' CSS class.
+ fromTopCType (boolean) optional
+ Set to true if this is being displayed in the XML
+ Instance Representation table of a top-level complex
+ type definition, in which case, 'inherited' attributes
+ and elements are distinguished.
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ schemaLoc (String) optional
+ Schema file containing this complex type definition;
+ if in current schema, 'schemaLoc' is set to 'this'.
+ typeList (String) optional
+ List of types in this call chain. Name of type starts
+ with '*', and ends with '+'. (Used to prevent infinite
+ recursive loop.)
+ -->
+ <xsl:template name="PrintSampleTypeAttrs">
+ <xsl:param name="type"/>
+ <xsl:param name="subTypeAttrs"/>
+ <xsl:param name="isInherited">false</xsl:param>
+ <xsl:param name="isNewField">false</xsl:param>
+ <xsl:param name="fromTopCType">false</xsl:param>
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="schemaLoc">this</xsl:param>
+ <xsl:param name="typeList"/>
+
+ <xsl:choose>
+ <!-- Circular type hierarchy -->
+ <xsl:when test="$type/@name and contains($typeList, concat('*', $type/@name, '+'))">
+ <!-- Do nothing.
+ Error message will be written out by 'PrintSampleTypeContent' template.
+ -->
+ </xsl:when>
+ <!-- Derivation -->
+ <xsl:when test="$type/xsd:complexContent or $type/xsd:simpleContent">
+ <xsl:choose>
+ <xsl:when test="$type/xsd:complexContent/xsd:restriction">
+ <xsl:call-template name="PrintSampleDerivedTypeAttrs">
+ <xsl:with-param name="derivationElem" select="$type/xsd:complexContent/xsd:restriction"/>
+ <xsl:with-param name="subTypeAttrs" select="$subTypeAttrs"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$type/xsd:simpleContent/xsd:restriction">
+ <xsl:call-template name="PrintSampleDerivedTypeAttrs">
+ <xsl:with-param name="derivationElem" select="$type/xsd:simpleContent/xsd:restriction"/>
+ <xsl:with-param name="subTypeAttrs" select="$subTypeAttrs"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$type/xsd:complexContent/xsd:extension">
+ <xsl:call-template name="PrintSampleDerivedTypeAttrs">
+ <xsl:with-param name="derivationElem" select="$type/xsd:complexContent/xsd:extension"/>
+ <xsl:with-param name="subTypeAttrs" select="$subTypeAttrs"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$type/xsd:simpleContent/xsd:extension">
+ <xsl:call-template name="PrintSampleDerivedTypeAttrs">
+ <xsl:with-param name="derivationElem" select="$type/xsd:simpleContent/xsd:extension"/>
+ <xsl:with-param name="subTypeAttrs" select="$subTypeAttrs"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <!-- No derivation -->
+ <xsl:when test="local-name($type)='complexType'">
+ <xsl:call-template name="PrintSampleAttrList">
+ <xsl:with-param name="list" select="$type"/>
+ <xsl:with-param name="subTypeAttrs" select="$subTypeAttrs"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Ignore base types that are simple types -->
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Helper function 'PrintSampleTypeAttrs' template to
+ handle case of derived types.
+ Param(s):
+ derivationElem (Node) required
+ 'restriction' or 'extension' element
+ subTypeAttrs (String) optional
+ List of attributes in sub-types of
+ this current type definition
+ isInherited (boolean) optional
+ If true, display attributes using 'inherited' CSS class.
+ isNewField (boolean) optional
+ If true, display attributes using 'newFields' CSS class.
+ fromTopCType (boolean) optional
+ Set to true if this is being displayed
+ in the XML Instance Representation table
+ of a top-level complex type definition, in
+ which case, 'inherited' attributes and
+ elements are distinguished.
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ schemaLoc (String) optional
+ Schema file containing this derivation element;
+ if in current schema, 'schemaLoc' is set to 'this'.
+ typeList (String) optional
+ List of types in this call chain. Name of type starts
+ with '*', and ends with '+'. (Used to prevent infinite
+ recursive loop.)
+ -->
+ <xsl:template name="PrintSampleDerivedTypeAttrs">
+ <xsl:param name="derivationElem"/>
+ <xsl:param name="subTypeAttrs"/>
+ <xsl:param name="isInherited">false</xsl:param>
+ <xsl:param name="isNewField">false</xsl:param>
+ <xsl:param name="fromTopCType">false</xsl:param>
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="schemaLoc">this</xsl:param>
+ <xsl:param name="typeList"/>
+
+ <!-- Get attributes from this type to add to
+ 'subTypeAttrs' list for recursive call on base type -->
+ <xsl:variable name="thisAttrs">
+ <xsl:call-template name="GetAttrList">
+ <xsl:with-param name="list" select="$derivationElem"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Look for base type -->
+ <xsl:variable name="baseTypeName">
+ <xsl:call-template name="GetRefName">
+ <xsl:with-param name="ref" select="$derivationElem/@base"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="defLoc">
+ <xsl:call-template name="FindComponent">
+ <xsl:with-param name="ref" select="$derivationElem/@base"/>
+ <xsl:with-param name="compType">complex type</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <!-- Complex type was found in current schema. -->
+ <xsl:when test="normalize-space($defLoc)='this'">
+ <xsl:variable name="ctype" select="key('complexType', $baseTypeName)"/>
+ <xsl:call-template name="PrintSampleTypeAttrs">
+ <xsl:with-param name="type" select="$ctype"/>
+ <xsl:with-param name="subTypeAttrs" select="concat($subTypeAttrs, $thisAttrs)"/>
+ <xsl:with-param name="isInherited">
+ <xsl:choose>
+ <xsl:when test="$fromTopCType!='false'">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>false</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Complex type was not found. -->
+ <xsl:when test="normalize-space($defLoc)='' or normalize-space($defLoc)='none' or normalize-space($defLoc)='xml' or normalize-space($defLoc)='xsd'">
+ <!-- IGNORE: Error message will be printed out be
+ 'PrintSampleTypeContent' template. -->
+ </xsl:when>
+ <!-- Complex type was found in external schema. -->
+ <xsl:otherwise>
+ <xsl:variable name="ctype" select="document($defLoc)/xsd:schema/xsd:complexType[@name=$baseTypeName]"/>
+ <xsl:call-template name="PrintSampleTypeAttrs">
+ <xsl:with-param name="type" select="$ctype"/>
+ <xsl:with-param name="subTypeAttrs" select="concat($subTypeAttrs, $thisAttrs)"/>
+ <xsl:with-param name="isInherited">
+ <xsl:choose>
+ <xsl:when test="$fromTopCType!='false'">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>false</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="schemaLoc" select="$defLoc"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <!-- Print out attributes in this type -->
+ <xsl:call-template name="PrintSampleAttrList">
+ <xsl:with-param name="list" select="$derivationElem"/>
+ <xsl:with-param name="subTypeAttrs" select="$subTypeAttrs"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField">
+ <xsl:choose>
+ <xsl:when test="$fromTopCType!='false' and $isInherited='false'">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>false</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Returns the names and namespaces of attributes
+ in a list of attributes and attribute groups.
+ Param(s):
+ list (Node) required
+ Node containing list of attributes and attribute groups
+ -->
+ <xsl:template name="GetAttrList">
+ <xsl:param name="list"/>
+
+ <xsl:if test="$list">
+ <xsl:for-each select="$list/xsd:attribute | $list/xsd:attributeGroup | $list/xsd:anyAttribute">
+ <xsl:choose>
+ <!-- Attribute declaration -->
+ <xsl:when test="local-name(.)='attribute' and @name">
+ <!-- Get attribute name -->
+ <xsl:variable name="attrName" select="@name"/>
+ <!-- Get attribute namespace -->
+ <xsl:variable name="attrNS">
+ <xsl:call-template name="GetAttributeNS">
+ <xsl:with-param name="attribute" select="."/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:value-of select="concat('*', normalize-space($attrNS), '+', normalize-space($attrName), '+')"/>
+ </xsl:when>
+ <!-- Attribute reference -->
+ <xsl:when test="local-name(.)='attribute' and @ref">
+ <!-- Get attribute name -->
+ <xsl:variable name="attrName">
+ <xsl:call-template name="GetRefName">
+ <xsl:with-param name="ref" select="@ref"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- Get attribute namespace -->
+ <xsl:variable name="attrNS">
+ <xsl:call-template name="GetAttributeNS">
+ <xsl:with-param name="attribute" select="."/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:value-of select="concat('*', normalize-space($attrNS), '+', normalize-space($attrName), '+')"/>
+ </xsl:when>
+ <!-- Attribute Group reference -->
+ <xsl:when test="local-name(.)='attributeGroup' and @ref">
+ <xsl:variable name="attrGrpName">
+ <xsl:call-template name="GetRefName">
+ <xsl:with-param name="ref" select="@ref"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="GetAttrList">
+ <xsl:with-param name="list" select="key('attributeGroup', $attrGrpName)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Attribute wildcard -->
+ <xsl:when test="local-name(.)='anyAttribute'">
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Prints out sample XML instances from a list of attributes and
+ attribute groups.
+ Param(s):
+ list (Node) required
+ Node containing list of attributes and attribute groups
+ subTypeAttrs (String) optional
+ List of attributes in sub-types of
+ the type definition containing this list
+ isInherited (boolean) optional
+ If true, display attributes using 'inherited' CSS class.
+ isNewField (boolean) optional
+ If true, display attributes using 'newFields' CSS class.
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ schemaLoc (String) optional
+ Schema file containing this attribute list;
+ if in current schema, 'schemaLoc' is set to 'this'.
+ -->
+ <xsl:template name="PrintSampleAttrList">
+ <xsl:param name="list"/>
+ <xsl:param name="subTypeAttrs"/>
+ <xsl:param name="isInherited">false</xsl:param>
+ <xsl:param name="isNewField">false</xsl:param>
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <xsl:apply-templates select="$list/xsd:attribute | $list/xsd:attributeGroup | $list/xsd:anyAttribute" mode="sample">
+ <xsl:with-param name="subTypeAttrs" select="$subTypeAttrs"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="addBR">true</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <!--
+ Prints out the element content of a complex type definition,
+ including those inherited from a base type.
+ Param(s):
+ type (Node) required
+ Complex type definition
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ isInherited (boolean) optional
+ If true, display elements using 'inherited' CSS class.
+ isNewField (boolean) optional
+ If true, display elements using 'newFields' CSS class.
+ fromTopCType (boolean) optional
+ Set to true if this is being displayed in the XML
+ Instance Representation table of a top-level complex
+ type definition, in which case, 'inherited' attributes
+ and elements are distinguished.
+ addBR (boolean) optional
+ If true, can add <br/> before element content.
+ Applicable only if displaying complex content.
+ schemaLoc (String) optional
+ Schema file containing this type definition;
+ if in current schema, 'schemaLoc' is set to 'this'.
+ typeList (String) optional
+ List of types in this call chain. Name of type starts
+ with '*', and ends with '+'. (Used to prevent infinite
+ recursive loop.)
+ -->
+ <xsl:template name="PrintSampleTypeContent">
+ <xsl:param name="type"/>
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="isInherited">false</xsl:param>
+ <xsl:param name="isNewField">false</xsl:param>
+ <xsl:param name="fromTopCType">false</xsl:param>
+ <xsl:param name="addBR">true</xsl:param>
+ <xsl:param name="schemaLoc">this</xsl:param>
+ <xsl:param name="typeList"/>
+
+ <xsl:if test="$addBR='true'"><br/></xsl:if>
+
+ <xsl:choose>
+ <!-- Circular type hierarchy -->
+ <xsl:when test="$type/@name and contains($typeList, concat('*', $type/@name, '+'))"/>
+ <!-- Derivation by restriction on complex content -->
+ <xsl:when test="$type/xsd:complexContent/xsd:restriction">
+ <xsl:variable name="restriction" select="$type/xsd:complexContent/xsd:restriction"/>
+
+ <!-- Test if base type is in schema to print out warning comment-->
+ <xsl:variable name="baseTypeName">
+ <xsl:call-template name="GetRefName">
+ <xsl:with-param name="ref" select="$restriction/@base"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- Look for base type -->
+ <xsl:variable name="defLoc">
+ <xsl:call-template name="FindComponent">
+ <xsl:with-param name="ref" select="$restriction/@base"/>
+ <xsl:with-param name="compType">complex type</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <!-- Complex type was not found. -->
+ <xsl:when test="normalize-space($defLoc)='' or normalize-space($defLoc)='none' or normalize-space($defLoc)='xml' or normalize-space($defLoc)='xsd'">
+ <div class="other" style="margin-left: {$margin}em;">
+ <xsl:text>&lt;!-- '</xsl:text>
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="$restriction/@base"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ <xsl:text>' super type was not found in this schema. Some elements and attributes may be missing. --></xsl:text>
+ </div>
+ </xsl:when>
+ <!-- Complex type was found. -->
+ <xsl:otherwise>
+ <!-- IGNORE element content of base type if by restriction,
+ since current content will override restricted
+ base type's content. -->
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <!-- Print out content from this type -->
+ <xsl:if test="$restriction/xsd:*[local-name(.)!='annotation']">
+ <xsl:call-template name="PrintSampleParticleList">
+ <xsl:with-param name="list" select="$restriction"/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField">
+ <xsl:choose>
+ <xsl:when test="$fromTopCType!='false' and $isInherited='false'">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>false</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:when>
+ <!-- Derivation by extension on complex content -->
+ <xsl:when test="$type/xsd:complexContent/xsd:extension">
+ <xsl:variable name="extension" select="$type/xsd:complexContent/xsd:extension"/>
+
+ <xsl:variable name="baseTypeName">
+ <xsl:call-template name="GetRefName">
+ <xsl:with-param name="ref" select="$extension/@base"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="contains($typeList, concat('*', $baseTypeName, '+'))">
+ <div class="other" style="margin-left: {$margin}em">
+ <xsl:text>&lt;-- Extends: </xsl:text>
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="$extension/@base"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ <xsl:text> (Circular type hierarchy) --&gt;</xsl:text>
+ </div>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Look for base type -->
+ <xsl:variable name="defLoc">
+ <xsl:call-template name="FindComponent">
+ <xsl:with-param name="ref" select="$extension/@base"/>
+ <xsl:with-param name="compType">complex type</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <!-- Complex type was found in current schema. -->
+ <xsl:when test="normalize-space($defLoc)='this'">
+ <xsl:variable name="ctype" select="key('complexType', $baseTypeName)"/>
+ <xsl:call-template name="PrintSampleTypeContent">
+ <xsl:with-param name="type" select="$ctype"/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="isInherited">
+ <xsl:choose>
+ <xsl:when test="$fromTopCType!='false'">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>false</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
+ <xsl:with-param name="addBR">false</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Complex type was not found. -->
+ <xsl:when test="normalize-space($defLoc)='' or normalize-space($defLoc)='none' or normalize-space($defLoc)='xml' or normalize-space($defLoc)='xsd'">
+ <div class="other" style="margin-left: {$margin}em;">
+ <xsl:text>&lt;!-- '</xsl:text>
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="$extension/@base"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ <xsl:text>' super type was not found in this schema. Some elements and attributes may be missing. --></xsl:text>
+ </div>
+ </xsl:when>
+ <!-- Complex type was found in external schema. -->
+ <xsl:otherwise>
+ <xsl:variable name="ctype" select="document($defLoc)/xsd:schema/xsd:complexType[@name=$baseTypeName]"/>
+ <xsl:call-template name="PrintSampleTypeContent">
+ <xsl:with-param name="type" select="$ctype"/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="isInherited">
+ <xsl:choose>
+ <xsl:when test="$fromTopCType!='false'">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>false</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="fromTopCType" select="$fromTopCType"/>
+ <xsl:with-param name="addBR">false</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$defLoc"/>
+ <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <!-- Print out content from this type -->
+ <xsl:if test="$extension/xsd:*[local-name(.)!='annotation']">
+ <xsl:call-template name="PrintSampleParticleList">
+ <xsl:with-param name="list" select="$extension"/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField">
+ <xsl:choose>
+ <xsl:when test="$fromTopCType!='false' and $isInherited='false'">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>false</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <!-- Derivation by restriction on simple content -->
+ <xsl:when test="$type/xsd:simpleContent/xsd:restriction">
+ <!-- Print out simple type constraints-->
+ <span style="margin-left: {$margin}em">
+ <xsl:text> </xsl:text>
+ <xsl:apply-templates select="$type/xsd:simpleContent" mode="sample">
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:apply-templates>
+ <xsl:text> </xsl:text>
+ </span><br/>
+ </xsl:when>
+ <!-- Derivation by extension on simple content -->
+ <xsl:when test="$type/xsd:simpleContent/xsd:extension">
+ <!-- Print out base type name -->
+ <span style="margin-left: {$margin}em">
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="$type/xsd:simpleContent/xsd:extension/@base"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ <xsl:text> </xsl:text>
+ </span><br/>
+ </xsl:when>
+ <!-- No derivation: complex type definition -->
+ <xsl:when test="local-name($type)='complexType'">
+ <!-- Print out content from this type -->
+ <xsl:call-template name="PrintSampleParticleList">
+ <xsl:with-param name="list" select="$type"/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="concat($typeList, '*', $type/@name, '+')"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Prints out sample XML instances from a list of
+ element particle.
+ Param(s):
+ list (Node) required
+ Node containing list of element particles
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ isInherited (boolean) optional
+ If true, display elements using 'inherited' CSS class.
+ isNewField (boolean) optional
+ If true, display elements using 'newFields' CSS class.
+ schemaLoc (String) optional
+ Schema file containing this particle list;
+ if in current schema, 'schemaLoc' is set to 'this'.
+ typeList (String) optional
+ List of types in this call chain. Name of type starts
+ with '*', and ends with '+'. (Used to prevent infinite
+ recursive loop.)
+ -->
+ <xsl:template name="PrintSampleParticleList">
+ <xsl:param name="list"/>
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="isInherited">false</xsl:param>
+ <xsl:param name="isNewField">false</xsl:param>
+ <xsl:param name="schemaLoc">this</xsl:param>
+ <xsl:param name="typeList"/>
+
+ <xsl:if test="$list">
+ <xsl:apply-templates select="$list/xsd:group | $list/xsd:sequence | $list/xsd:choice | $list/xsd:all | $list/xsd:element" mode="sample">
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="isInherited" select="$isInherited"/>
+ <xsl:with-param name="isNewField" select="$isNewField"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Prints out the constraints of simple content
+ to be displayed within a sample XML instance.
+ Param(s):
+ simpleContent (Node) required
+ Node containing with the simple content
+ schemaLoc (String) optional
+ Schema file containing these simple constraints;
+ if in current schema, 'schemaLoc' is set to 'this'.
+ -->
+ <xsl:template name="PrintSampleSimpleConstraints">
+ <xsl:param name="simpleContent"/>
+ <xsl:param name="schemaLoc">this</xsl:param>
+ <xsl:param name="typeList"/>
+
+ <xsl:choose>
+ <!-- Derivation by restriction -->
+ <xsl:when test="$simpleContent/xsd:restriction">
+ <xsl:call-template name="PrintSampleSimpleRestriction">
+ <xsl:with-param name="restriction" select="$simpleContent/xsd:restriction"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Derivation by list -->
+ <xsl:when test="$simpleContent/xsd:list">
+ <xsl:choose>
+ <xsl:when test="$simpleContent/xsd:list/@itemType">
+ <xsl:text>list of: </xsl:text>
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="$simpleContent/xsd:list/@itemType"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>list of: [ </xsl:text>
+ <xsl:call-template name="PrintSampleSimpleConstraints">
+ <xsl:with-param name="simpleContent" select="$simpleContent/xsd:list/xsd:simpleType"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ <xsl:text> ]</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <!-- Derivation by union -->
+ <xsl:when test="$simpleContent/xsd:union">
+ <xsl:text>union of: [ </xsl:text>
+
+ <xsl:variable name="hasMemberTypes">
+ <xsl:if test="normalize-space($simpleContent/xsd:union/@memberTypes)!=''">
+ <xsl:text>true</xsl:text>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:if test="$hasMemberTypes='true'">
+ <xsl:call-template name="PrintWhitespaceList">
+ <xsl:with-param name="value" select="$simpleContent/xsd:union/@memberTypes"/>
+ <xsl:with-param name="compType">type</xsl:with-param>
+ <xsl:with-param name="separator">,</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:for-each select="$simpleContent/xsd:union/xsd:simpleType">
+ <xsl:if test="position()!=1 or $hasMemberTypes='true'">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ <xsl:text>[ </xsl:text>
+ <xsl:call-template name="PrintSampleSimpleConstraints">
+ <xsl:with-param name="simpleContent" select="."/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ <xsl:text> ]</xsl:text>
+ </xsl:for-each>
+
+ <xsl:text> ]</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Prints out the constraints of simple content
+ derived by restriction, which is to be displayed
+ within a sample XML instance.
+ Param(s):
+ restriction (Node) required
+ Node containing with the restriction
+ schemaLoc (String) optional
+ Schema file containing this restriction element;
+ if in current schema, 'schemaLoc' is set to 'this'.
+ -->
+ <xsl:template name="PrintSampleSimpleRestriction">
+ <xsl:param name="restriction"/>
+ <xsl:param name="schemaLoc">this</xsl:param>
+ <xsl:param name="typeList"/>
+
+ <xsl:variable name="typeName" select="$restriction/parent::xsd:simpleType/@name"/>
+
+ <!-- Print out base type info -->
+ <xsl:choose>
+ <!-- Circular type hierarchy -->
+ <xsl:when test="$typeName != '' and contains($typeList, concat('*', $typeName, '+'))">
+ <xsl:call-template name="HandleError">
+ <xsl:with-param name="isTerminating">false</xsl:with-param>
+ <xsl:with-param name="errorMsg">
+ <xsl:text>Circular type reference to '</xsl:text>
+ <xsl:value-of select="$typeName"/>
+ <xsl:text>' in type hierarchy.</xsl:text>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Locally-defined base type -->
+ <xsl:when test="$restriction/xsd:simpleType">
+ <xsl:call-template name="PrintSampleSimpleConstraints">
+ <xsl:with-param name="simpleContent" select="$restriction/xsd:simpleType"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ <xsl:with-param name="typeList" select="$typeList"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Base type reference -->
+ <xsl:when test="$restriction">
+ <xsl:variable name="baseTypeRef" select="$restriction/@base"/>
+ <xsl:variable name="baseTypeName">
+ <xsl:call-template name="GetRefName">
+ <xsl:with-param name="ref" select="$baseTypeRef"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="baseTypeNS">
+ <xsl:call-template name="GetRefNS">
+ <xsl:with-param name="ref" select="$baseTypeRef"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- Write out reference to base type -->
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="$baseTypeRef"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+
+ <!-- Regular Expression Pattern -->
+ <xsl:variable name="pattern">
+ <xsl:call-template name="PrintPatternFacet">
+ <xsl:with-param name="simpleRestrict" select="$restriction"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- Range -->
+ <xsl:variable name="range">
+ <xsl:call-template name="PrintRangeFacets">
+ <xsl:with-param name="simpleRestrict" select="$restriction"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- Length -->
+ <xsl:variable name="length">
+ <xsl:call-template name="PrintLengthFacets">
+ <xsl:with-param name="simpleRestrict" select="$restriction"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Print out facets -->
+ <xsl:if test="$restriction/xsd:enumeration">
+ <xsl:text> (</xsl:text>
+ <xsl:call-template name="PrintEnumFacets">
+ <xsl:with-param name="simpleRestrict" select="$restriction"/>
+ </xsl:call-template>
+ <xsl:text>)</xsl:text>
+ </xsl:if>
+ <xsl:if test="$pattern !=''">
+ <xsl:text> (</xsl:text>
+ <xsl:copy-of select="$pattern"/>
+ <xsl:text>)</xsl:text>
+ </xsl:if>
+ <xsl:if test="$range !=''">
+ <xsl:text> (</xsl:text>
+ <xsl:copy-of select="$range"/>
+ <xsl:text>)</xsl:text>
+ </xsl:if>
+ <xsl:if test="$restriction/xsd:totalDigits">
+ <xsl:text> (</xsl:text>
+ <xsl:call-template name="PrintTotalDigitsFacet">
+ <xsl:with-param name="simpleRestrict" select="$restriction"/>
+ </xsl:call-template>
+ <xsl:text>)</xsl:text>
+ </xsl:if>
+ <xsl:if test="$restriction/xsd:fractionDigits">
+ <xsl:text> (</xsl:text>
+ <xsl:call-template name="PrintFractionDigitsFacet">
+ <xsl:with-param name="simpleRestrict" select="$restriction"/>
+ </xsl:call-template>
+ <xsl:text>)</xsl:text>
+ </xsl:if>
+ <xsl:if test="$length !=''">
+ <xsl:text> (</xsl:text>
+ <xsl:copy-of select="$length"/>
+ <xsl:text>)</xsl:text>
+ </xsl:if>
+ <xsl:if test="$restriction/xsd:whiteSpace">
+ <xsl:text> (</xsl:text>
+ <xsl:call-template name="PrintWhitespaceFacet">
+ <xsl:with-param name="simpleRestrict" select="$restriction"/>
+ </xsl:call-template>
+ <xsl:text>)</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- ******** Schema Component Representation table ******** -->
+
+ <!--
+ Prints out the Schema Component Representation table
+ for a top-level schema component.
+ Param(s):
+ component (Node) required
+ Top-level schema component
+ -->
+ <xsl:template name="SchemaComponentTable">
+ <xsl:param name="component"/>
+
+ <xsl:variable name="componentID">
+ <xsl:call-template name="GetComponentID">
+ <xsl:with-param name="component" select="$component"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:call-template name="CollapseableBox">
+ <xsl:with-param name="id" select="concat($componentID, '_scbox')"/>
+ <xsl:with-param name="styleClass">schemaComponent</xsl:with-param>
+ <xsl:with-param name="caption">Schema Component Representation</xsl:with-param>
+ <xsl:with-param name="contents">
+ <xsl:apply-templates select="$component" mode="schemaComponent"/>
+ </xsl:with-param>
+ <xsl:with-param name="isOpened">false</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Prints out schema component representation of
+ declarations.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ -->
+ <xsl:template match="xsd:attribute[@name] | xsd:element[@name]" mode="schemaComponent">
+ <xsl:param name="margin">0</xsl:param>
+
+ <xsl:call-template name="DisplaySchemaComponent">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="attributes">
+ <!-- Attribute: name -->
+ <xsl:call-template name="DisplayAttr">
+ <xsl:with-param name="attrName">name</xsl:with-param>
+ <xsl:with-param name="attrValue" select="normalize-space(@name)"/>
+ </xsl:call-template>
+ <!-- Attribute: type -->
+ <xsl:if test="@type">
+ <xsl:call-template name="DisplayAttr">
+ <xsl:with-param name="attrName">type</xsl:with-param>
+ <xsl:with-param name="attrValue">
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="normalize-space(@type)"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- Other attributes -->
+ <xsl:call-template name="DisplayOtherAttributes">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="attrsNotToDisplay">*name+*type+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Prints out schema component representation of
+ definitions and key/uniqueness constraints.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ -->
+ <xsl:template match="xsd:attributeGroup[@name] | xsd:complexType[@name] | xsd:simpleType[@name] | xsd:group[@name] | xsd:key | xsd:unique" mode="schemaComponent">
+ <xsl:param name="margin">0</xsl:param>
+
+ <xsl:call-template name="DisplaySchemaComponent">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="attributes">
+ <!-- Attribute: name -->
+ <xsl:call-template name="DisplayAttr">
+ <xsl:with-param name="attrName">name</xsl:with-param>
+ <xsl:with-param name="attrValue" select="normalize-space(@name)"/>
+ </xsl:call-template>
+ <!-- Other attributes -->
+ <xsl:call-template name="DisplayOtherAttributes">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="attrsNotToDisplay">*name+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Prints out schema component representation of attribute
+ references.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ -->
+ <xsl:template match="xsd:attribute[@ref]" mode="schemaComponent">
+ <xsl:param name="margin">0</xsl:param>
+
+ <xsl:call-template name="DisplaySchemaComponent">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="attributes">
+ <!-- Attribute: ref -->
+ <xsl:call-template name="DisplayAttr">
+ <xsl:with-param name="attrName">ref</xsl:with-param>
+ <xsl:with-param name="attrValue">
+ <xsl:call-template name="PrintAttributeRef">
+ <xsl:with-param name="ref" select="normalize-space(@ref)"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ <!-- Other attributes -->
+ <xsl:call-template name="DisplayOtherAttributes">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="attrsNotToDisplay">*ref+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Prints out schema component representation of attribute group
+ references.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ -->
+ <xsl:template match="xsd:attributeGroup[@ref]" mode="schemaComponent">
+ <xsl:param name="margin">0</xsl:param>
+
+ <xsl:call-template name="DisplaySchemaComponent">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="attributes">
+ <!-- Attribute: ref -->
+ <xsl:call-template name="DisplayAttr">
+ <xsl:with-param name="attrName">ref</xsl:with-param>
+ <xsl:with-param name="attrValue">
+ <xsl:call-template name="PrintAttributeGroupRef">
+ <xsl:with-param name="ref" select="normalize-space(@ref)"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ <!-- Other attributes -->
+ <xsl:call-template name="DisplayOtherAttributes">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="attrsNotToDisplay">*ref+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Prints out schema component representation of element
+ references.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ -->
+ <xsl:template match="xsd:element[@ref]" mode="schemaComponent">
+ <xsl:param name="margin">0</xsl:param>
+
+ <xsl:call-template name="DisplaySchemaComponent">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="attributes">
+ <!-- Attribute: ref -->
+ <xsl:call-template name="DisplayAttr">
+ <xsl:with-param name="attrName">ref</xsl:with-param>
+ <xsl:with-param name="attrValue">
+ <xsl:call-template name="PrintElementRef">
+ <xsl:with-param name="ref" select="normalize-space(@ref)"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ <!-- Other attributes -->
+ <xsl:call-template name="DisplayOtherAttributes">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="attrsNotToDisplay">*ref+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Prints out schema component representation of model group
+ references.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ -->
+ <xsl:template match="xsd:group[@ref]" mode="schemaComponent">
+ <xsl:param name="margin">0</xsl:param>
+
+ <xsl:call-template name="DisplaySchemaComponent">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="attributes">
+ <!-- Attribute: ref -->
+ <xsl:call-template name="DisplayAttr">
+ <xsl:with-param name="attrName">ref</xsl:with-param>
+ <xsl:with-param name="attrValue">
+ <xsl:call-template name="PrintGroupRef">
+ <xsl:with-param name="ref" select="normalize-space(@ref)"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ <!-- Other attributes -->
+ <xsl:call-template name="DisplayOtherAttributes">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="attrsNotToDisplay">*ref+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Prints out schema component representation of
+ 'appinfo' and 'documentation' elements.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ -->
+ <xsl:template match="xsd:appinfo | xsd:documentation" mode="schemaComponent">
+ <xsl:param name="margin">0</xsl:param>
+
+ <xsl:call-template name="DisplaySchemaComponent">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="attributes">
+ <!-- Attribute: source -->
+ <xsl:if test="@source">
+ <xsl:call-template name="DisplayAttr">
+ <xsl:with-param name="attrName">source</xsl:with-param>
+ <xsl:with-param name="attrValue">
+ <xsl:call-template name="PrintURI">
+ <xsl:with-param name="uri" select="normalize-space(@source)"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- Other attributes -->
+ <xsl:call-template name="DisplayOtherAttributes">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="attrsNotToDisplay">*source+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="hasAnyContent">true</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Prints out schema component representation of
+ key reference constraints.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ -->
+ <xsl:template match="xsd:keyref" mode="schemaComponent">
+ <xsl:param name="margin">0</xsl:param>
+
+ <xsl:call-template name="DisplaySchemaComponent">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="attributes">
+ <!-- Attribute: name -->
+ <xsl:call-template name="DisplayAttr">
+ <xsl:with-param name="attrName">name</xsl:with-param>
+ <xsl:with-param name="attrValue" select="normalize-space(@name)"/>
+ </xsl:call-template>
+ <!-- Attribute: refers -->
+ <xsl:call-template name="DisplayAttr">
+ <xsl:with-param name="attrName">refer</xsl:with-param>
+ <xsl:with-param name="attrValue">
+ <xsl:call-template name="PrintKeyRef">
+ <xsl:with-param name="ref">
+ <xsl:value-of select="normalize-space(@refer)"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ <!-- Other attributes -->
+ <xsl:call-template name="DisplayOtherAttributes">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="attrsNotToDisplay">*name+*refer+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Prints out schema component representation of
+ derivations by extension and restrictions.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ -->
+ <xsl:template match="xsd:extension | xsd:restriction" mode="schemaComponent">
+ <xsl:param name="margin">0</xsl:param>
+
+ <xsl:call-template name="DisplaySchemaComponent">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="attributes">
+ <!-- Attribute: base -->
+ <xsl:if test="@base">
+ <xsl:call-template name="DisplayAttr">
+ <xsl:with-param name="attrName">base</xsl:with-param>
+ <xsl:with-param name="attrValue">
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="normalize-space(@base)"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- Other attributes -->
+ <xsl:call-template name="DisplayOtherAttributes">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="attrsNotToDisplay">*base+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Prints out schema component representation of
+ derivations by list.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ -->
+ <xsl:template match="xsd:list" mode="schemaComponent">
+ <xsl:param name="margin">0</xsl:param>
+
+ <xsl:call-template name="DisplaySchemaComponent">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="attributes">
+ <!-- Attribute: itemType-->
+ <xsl:if test="@itemType">
+ <xsl:call-template name="DisplayAttr">
+ <xsl:with-param name="attrName">itemType</xsl:with-param>
+ <xsl:with-param name="attrValue">
+ <xsl:call-template name="PrintTypeRef">
+ <xsl:with-param name="ref" select="normalize-space(@itemType)"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- Other attributes -->
+ <xsl:call-template name="DisplayOtherAttributes">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="attrsNotToDisplay">*itemType+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Prints out schema component representation of
+ derivations by union.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ -->
+ <xsl:template match="xsd:union" mode="schemaComponent">
+ <xsl:param name="margin">0</xsl:param>
+
+ <xsl:call-template name="DisplaySchemaComponent">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="attributes">
+ <!-- Attribute: memberTypes-->
+ <xsl:if test="@memberTypes">
+ <xsl:call-template name="DisplayAttr">
+ <xsl:with-param name="attrName">memberTypes</xsl:with-param>
+ <xsl:with-param name="attrValue">
+ <xsl:call-template name="PrintWhitespaceList">
+ <xsl:with-param name="value" select="normalize-space(@memberTypes)"/>
+ <xsl:with-param name="compType">type</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- Other attributes -->
+ <xsl:call-template name="DisplayOtherAttributes">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="attrsNotToDisplay">*memberTypes+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Prints out schema component representation of
+ the root schema element.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ -->
+ <xsl:template match="xsd:schema" mode="schemaComponent">
+ <xsl:param name="margin">0</xsl:param>
+
+ <xsl:call-template name="DisplaySchemaComponent">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="attributes">
+ <!-- Attribute: source -->
+ <xsl:if test="@xml:lang">
+ <xsl:call-template name="DisplayAttr">
+ <xsl:with-param name="attrName">xml:lang</xsl:with-param>
+ <xsl:with-param name="attrValue" select="normalize-space(@xml:lang)"/>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- Other attributes -->
+ <xsl:call-template name="DisplayOtherAttributes">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="attrsNotToDisplay">*lang+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="includeFilter">*include+*import+*redefine+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Default way to print out schema component representation.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ -->
+ <xsl:template match="*" mode="schemaComponent">
+ <xsl:param name="margin">0</xsl:param>
+
+ <xsl:call-template name="DisplaySchemaComponent">
+ <xsl:with-param name="component" select="."/>
+ <xsl:with-param name="margin" select="$margin"/>
+ <xsl:with-param name="attributes">
+ <xsl:call-template name="DisplayOtherAttributes">
+ <xsl:with-param name="component" select="."/>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="excludeFilter">*annotation+</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Prints out comments in schema component representation.
+ Param(s):
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ -->
+ <xsl:template match="comment()" mode="schemaComponent">
+ <xsl:param name="margin">0</xsl:param>
+
+ <div class="comment" style="margin-left: {$margin}em">
+ <xsl:text>&lt;--</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>--&gt;</xsl:text>
+ </div>
+ </xsl:template>
+
+ <!--
+ Displays a schema element in the correct format
+ for the Schema Component Representation table, e.g.
+ tags are one color, and content are another.
+ Param(s):
+ component (Node) required
+ Schema element to be displayed
+ attributes (Result Tree Fragment) optional
+ Pre-formatted attributes of schema element
+ margin (nonNegativeInteger) optional
+ Number of 'em' to indent from left
+ hasAnyContent (boolean) optional
+ Set to true if schema element can accept
+ child elements from namespaces other than
+ the schema namespace, e.g. 'documentation'
+ and 'appinfo'
+ includeFilter (String) optional
+ List of element names, sandwiched between the
+ characters, '*' and '+'. If specified, only the
+ child elements of the component with tags in
+ the list will be displayed.
+ excludeFilter (String) optional
+ List of element names, sandwiched between the
+ characters, '*' and '+'. If specified, display
+ all child elements of the component, except
+ those with tags in the list.
+ -->
+ <xsl:template name="DisplaySchemaComponent">
+ <xsl:param name="component"/>
+ <xsl:param name="attributes"/>
+ <xsl:param name="margin">0</xsl:param>
+ <xsl:param name="hasAnyContent">false</xsl:param>
+ <xsl:param name="includeFilter"/>
+ <xsl:param name="excludeFilter"/>
+
+ <xsl:variable name="tag">
+ <xsl:call-template name="PrintNSPrefix">
+ <xsl:with-param name="prefix">
+ <xsl:call-template name="GetXSDPrefix"/>
+ </xsl:with-param>
+ <xsl:with-param name="nolink">true</xsl:with-param>
+ </xsl:call-template>
+ <xsl:value-of select="local-name($component)"/>
+ </xsl:variable>
+
+ <div style="margin-left: {$margin}em">
+ <!-- Start Tag -->
+ <xsl:text>&lt;</xsl:text>
+ <span class="scTag">
+ <xsl:copy-of select="$tag"/>
+ </span>
+ <!-- Attributes -->
+ <xsl:copy-of select="$attributes"/>
+ <!-- Content -->
+ <xsl:variable name="content">
+ <xsl:choose>
+ <!-- Include filter is on -->
+ <xsl:when test="$includeFilter!=''">
+ <xsl:apply-templates select="$component/xsd:*[contains($includeFilter, concat('*', local-name(.), '+'))]" mode="schemaComponent">
+ <xsl:with-param name="margin" select="$ELEM_INDENT"/>
+ </xsl:apply-templates>
+ <div class="scContent" style="margin-left: {$ELEM_INDENT}em">...</div>
+ </xsl:when>
+ <!-- Exclude filter is on -->
+ <xsl:when test="$excludeFilter!=''">
+ <xsl:apply-templates select="comment() | $component/xsd:*[not(contains($excludeFilter, concat('*', local-name(.), '+')))]" mode="schemaComponent">
+ <xsl:with-param name="margin" select="$ELEM_INDENT"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <!-- Permits any content -->
+ <xsl:when test="$hasAnyContent='true'">
+ <div class="scContent" style="margin-left: {$ELEM_INDENT}em">
+ <xsl:apply-templates select="comment() | $component/* | $component/text()" mode="xpp"/>
+ </div>
+ </xsl:when>
+ <!-- Contains schema elements -->
+ <xsl:otherwise>
+ <xsl:apply-templates select="comment() | $component/xsd:*" mode="schemaComponent">
+ <xsl:with-param name="margin" select="$ELEM_INDENT"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:choose>
+ <!-- Has content -->
+ <xsl:when test="normalize-space($content)!=''">
+ <!-- End of start tag -->
+ <xsl:text>></xsl:text>
+
+ <!-- Content -->
+ <xsl:copy-of select="$content"/>
+
+ <!-- End Tag -->
+ <xsl:text>&lt;/</xsl:text>
+ <span class="scTag">
+ <xsl:copy-of select="$tag"/>
+ </span>
+ <xsl:text>></xsl:text>
+ </xsl:when>
+ <!-- Empty content -->
+ <xsl:otherwise>
+ <!-- End of start tag -->
+ <xsl:text>/></xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+ </xsl:template>
+
+ <!--
+ Displays a schema attribute in the correct format
+ for the Schema Component Representation table, e.g.
+ tags are one color, and content are another.
+ Param(s):
+ attrName (String) required
+ Name of attribute
+ attrValue (Result Tree Fragment) required
+ Value of attribute, which may be links
+ -->
+ <xsl:template name="DisplayAttr">
+ <xsl:param name="attrName"/>
+ <xsl:param name="attrValue"/>
+
+ <xsl:text> </xsl:text>
+ <span class="scTag">
+ <xsl:value-of select="$attrName"/>
+ </span>
+ <xsl:text>="</xsl:text>
+ <xsl:if test="normalize-space($attrValue)!=''">
+ <span class="scContent">
+ <xsl:copy-of select="$attrValue"/>
+ </span>
+ </xsl:if>
+ <xsl:text>"</xsl:text>
+ </xsl:template>
+
+ <!--
+ Displays attributes from a schema element, unless
+ otherwise specified, in the correct format
+ for the Schema Component Representation table, e.g.
+ tags are one color, and content are another.
+ Param(s):
+ component (Node) required
+ Schema element whose attributes are to be displayed
+ attrsNotToDisplay (String) required
+ List of attributes not to be displayed
+ Each attribute name should prepended with '*'
+ and appended with '+'
+ -->
+ <xsl:template name="DisplayOtherAttributes">
+ <xsl:param name="component"/>
+ <xsl:param name="attrsNotToDisplay"/>
+
+ <xsl:for-each select="$component/attribute::*">
+ <xsl:variable name="attrName" select="local-name(.)"/>
+ <xsl:if test="not(contains($attrsNotToDisplay, concat('*', $attrName, '+')))">
+ <xsl:call-template name="DisplayAttr">
+ <xsl:with-param name="attrName" select="normalize-space($attrName)"/>
+ <xsl:with-param name="attrValue" select="normalize-space(.)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+
+
+ <!-- ******** XML Pretty Printer ******** -->
+
+ <!--
+ Puts XHTML elements into the result.
+ -->
+ <xsl:template match="html:*" mode="html">
+ <xsl:element name="{local-name(.)}">
+ <xsl:for-each select="@*">
+ <xsl:copy-of select="."/>
+ </xsl:for-each>
+ <xsl:apply-templates select="* | text()" mode="html"/>
+ </xsl:element>
+ </xsl:template>
+
+ <!--
+ Displays non-XHTML elements found within XHTML elements.
+ -->
+ <xsl:template match="*" mode="html">
+ <xsl:call-template name="WriteElement">
+ <xsl:with-param name="element" select="."/>
+ <xsl:with-param name="mode">html</xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--
+ Displays text node.
+ -->
+ <xsl:template match="text()" mode="html">
+ <xsl:value-of select="."/>
+ </xsl:template>
+
+ <!--
+ Displays an arbitrary XML element.
+ -->
+ <xsl:template match="*" mode="xpp">
+ <code>
+ <xsl:call-template name="WriteElement">
+ <xsl:with-param name="element" select="."/>
+ <xsl:with-param name="mode">xpp</xsl:with-param>
+ </xsl:call-template>
+ </code>
+ </xsl:template>
+
+ <!--
+ Displays an arbitrary XML text node.
+ -->
+ <xsl:template match="text()" mode="xpp">
+ <xsl:value-of select="."/>
+ </xsl:template>
+
+ <!--
+ Displays an XML comment.
+ -->
+ <xsl:template match="comment()" mode="xpp">
+ <div class="comment">
+ <xsl:text>&lt;--</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>--&gt;</xsl:text>
+ </div>
+ </xsl:template>
+
+ <!--
+ Displays an XML element in the documentation, e.g.
+ tags are escaped.
+ Param(s):
+ element (Node) required
+ XML element to display
+ mode (xpp|html) required
+ Which mode to invoke for child elements
+ -->
+ <xsl:template name="WriteElement">
+ <xsl:param name="element"/>
+ <xsl:param name="mode">xpp</xsl:param>
+
+ <!-- Start Tag -->
+ <xsl:text>&lt;</xsl:text>
+ <xsl:call-template name="PrintNSPrefix">
+ <xsl:with-param name="prefix">
+ <xsl:call-template name="GetRefPrefix">
+ <xsl:with-param name="ref" select="name($element)"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:value-of select="local-name($element)"/>
+ <!-- Attributes -->
+ <xsl:for-each select="$element/@*">
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="name(.)"/>
+ <xsl:text>="</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>"</xsl:text>
+ </xsl:for-each>
+
+ <xsl:choose>
+ <xsl:when test="$element/* | $element/text()">
+ <!-- Close Start Tag -->
+ <xsl:text>> </xsl:text>
+ <!-- Content -->
+ <xsl:choose>
+ <xsl:when test="$mode!='xpp'">
+ <xsl:apply-templates select="$element/* | $element/text()" mode="html"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <div style="margin-left: {$ELEM_INDENT}em">
+ <xsl:apply-templates select="$element/* | $element/text()" mode="xpp"/>
+ </div>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!-- End Tag -->
+ <xsl:text>&lt;/</xsl:text>
+ <xsl:call-template name="PrintNSPrefix">
+ <xsl:with-param name="prefix">
+ <xsl:call-template name="GetRefPrefix">
+ <xsl:with-param name="ref" select="name($element)"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ <xsl:value-of select="local-name($element)"/>
+ <xsl:text>></xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Close Start Tag -->
+ <xsl:text>/></xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <!-- ******** Templates for Handling References ******** -->
+
+ <!--
+ Prints out a reference to a term in the glossary section.
+ Param(s):
+ code (String) required
+ Unique ID of glossary term
+ term (String) optional
+ Glossary term
+ -->
+ <xsl:template name="PrintGlossaryTermRef">
+ <xsl:param name="code"/>
+ <xsl:param name="term"/>
+
+ <xsl:choose>
+ <xsl:when test="$code !='' and normalize-space(translate($printGlossary,'TRUE','true'))='true'">
+ <a title="Look up '{$term}' in glossary" href="#{concat($TERM_PREFIX, $code)}">
+ <xsl:choose>
+ <xsl:when test="$term!=''">
+ <xsl:value-of select="$term"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>[term]</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$term"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Prints out a reference to a namespace in the schema.
+ Param(s):
+ prefix (String) required
+ Namespace prefix referenced
+ schemaLoc (String) optional
+ Schema file containing this namespace prefix;
+ if in current schema, 'schemaLoc' is set to 'this'
+ -->
+ <xsl:template name="PrintNamespaceRef">
+ <xsl:param name="prefix"/>
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <xsl:if test="$prefix!=''">
+ <xsl:choose>
+ <xsl:when test="/xsd:schema/namespace::*[local-name(.)=normalize-space($prefix)]">
+ <xsl:variable name="link">
+ <xsl:if test="normalize-space($schemaLoc)!='this'">
+ <xsl:call-template name="GetSchemaDocLocation">
+ <xsl:with-param name="uri" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:value-of select="concat('#', $NS_PREFIX, $prefix)"/>
+ </xsl:variable>
+ <a href="{$link}" title="Find out namespace of '{$prefix}' prefix">
+ <xsl:value-of select="$prefix"/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="title">
+ <xsl:text>Unknown namespace prefix, </xsl:text>
+ <xsl:value-of select="$prefix"/>
+ <xsl:text>.</xsl:text>
+ </xsl:variable>
+ <a href="javascript:void(0)" onclick="alert('{$title}')" title="{$title}">
+ <xsl:value-of select="$prefix"/>
+ </a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Generates a link to an attribute.
+ Param(s):
+ name (String) optional
+ Name of attribute
+ ref (String) optional
+ Reference to attribute
+ (One of 'name' and 'ref' must be provided.)
+ schemaLoc (String) optional
+ Schema file containing this attribute reference
+ if in current schema, 'schemaLoc' is set to 'this'
+ -->
+ <xsl:template name="PrintAttributeRef">
+ <xsl:param name="name"/>
+ <xsl:param name="ref"/>
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <xsl:choose>
+ <xsl:when test="$name!=''">
+ <xsl:call-template name="PrintCompName">
+ <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="compType">attribute</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$ref!=''">
+ <xsl:call-template name="PrintCompRef">
+ <xsl:with-param name="ref" select="$ref"/>
+ <xsl:with-param name="compType">attribute</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Generates a link to an attribute group.
+ Param(s):
+ name (String) optional
+ Name of attribute group
+ ref (String) optional
+ Reference to attribute group
+ (One of 'name' and 'ref' must be provided.)
+ schemaLoc (String) optional
+ Schema file containing this attribute group reference
+ if in current schema, 'schemaLoc' is set to 'this'
+ -->
+ <xsl:template name="PrintAttributeGroupRef">
+ <xsl:param name="name"/>
+ <xsl:param name="ref"/>
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <xsl:choose>
+ <xsl:when test="$name!=''">
+ <xsl:call-template name="PrintCompName">
+ <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="compType">attribute group</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$ref!=''">
+ <xsl:call-template name="PrintCompRef">
+ <xsl:with-param name="ref" select="$ref"/>
+ <xsl:with-param name="compType">attribute group</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Generates a link to an element.
+ Param(s):
+ name (String) optional
+ Name of element
+ ref (String) optional
+ Reference to element
+ (One of 'name' and 'ref' must be provided.)
+ schemaLoc (String) optional
+ Schema file containing this element reference
+ if in current schema, 'schemaLoc' is set to 'this'
+ -->
+ <xsl:template name="PrintElementRef">
+ <xsl:param name="name"/>
+ <xsl:param name="ref"/>
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <xsl:choose>
+ <xsl:when test="$name!=''">
+ <xsl:call-template name="PrintCompName">
+ <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="compType">element</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$ref!=''">
+ <xsl:call-template name="PrintCompRef">
+ <xsl:with-param name="ref" select="$ref"/>
+ <xsl:with-param name="compType">element</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Generates a link to a group.
+ Param(s):
+ name (String) optional
+ Name of group
+ ref (String) optional
+ Reference to group
+ (One of 'name' and 'ref' must be provided.)
+ schemaLoc (String) optional
+ Schema file containing this group reference
+ if in current schema, 'schemaLoc' is set to 'this'
+ -->
+ <xsl:template name="PrintGroupRef">
+ <xsl:param name="name"/>
+ <xsl:param name="ref"/>
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <xsl:choose>
+ <xsl:when test="$name!=''">
+ <xsl:call-template name="PrintCompName">
+ <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="compType">group</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$ref!=''">
+ <xsl:call-template name="PrintCompRef">
+ <xsl:with-param name="ref" select="$ref"/>
+ <xsl:with-param name="compType">group</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Generates a link to a key/uniqueness constraint.
+ Param(s):
+ name (String) optional
+ Name of key/uniqueness constraint
+ ref (String) optional
+ Reference to key/uniqueness constraint
+ (One of 'name' and 'ref' must be provided.)
+ schemaLoc (String) optional
+ Schema file containing this key/uniqueness constraint
+ reference; if in current schema, 'schemaLoc' is set
+ to 'this'
+ -->
+ <xsl:template name="PrintKeyRef">
+ <xsl:param name="name"/>
+ <xsl:param name="ref"/>
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <xsl:choose>
+ <xsl:when test="$name!=''">
+ <xsl:call-template name="PrintCompName">
+ <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="compType">uniqueness/key constraint</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$ref!=''">
+ <xsl:call-template name="PrintCompRef">
+ <xsl:with-param name="ref" select="$ref"/>
+ <xsl:with-param name="compType">uniqueness/key constraint</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Generates a link to a type.
+ Param(s):
+ name (String) optional
+ Name of type
+ ref (String) optional
+ Reference to type
+ (One of 'name' and 'ref' must be provided.)
+ schemaLoc (String) optional
+ Schema file containing this type reference'
+ if in current schema, 'schemaLoc' is set
+ to 'this'
+ -->
+ <xsl:template name="PrintTypeRef">
+ <xsl:param name="name"/>
+ <xsl:param name="ref"/>
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <xsl:choose>
+ <xsl:when test="$name!=''">
+ <span class="type">
+ <xsl:call-template name="PrintCompName">
+ <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="compType">type</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </span>
+ </xsl:when>
+ <xsl:when test="$ref!=''">
+ <span class="type">
+ <xsl:call-template name="PrintCompRef">
+ <xsl:with-param name="ref" select="$ref"/>
+ <xsl:with-param name="compType">type</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </span>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Prints out a link to a schema component's section.
+ Param(s):
+ baseFile (String) optional
+ Documentation file of schema containing this
+ component.
+ If this component belongs to the current schema,
+ omit this variable.
+ If this component is from an included or imported
+ schema, provide this variable.
+ name (String) required
+ Name of schema component
+ compType (String) required
+ Type of schema component
+ errMsg (String) optional
+ Sentence fragment.
+ If specified, link will open up an alert box with
+ an error message. For example, if 'errMsg' was set
+ to "could not be found", 'name' was "x", and
+ 'compType' was "type", the error message would be:
+ "x" type definition could not be found.
+ The sentence fragment should not:
+ -start with a capital letter.
+ -have a space in front
+ -end with a period.
+ schemaLoc (String) optional
+ Schema file containing this component;
+ if in current schema, 'schemaLoc' is set to 'this'
+ -->
+ <xsl:template name="PrintCompName">
+ <xsl:param name="baseFile"/>
+ <xsl:param name="name"/>
+ <xsl:param name="compType"/>
+ <xsl:param name="schemaLoc">this</xsl:param>
+ <xsl:param name="errMsg"/>
+
+ <!-- Get correct terminology for statements -->
+ <xsl:variable name="noun">
+ <xsl:choose>
+ <xsl:when test="$compType='element' or $compType='attribute'">
+ <xsl:text>declaration</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>definition</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- Get prefix to use in anchor name. -->
+ <xsl:variable name="compPrefix">
+ <xsl:choose>
+ <xsl:when test="$compType='attribute'">
+ <xsl:value-of select="$ATTR_PREFIX"/>
+ </xsl:when>
+ <xsl:when test="$compType='attribute group'">
+ <xsl:value-of select="$ATTR_GRP_PREFIX"/>
+ </xsl:when>
+ <xsl:when test="$compType='element'">
+ <xsl:value-of select="$ELEM_PREFIX"/>
+ </xsl:when>
+ <xsl:when test="$compType='group'">
+ <xsl:value-of select="$GRP_PREFIX"/>
+ </xsl:when>
+ <xsl:when test="$compType='type'">
+ <xsl:value-of select="$TYPE_PREFIX"/>
+ </xsl:when>
+ <xsl:when test="$compType='uniqueness/key constraint'">
+ <xsl:value-of select="$KEY_PREFIX"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- Get base URI. -->
+ <xsl:variable name="baseURI">
+ <xsl:choose>
+ <xsl:when test="$baseFile!=''">
+ <xsl:value-of select="$baseFile"/>
+ </xsl:when>
+ <xsl:when test="normalize-space($schemaLoc)!='this'">
+ <xsl:call-template name="GetSchemaDocLocation">
+ <xsl:with-param name="uri" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- Generate message. -->
+ <xsl:variable name="title">
+ <xsl:choose>
+ <!-- Error message was provided. -->
+ <xsl:when test="$errMsg!=''">
+ <xsl:text>"</xsl:text><xsl:value-of select="$name"/><xsl:text>" </xsl:text>
+ <xsl:value-of select="$compType"/><xsl:text> </xsl:text>
+ <xsl:value-of select="$noun"/><xsl:text> </xsl:text>
+ <xsl:value-of select="$errMsg"/>
+ </xsl:when>
+ <!-- There exists a link to the schema component's
+ documentation. -->
+ <xsl:otherwise>
+ <xsl:text>Jump to "</xsl:text>
+ <xsl:value-of select="$name"/>
+ <xsl:text>" </xsl:text>
+ <xsl:value-of select="$compType"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$noun"/>
+ <!-- External link -->
+ <xsl:if test="normalize-space($baseURI)!=''">
+ <xsl:text>(located in external schema documentation)</xsl:text>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>.</xsl:text>
+ </xsl:variable>
+
+ <!-- Generate href link -->
+ <xsl:variable name="link">
+ <xsl:choose>
+ <!-- Error message was provided. -->
+ <xsl:when test="$errMsg!=''">
+ <xsl:text>javascript:void(0)</xsl:text>
+ </xsl:when>
+ <!-- There exists a link to the schema component's
+ documentation. -->
+ <xsl:otherwise>
+ <!-- Base URI -->
+ <xsl:value-of select="normalize-space($baseURI)"/>
+ <!-- Anchor within URI -->
+ <xsl:value-of select="concat('#',normalize-space($compPrefix),normalize-space($name))"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <a title="{$title}" href="{$link}">
+ <!-- External link -->
+ <xsl:if test="normalize-space($baseURI)!=''">
+ <xsl:attribute name="class">externalLink</xsl:attribute>
+ </xsl:if>
+
+ <!-- Error message was provided. -->
+ <xsl:if test="$errMsg!=''">
+ <xsl:attribute name="onclick">
+ <xsl:text>alert('</xsl:text>
+ <xsl:value-of select="$title"/>
+ <xsl:text>');</xsl:text>
+ </xsl:attribute>
+ </xsl:if>
+
+ <xsl:value-of select="$name"/>
+ </a>
+ </xsl:template>
+
+ <!--
+ Prints out a reference to a schema component.
+ This template will try to work out which schema that this
+ component belongs to and print out the appropriate link.
+ component.
+ It will also print out the namespace prefix given
+ in the reference.
+ Param(s):
+ ref (String) required
+ Reference to schema component
+ compType (String) required
+ Type of schema component
+ schemaLoc (String) optional
+ Schema file containing this component reference;
+ if in current schema, 'schemaLoc' is set to 'this'
+ -->
+ <xsl:template name="PrintCompRef">
+ <xsl:param name="ref"/>
+ <xsl:param name="compType"/>
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <!-- Get correct terminology for statements -->
+ <xsl:variable name="noun">
+ <xsl:choose>
+ <xsl:when test="$compType='element' or $compType='attribute'">
+ <xsl:text>declaration</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>definition</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- Get local name -->
+ <xsl:variable name="refName">
+ <xsl:call-template name="GetRefName">
+ <xsl:with-param name="ref" select="$ref"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Get prefix -->
+ <xsl:variable name="refPrefix">
+ <xsl:call-template name="GetRefPrefix">
+ <xsl:with-param name="ref" select="$ref"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Get prefix of this schema's target namespace -->
+ <xsl:variable name="tnPrefix">
+ <xsl:call-template name="GetThisPrefix"/>
+ </xsl:variable>
+
+ <!-- Get file location of the schema component that is
+ being referenced. -->
+ <xsl:variable name="compLoc">
+ <xsl:call-template name="FindComponent">
+ <xsl:with-param name="ref" select="$ref"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Print prefix -->
+ <xsl:call-template name="PrintNSPrefix">
+ <xsl:with-param name="prefix" select="$refPrefix"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+
+ <!-- Print local name -->
+ <xsl:choose>
+ <!-- Component from XML Schema's or XML's namespace -->
+ <xsl:when test="normalize-space($compLoc)='xsd' or normalize-space($compLoc)='xml'">
+ <xsl:value-of select="$refName"/>
+ </xsl:when>
+ <!-- Component found in this schema. -->
+ <xsl:when test="normalize-space($compLoc)='this'">
+ <xsl:call-template name="PrintCompName">
+ <xsl:with-param name="name" select="$refName"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Component not found. -->
+ <xsl:when test="normalize-space($compLoc)='' or normalize-space($compLoc)='none'">
+ <xsl:call-template name="PrintCompName">
+ <xsl:with-param name="name" select="$refName"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ <xsl:with-param name="errMsg">could not be found</xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Component found in an external schema. -->
+ <xsl:otherwise>
+ <!-- Get documentation file for included schema. -->
+ <xsl:variable name="docFile">
+ <xsl:call-template name="GetSchemaDocLocation">
+ <xsl:with-param name="uri" select="$compLoc"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:call-template name="PrintCompName">
+ <xsl:with-param name="baseFile" select="$docFile"/>
+ <xsl:with-param name="name" select="$refName"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <!-- ******** Templates for Finding Components in Different
+ Schema documents ******** -->
+
+ <!-- Special key words: xml, xsd, this, none -->
+ <xsl:template name="FindComponent">
+ <xsl:param name="ref"/>
+ <xsl:param name="compType"/>
+
+ <!-- Get local name -->
+ <xsl:variable name="refName">
+ <xsl:call-template name="GetRefName">
+ <xsl:with-param name="ref" select="$ref"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Get prefix -->
+ <xsl:variable name="refPrefix">
+ <xsl:call-template name="GetRefPrefix">
+ <xsl:with-param name="ref" select="$ref"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Get prefix of this schema's target namespace -->
+ <xsl:variable name="tnPrefix">
+ <xsl:call-template name="GetThisPrefix"/>
+ </xsl:variable>
+
+ <!-- Get prefix of XML Schema -->
+ <xsl:variable name="xsdPrefix">
+ <xsl:call-template name="GetXSDPrefix"/>
+ </xsl:variable>
+
+ <xsl:choose>
+ <!-- Schema component from XML Schema's namespace,
+ unless this schema is for XML Schema -->
+ <xsl:when test="$refPrefix=$xsdPrefix and $xsdPrefix!=$tnPrefix">
+ <xsl:text>xsd</xsl:text>
+ </xsl:when>
+ <!-- Schema component from XML's namespace -->
+ <xsl:when test="$refPrefix='xml'">
+ <xsl:text>xml</xsl:text>
+ </xsl:when>
+ <!-- Schema component from current schema's namespace -->
+ <xsl:when test="$refPrefix=$tnPrefix">
+ <xsl:call-template name="FindComponentInSchema">
+ <xsl:with-param name="name" select="$refName"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ <xsl:with-param name="schema" select="/xsd:schema"/>
+ <xsl:with-param name="schemaFileLoc">this</xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Schema component from imported namespace -->
+ <xsl:when test="normalize-space(translate($searchImportedSchemas, 'TRUE', 'true'))='true'">
+ <xsl:variable name="refNS" select="/xsd:schema/namespace::*[local-name(.)=normalize-space($refPrefix)]"/>
+ <xsl:call-template name="FindComponentInImportedSchemas">
+ <xsl:with-param name="name" select="$refName"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ <xsl:with-param name="compNS" select="$refNS"/>
+ <xsl:with-param name="schema" select="/xsd:schema"/>
+ <xsl:with-param name="index">1</xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="FindComponentInSchema">
+ <xsl:param name="name"/>
+ <xsl:param name="compType"/>
+ <xsl:param name="schema"/>
+ <xsl:param name="schemaFileLoc"/>
+ <xsl:param name="schemasSearched"/>
+
+ <!-- Don't examine this schema if we've already
+ searched it. Prevents infinite recursion.
+ Also check if schema actually exists. -->
+ <xsl:if test="$schema and not(contains($schemasSearched, concat('*', $schemaFileLoc, '+')))">
+ <!-- Find out if the component is in this schema -->
+ <xsl:variable name="thisResult">
+ <xsl:call-template name="IsComponentInSchema">
+ <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ <xsl:with-param name="schema" select="$schema"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <!-- Component found -->
+ <xsl:when test="normalize-space($thisResult)='true'">
+ <xsl:value-of select="$schemaFileLoc"/>
+ </xsl:when>
+ <!-- Component not found -->
+ <xsl:when test="normalize-space(translate($searchIncludedSchemas, 'TRUE', 'true'))='true'">
+ <!-- Search included schemas -->
+ <xsl:variable name="includeResult">
+ <xsl:call-template name="FindComponentInIncludedSchemas">
+ <xsl:with-param name="schema" select="$schema"/>
+ <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ <xsl:with-param name="index">1</xsl:with-param>
+ <xsl:with-param name="schemasSearched" select="concat($schemasSearched, '*', $schemaFileLoc, '+')"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="normalize-space($includeResult)!='' and normalize-space($includeResult)!='none'">
+ <xsl:value-of select="$includeResult"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Search redefined schemas -->
+ <xsl:call-template name="FindComponentInRedefinedSchemas">
+ <xsl:with-param name="schema" select="$schema"/>
+ <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ <xsl:with-param name="index">1</xsl:with-param>
+ <xsl:with-param name="schemasSearched" select="concat($schemasSearched, '*', $schemaFileLoc, '+')"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="IsComponentInSchema">
+ <xsl:param name="name"/>
+ <xsl:param name="compType"/>
+ <xsl:param name="schema"/>
+
+ <xsl:choose>
+ <!-- Schema not found. -->
+ <xsl:when test="not($schema)">
+ <xsl:text>false</xsl:text>
+ </xsl:when>
+ <!-- Search for attribute declaration. -->
+ <xsl:when test="$compType='attribute' and $schema/xsd:attribute[@name=$name]">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <!-- Search for attribute group definition. -->
+ <xsl:when test="$compType='attribute group' and ($schema/xsd:attributeGroup[@name=$name] or $schema/xsd:redefine/xsd:attributeGroup[@name=$name])">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <!-- Search for element declaration. -->
+ <xsl:when test="$compType='element' and $schema/xsd:element[@name=$name]">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <!-- Search for group definition. -->
+ <xsl:when test="$compType='group' and ($schema/xsd:group[@name=$name] or $schema/xsd:redefine/xsd:group[@name=$name])">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <!-- Search for complex type definition. -->
+ <xsl:when test="($compType='type' or $compType='complex type') and ($schema/xsd:complexType[@name=$name] or $schema/xsd:redefine/xsd:complexType[@name=$name])">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <!-- Search for simple type definition. -->
+ <xsl:when test="($compType='type' or $compType='simple type') and ($schema/xsd:simpleType[@name=$name] or $schema/xsd:redefine/xsd:simpleType[@name=$name])">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <!-- Search for uniqueness/key constraint definition. -->
+ <xsl:when test="$compType='uniqueness/key constraint' and ($schema//xsd:element/xsd:key[@name=$name] or $schema//xsd:element/xsd:unique[@name=$name])">
+ <xsl:text>true</xsl:text>
+ </xsl:when>
+ <!-- Component not found. -->
+ <xsl:otherwise>
+ <xsl:text>false</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="FindComponentInIncludedSchemas">
+ <xsl:param name="schema"/>
+ <xsl:param name="name"/>
+ <xsl:param name="compType"/>
+ <xsl:param name="schemasSearched"/>
+ <xsl:param name="index">1</xsl:param>
+
+ <xsl:if test="count($schema/xsd:include) &gt;= number($index)">
+ <!-- Get the 'schemaLocation' attribute of the 'include'
+ element in this schema at position, 'index'. -->
+ <xsl:variable name="schemaLoc" select="$schema/xsd:include[position()=$index]/@schemaLocation"/>
+
+ <xsl:variable name="thisResult">
+ <!-- Search for the component in the current
+ included schema. -->
+ <xsl:call-template name="FindComponentInSchema">
+ <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ <xsl:with-param name="schema" select="document($schemaLoc)/xsd:schema"/>
+ <xsl:with-param name="schemaFileLoc" select="$schemaLoc"/>
+ <xsl:with-param name="schemasSearched" select="$schemasSearched"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <!-- Component was found, so return result. -->
+ <xsl:when test="normalize-space($thisResult)!='' and normalize-space($thisResult)!='none'">
+ <xsl:value-of select="$thisResult"/>
+ </xsl:when>
+ <!-- Component was not found, so keep on searching. -->
+ <xsl:otherwise>
+ <!-- Examine other included schemas in this schema -->
+ <xsl:call-template name="FindComponentInIncludedSchemas">
+ <xsl:with-param name="schema" select="$schema"/>
+ <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ <xsl:with-param name="index" select="number($index)+1"/>
+ <xsl:with-param name="schemasSearched" select="concat($schemasSearched, '*', $schemaLoc, '+')"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="FindComponentInRedefinedSchemas">
+ <xsl:param name="schema"/>
+ <xsl:param name="name"/>
+ <xsl:param name="compType"/>
+ <xsl:param name="schemasSearched"/>
+ <xsl:param name="index">1</xsl:param>
+
+ <xsl:if test="count($schema/xsd:redefine) &gt;= number($index)">
+ <!-- Get the 'schemaLocation' attribute of the 'redefine'
+ element in this schema at position, 'index'. -->
+ <xsl:variable name="schemaLoc" select="$schema/xsd:redefine[position()=$index]/@schemaLocation"/>
+
+ <xsl:variable name="thisResult">
+ <!-- Search for the component in the current
+ redefined schema. -->
+ <xsl:call-template name="FindComponentInSchema">
+ <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ <xsl:with-param name="schema" select="document($schemaLoc)/xsd:schema"/>
+ <xsl:with-param name="schemaFileLoc" select="$schemaLoc"/>
+ <xsl:with-param name="schemasSearched" select="$schemasSearched"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <!-- Component was found, so return result. -->
+ <xsl:when test="normalize-space($thisResult)!='' and normalize-space($thisResult)!='none'">
+ <xsl:value-of select="$thisResult"/>
+ </xsl:when>
+ <!-- Component was not found, so keep on searching. -->
+ <xsl:otherwise>
+ <!-- Examine other redefined schemas in this schema -->
+ <xsl:call-template name="FindComponentInRedefinedSchemas">
+ <xsl:with-param name="schema" select="$schema"/>
+ <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ <xsl:with-param name="index" select="number($index)+1"/>
+ <xsl:with-param name="schemasSearched" select="concat($schemasSearched, '*', $schemaLoc, '+')"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="FindComponentInImportedSchemas">
+ <xsl:param name="schema"/>
+ <xsl:param name="name"/>
+ <xsl:param name="compType"/>
+ <xsl:param name="compNS"/>
+ <xsl:param name="schemasSearched"/>
+ <xsl:param name="index">1</xsl:param>
+
+ <xsl:if test="count($schema/xsd:import) &gt;= number($index)">
+ <!-- Get the 'namespace' attribute of the 'import'
+ element in this schema at position, 'index'. -->
+ <xsl:variable name="schemaNS" select="$schema/xsd:import[position()=$index]/@namespace"/>
+ <!-- Get the 'schemaLocation' attribute. -->
+ <xsl:variable name="schemaLoc" select="$schema/xsd:import[position()=$index]/@schemaLocation"/>
+
+ <xsl:variable name="thisResult">
+ <!-- Check that the imported schema has the matching
+ namespace as the component that we're looking
+ for. -->
+ <xsl:if test="normalize-space($compNS)=normalize-space($schemaNS)">
+ <!-- Search for the component in the current
+ imported schema. -->
+ <xsl:call-template name="FindComponentInSchema">
+ <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ <xsl:with-param name="schema" select="document($schemaLoc)/xsd:schema"/>
+ <xsl:with-param name="schemaFileLoc" select="$schemaLoc"/>
+ <xsl:with-param name="schemasSearched" select="$schemasSearched"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:variable>
+
+ <xsl:choose>
+ <!-- Component was found, so return result. -->
+ <xsl:when test="normalize-space($thisResult)!='' and normalize-space($thisResult)!='none'">
+ <xsl:value-of select="$thisResult"/>
+ </xsl:when>
+ <!-- Component was not found, so keep on searching. -->
+ <xsl:otherwise>
+ <!-- Examine other included schemas in this schema -->
+ <xsl:call-template name="FindComponentInImportedSchemas">
+ <xsl:with-param name="schema" select="$schema"/>
+ <xsl:with-param name="name" select="$name"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ <xsl:with-param name="compNS" select="$compNS"/>
+ <xsl:with-param name="index" select="number($index)+1"/>
+ <xsl:with-param name="schemasSearched" select="concat($schemasSearched, '*', $schemaLoc, '+')"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+
+
+ <!-- ******** General Utility Templates ******** -->
+
+ <!--
+ Creates a box that can be opened and closed, such
+ that the contents can be hidden away until a button
+ is pressed.
+ Param(s):
+ id (String) required
+ Unique ID of the 'div' box
+ caption (String) required
+ Text describing the contents of the box;
+ it will always be shown even when the box
+ is closed
+ contents (String) required
+ Contents of box, which may appear and disappear
+ with the press of a button.
+ anchor (String) optional
+ Anchor, e.g. <a name="...", for this box
+ styleClass (String) optional
+ Additional CSS class for the entire collapseable box
+ isOpened (String) optional
+ Set to true if initially opened, and
+ false if initially closed
+ -->
+ <xsl:template name="CollapseableBox">
+ <xsl:param name="id"/>
+ <xsl:param name="caption"/>
+ <xsl:param name="contents"/>
+ <xsl:param name="anchor"/>
+ <xsl:param name="styleClass"/>
+ <xsl:param name="isOpened">false</xsl:param>
+
+ <xsl:variable name="buttonID" select="concat($id, '_button')"/>
+
+ <div class="{$styleClass} box">
+ <div>
+ <!-- Button to control the opening and closing of the 'div' box -->
+ <xsl:if test="normalize-space(translate($useJavaScript,'TRUE','true'))='true'">
+ <input type="button" id="{$buttonID}" class="control" onclick="switchState('{$id}'); return false;" style="display: none"/>
+ <!--
+ Button's 'display' property is set to 'none',
+ so that button will only be displayed if
+ box can be successfully opened and closed.
+ -->
+ </xsl:if>
+ <!-- Box Title -->
+ <xsl:text> </xsl:text>
+ <span class="caption">
+ <xsl:choose>
+ <xsl:when test="$anchor != ''">
+ <a name="{$anchor}">
+ <xsl:value-of select="$caption"/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$caption"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </span>
+ </div>
+
+ <!-- Box Contents -->
+ <div id="{$id}" class="contents">
+ <xsl:copy-of select="$contents"/>
+ </div>
+ <xsl:if test="normalize-space(translate($useJavaScript,'TRUE','true'))='true'">
+ <xsl:call-template name="PrintJSCode">
+ <xsl:with-param name="code">setState('<xsl:value-of select="$id"/>', <xsl:value-of select="$isOpened"/>);</xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </div>
+ </xsl:template>
+
+ <!--
+ Returns the namespace of an attribute
+ declaration or reference.
+ Param(s):
+ attribute (Node) required
+ Attribute declaration or reference
+ -->
+ <xsl:template name="GetAttributeNS">
+ <xsl:param name="attribute"/>
+
+ <xsl:choose>
+ <!-- Qualified local attribute declaration -->
+ <xsl:when test="$attribute[@name] and (normalize-space(translate($attribute/@form, 'QUALIFED', 'qualifed'))='qualified' or normalize-space(translate(/xsd:schema/@attributeFormDefault, 'QUALIFED', 'qualifed'))='qualified')">
+ <xsl:value-of select="/xsd:schema/@targetNamespace"/>
+ </xsl:when>
+ <!-- Reference to global attribute declaration -->
+ <xsl:when test="$attribute[@ref]">
+ <xsl:call-template name="GetRefNS">
+ <xsl:with-param name="ref" select="$attribute/@ref"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Otherwise, attribute has no namespace -->
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Returns the description that can be used in
+ headers for a schema component.
+ Param(s):
+ component (Node) required
+ Schema component
+ -->
+ <xsl:template name="GetComponentDescription">
+ <xsl:param name="component"/>
+
+ <xsl:choose>
+ <xsl:when test="local-name($component)='all'">
+ <xsl:text>All Model Group</xsl:text>
+ </xsl:when>
+ <xsl:when test="local-name($component)='attribute'">
+ <xsl:text>Attribute</xsl:text>
+ </xsl:when>
+ <xsl:when test="local-name($component)='attributeGroup'">
+ <xsl:text>Attribute Group</xsl:text>
+ </xsl:when>
+ <xsl:when test="local-name($component)='choice'">
+ <xsl:text>Choice Model Group</xsl:text>
+ </xsl:when>
+ <xsl:when test="local-name($component)='complexType'">
+ <xsl:text>Complex Type</xsl:text>
+ </xsl:when>
+ <xsl:when test="local-name($component)='element'">
+ <xsl:text>Element</xsl:text>
+ </xsl:when>
+ <xsl:when test="local-name($component)='group'">
+ <xsl:text>Model Group</xsl:text>
+ </xsl:when>
+ <xsl:when test="local-name($component)='notation'">
+ <xsl:text>Notation</xsl:text>
+ </xsl:when>
+ <xsl:when test="local-name($component)='sequence'">
+ <xsl:text>Sequence Model Group</xsl:text>
+ </xsl:when>
+ <xsl:when test="local-name($component)='simpleType'">
+ <xsl:text>Simple Type</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="HandleError">
+ <xsl:with-param name="isTerminating">true</xsl:with-param>
+ <xsl:with-param name="errorMsg">
+Unknown schema component, <xsl:value-of select="local-name($component)"/>.
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Returns the unique identifier for a top-level schema
+ component. Returns the string "schema" if the 'component'
+ is the root schema element.
+ Param(s):
+ component (Node) required
+ Schema component
+ -->
+ <xsl:template name="GetComponentID">
+ <xsl:param name="component"/>
+
+ <xsl:choose>
+ <xsl:when test="local-name($component)='schema'">
+ <xsl:text>schema</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="componentPrefix">
+ <xsl:call-template name="GetComponentPrefix">
+ <xsl:with-param name="component" select="$component"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="concat($componentPrefix, $component/@name)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Returns the prefix to add in front of a schema component
+ name when generating anchor names.
+ Param(s):
+ component (Node) required
+ Schema component
+ -->
+ <xsl:template name="GetComponentPrefix">
+ <xsl:param name="component"/>
+
+ <xsl:choose>
+ <xsl:when test="local-name($component)='attribute'">
+ <xsl:value-of select="$ATTR_PREFIX"/>
+ </xsl:when>
+ <xsl:when test="local-name($component)='attributeGroup'">
+ <xsl:value-of select="$ATTR_GRP_PREFIX"/>
+ </xsl:when>
+ <xsl:when test="local-name($component)='complexType'">
+ <xsl:value-of select="$CTYPE_PREFIX"/>
+ </xsl:when>
+ <xsl:when test="local-name($component)='element'">
+ <xsl:value-of select="$ELEM_PREFIX"/>
+ </xsl:when>
+ <xsl:when test="local-name($component)='group'">
+ <xsl:value-of select="$GRP_PREFIX"/>
+ </xsl:when>
+ <xsl:when test="local-name($component)='notation'">
+ <xsl:value-of select="$NOTA_PREFIX"/>
+ </xsl:when>
+ <xsl:when test="local-name($component)='simpleType'">
+ <xsl:value-of select="$STYPE_PREFIX"/>
+ </xsl:when>
+ <xsl:when test="local-name($component)='key' or local-name($component)='unique'">
+ <xsl:value-of select="$KEY_PREFIX"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="HandleError">
+ <xsl:with-param name="isTerminating">true</xsl:with-param>
+ <xsl:with-param name="errorMsg">
+Unknown schema component, <xsl:value-of select="local-name($component)"/>.
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Returns a glossary term reference for the
+ schema component type, if applicable.
+ Param(s):
+ component (Node) required
+ Schema component
+ -->
+ <xsl:template name="GetComponentTermRef">
+ <xsl:param name="component"/>
+
+ <xsl:choose>
+ <xsl:when test="local-name($component)='notation'">
+ <xsl:text>Notation</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Returns the namespace prefix of an attribute.
+ Param(s):
+ attribute (Node) required
+ Attribute declaration or reference
+ -->
+ <xsl:template name="GetAttributePrefix">
+ <xsl:param name="attribute"/>
+
+ <xsl:choose>
+ <!-- Element reference -->
+ <xsl:when test="$attribute/@ref">
+ <xsl:call-template name="GetRefPrefix">
+ <xsl:with-param name="ref" select="$attribute/@ref"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Global element declaration -->
+ <xsl:when test="local-name($attribute/..)='schema'">
+ <xsl:call-template name="GetThisPrefix"/>
+ </xsl:when>
+ <!-- Local element declaration -->
+ <xsl:otherwise>
+ <xsl:if test="($attribute/@form and normalize-space($attribute/@form)='qualified') or (/xsd:schema/@attributeFormDefault and normalize-space(/xsd:schema/@attributeFormDefault)='qualified')">
+ <xsl:call-template name="GetThisPrefix"/>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Returns the namespace prefix of an element.
+ Param(s):
+ element (Node) required
+ Element declaration or reference
+ -->
+ <xsl:template name="GetElementPrefix">
+ <xsl:param name="element"/>
+
+ <xsl:choose>
+ <!-- Element reference -->
+ <xsl:when test="$element/@ref">
+ <xsl:call-template name="GetRefPrefix">
+ <xsl:with-param name="ref" select="$element/@ref"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Global element declaration -->
+ <xsl:when test="local-name($element/..)='schema'">
+ <xsl:call-template name="GetThisPrefix"/>
+ </xsl:when>
+ <!-- Local element declaration -->
+ <xsl:otherwise>
+ <xsl:if test="($element/@form and normalize-space($element/@form)='qualified') or (/xsd:schema/@elementFormDefault and normalize-space(/xsd:schema/@elementFormDefault)='qualified')">
+ <xsl:call-template name="GetThisPrefix"/>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Returns the local name of a reference.
+ Param(s):
+ ref (String) required
+ Reference
+ -->
+ <xsl:template name="GetRefName">
+ <xsl:param name="ref"/>
+
+ <xsl:choose>
+ <xsl:when test="contains($ref, ':')">
+ <!-- Ref has namespace prefix -->
+ <xsl:value-of select="substring-after($ref, ':')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Ref has no namespace prefix -->
+ <xsl:value-of select="$ref"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Returns the namespace prefix of a reference.
+ Param(s):
+ ref (String) required
+ Reference
+ -->
+ <xsl:template name="GetRefPrefix">
+ <xsl:param name="ref"/>
+ <!-- Get namespace prefix -->
+ <xsl:value-of select="substring-before($ref, ':')"/>
+ </xsl:template>
+
+ <!--
+ Returns the namespace of a reference.
+ Param(s):
+ ref (String) required
+ Reference
+ -->
+ <xsl:template name="GetRefNS">
+ <xsl:param name="ref"/>
+ <!-- Get namespace prefix -->
+ <xsl:variable name="refPrefix" select="substring-before($ref, ':')"/>
+ <!-- Get namespace -->
+ <xsl:value-of select="/xsd:schema/namespace::*[local-name(.)=normalize-space($refPrefix)]"/>
+ </xsl:template>
+
+ <!--
+ Returns the declared prefix of this schema's target namespace.
+ -->
+ <xsl:template name="GetThisPrefix">
+ <xsl:if test="/xsd:schema/@targetNamespace">
+ <xsl:value-of select="local-name(/xsd:schema/namespace::*[normalize-space(.)=normalize-space(/xsd:schema/@targetNamespace)])"/>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Returns the declared prefix of XML Schema namespace.
+ -->
+ <xsl:template name="GetXSDPrefix">
+ <xsl:value-of select="local-name(/xsd:schema/namespace::*[normalize-space(.)=$XSD_NS])"/>
+ </xsl:template>
+
+ <!--
+ Returns the schema documentation file location for a
+ given URI for a schema, done by looking up the file
+ specified in 'linksFile' variable.
+ It'll throw a fatal error if a value for 'linksFile' was
+ provided and the documentation file for 'uri' could not be
+ found.
+ Param(s):
+ uri (String) required
+ Location of schema file
+ -->
+ <xsl:template name="GetSchemaDocLocation">
+ <xsl:param name="uri"/>
+
+ <xsl:if test="$linksFile!=''">
+ <xsl:variable name="schemaDocFile" select="document($linksFile)/ppp:links/ppp:schema[@file-location=$uri]/@docfile-location"/>
+ <xsl:if test="$schemaDocFile=''">
+ <xsl:call-template name="HandleError">
+ <xsl:with-param name="isTerminating">true</xsl:with-param>
+ <xsl:with-param name="errorMsg">
+Documentation file for the schema at, <xsl:value-of select="$uri"/>,
+was not specified in the links file, <xsl:value-of select="$linksFile"/>.
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:value-of select="$schemaDocFile"/>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Prints out a boolean value.
+ Param(s):
+ boolean (String) required
+ Boolean value
+ -->
+ <xsl:template name="PrintBoolean">
+ <xsl:param name="boolean"/>
+
+ <xsl:choose>
+ <xsl:when test="normalize-space(translate($boolean,'TRUE', 'true'))='true' or normalize-space($boolean)='1'">
+ <xsl:text>yes</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>no</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Prints out a link to the namespace of a prefix,
+ and tacks on a colon in the end.
+ Param(s):
+ prefix (String) required
+ Namespace prefix
+ nolink (boolean) optional
+ If true, doesn't provide a link to the
+ namespace in the namespaces table.
+ schemaLoc (String) optional
+ Schema file containing this namespace prefix;
+ if in current schema, 'schemaLoc' is set to 'this'
+ -->
+ <xsl:template name="PrintNSPrefix">
+ <xsl:param name="prefix"/>
+ <xsl:param name="nolink">false</xsl:param>
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <xsl:if test="$prefix!='' and normalize-space(translate($printNSPrefixes,'TRUE','true'))='true'">
+ <xsl:choose>
+ <xsl:when test="$nolink='false'">
+ <xsl:call-template name="PrintNamespaceRef">
+ <xsl:with-param name="prefix" select="$prefix"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$prefix"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>:</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Prints out the min/max occurrences of a schema component.
+ Param(s):
+ component (Node) optional
+ Schema component
+ minOccurs (String) optional
+ Minimum occurrences
+ maxOccurs (String) optional
+ Maximum occurrences
+ -->
+ <xsl:template name="PrintOccurs">
+ <xsl:param name="component"/>
+ <xsl:param name="minOccurs"/>
+ <xsl:param name="maxOccurs"/>
+
+ <!-- Get min occurs -->
+ <xsl:variable name="min">
+ <xsl:choose>
+ <xsl:when test="$component and local-name($component)='attribute'">
+ <xsl:choose>
+ <xsl:when test="normalize-space($component/@use)='required'">
+ <xsl:text>1</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>0</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$component and $component/@minOccurs">
+ <xsl:value-of select="$component/@minOccurs"/>
+ </xsl:when>
+ <xsl:when test="$minOccurs != ''">
+ <xsl:value-of select="$minOccurs"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>1</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- Get max occurs -->
+ <xsl:variable name="max">
+ <xsl:choose>
+ <xsl:when test="$component and local-name($component)='attribute'">
+ <xsl:choose>
+ <xsl:when test="normalize-space($component/@use)='prohibited'">
+ <xsl:text>0</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>1</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="($component and normalize-space($component/@maxOccurs)='unbounded') or $maxOccurs='unbounded'">
+ <xsl:text>*</xsl:text>
+ </xsl:when>
+ <xsl:when test="$component and $component/@maxOccurs">
+ <xsl:value-of select="$component/@maxOccurs"/>
+ </xsl:when>
+ <xsl:when test="$maxOccurs != ''">
+ <xsl:value-of select="$maxOccurs"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>1</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <span class="occurs">
+ <xsl:choose>
+ <xsl:when test="number($min)=1 and number($max)=1">
+ <xsl:text>[1]</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>[</xsl:text>
+ <xsl:value-of select="$min"/>
+ <xsl:text>..</xsl:text>
+ <xsl:value-of select="$max"/>
+ <xsl:text>]</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </span>
+ </xsl:template>
+
+ <!--
+ Translates occurrence of '#all' in 'block' value
+ of element declarations.
+ Param(s):
+ EBV (String) required
+ Value
+ -->
+ <xsl:template name="PrintBlockSet">
+ <xsl:param name="EBV"/>
+
+ <xsl:choose>
+ <xsl:when test="normalize-space($EBV)='#all'">
+ <xsl:text>restriction, extension, substitution</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$EBV"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Translates occurrence of '#all' in 'final' value
+ of element declarations, and 'block' and 'final' values
+ in complex type definitions.
+ Param(s):
+ EBV (String) required
+ Value
+ -->
+ <xsl:template name="PrintDerivationSet">
+ <xsl:param name="EBV"/>
+
+ <xsl:choose>
+ <xsl:when test="normalize-space($EBV)='#all'">
+ <xsl:text>restriction, extension</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$EBV"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Translates occurrence of '#all' in 'final' value
+ of simple type definitions.
+ Param(s):
+ EBV (String) required
+ Value
+ -->
+ <xsl:template name="PrintSimpleDerivationSet">
+ <xsl:param name="EBV"/>
+
+ <xsl:choose>
+ <xsl:when test="normalize-space($EBV)='#all'">
+ <xsl:text>restriction, list, union</xsl:text>
+ </xsl:when>
+ <xsl:when test="normalize-space($EBV)!=''">
+ <xsl:value-of select="$EBV"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Print out a URI. If it starts with 'http', a link is provided.
+ Param(s):
+ uri (String) required
+ URI to be printed
+ -->
+ <xsl:template name="PrintURI">
+ <xsl:param name="uri"/>
+
+ <xsl:choose>
+ <xsl:when test="starts-with($uri, 'http')">
+ <a title="{$uri}" href="{$uri}">
+ <xsl:value-of select="$uri"/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$uri"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Print out a link to the documentation of schema document.
+ For this happen, the 'linksFile' variable must be provided,
+ it must point to an actual file, and in that file, there
+ must be a mapping from the schema file location to the
+ schema documentation file location.
+ Param(s):
+ uri (String) required
+ Location of schema file
+ -->
+ <xsl:template name="PrintSchemaLink">
+ <xsl:param name="uri"/>
+
+ <xsl:variable name="docFileLoc">
+ <xsl:call-template name="GetSchemaDocLocation">
+ <xsl:with-param name="uri" select="$uri"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="$docFileLoc!=''">
+ <a title="Jump to schema documentation for '{$uri}'." href="{$docFileLoc}">
+ <xsl:value-of select="$uri"/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$uri"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Tokenises a whitespace-separated list of values, and
+ displays them appropriately.
+ Param(s):
+ value (String) required
+ Whitespace-separated list
+ compType (String) optional
+ Specify schema component type if values in list are
+ schema components, so appropriate links can be provided.
+ isInList (boolean) optional
+ If true, place each value within 'li' tags.
+ Assumes that this template is called within an HTML
+ list element.
+ separator (String) optional
+ Character(s) to use to separate resulting values in list.
+ Only used if 'isInList' is false.
+ If none is provided, uses a space character, ' '.
+ isFirst (boolean) optional
+ If false, it's a recursive call from 'PrintWhitespaceList'.
+ schemaLoc (String) optional
+ Schema file containing this all model group;
+ if in current schema, 'schemaLoc' is set to 'this'
+ -->
+ <xsl:template name="PrintWhitespaceList">
+ <xsl:param name="value"/>
+ <xsl:param name="compType"/>
+ <xsl:param name="isInList">false</xsl:param>
+ <xsl:param name="separator"/>
+ <xsl:param name="isFirst">true</xsl:param>
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <xsl:variable name="token" select="normalize-space(substring-before($value, ' '))"/>
+ <xsl:choose>
+ <xsl:when test="$token!=''">
+ <!-- Whitespace found in value -->
+ <!-- Print out token -->
+ <xsl:call-template name="PrintWhitespaceListToken">
+ <xsl:with-param name="token" select="$token"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ <xsl:with-param name="isInList" select="$isInList"/>
+ <xsl:with-param name="separator" select="$separator"/>
+ <xsl:with-param name="isFirst" select="$isFirst"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ <!-- Continue parsing -->
+ <xsl:variable name="rest" select="normalize-space(substring-after($value, $token))"/>
+ <xsl:if test="$rest!=''">
+ <xsl:call-template name="PrintWhitespaceList">
+ <xsl:with-param name="value" select="$rest"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ <xsl:with-param name="isInList" select="$isInList"/>
+ <xsl:with-param name="separator" select="$separator"/>
+ <xsl:with-param name="isFirst">false</xsl:with-param>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- No more whitespaces -->
+ <!-- Print out one last token -->
+ <xsl:if test="normalize-space($value)!=''">
+ <xsl:call-template name="PrintWhitespaceListToken">
+ <xsl:with-param name="token" select="$value"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ <xsl:with-param name="isInList" select="$isInList"/>
+ <xsl:with-param name="separator" select="$separator"/>
+ <xsl:with-param name="isFirst" select="$isFirst"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Helper template for 'PrintWhitespaceList' template,
+ which prints out one token in the list.
+ Param(s):
+ token (String) required
+ Token to be printed
+ compType (String) optional
+ Schema component type of token, if applicable.
+ isInList (boolean) optional
+ If true, place token within 'li' tags.
+ separator (String) optional
+ Character(s) use to separate one token from another.
+ Only used if 'isInList' is false.
+ If none is provided, uses a space character, ' '.
+ isFirst (boolean) optional
+ If true, token is the first value in the list.
+ schemaLoc (String) optional
+ Schema file containing this all model group;
+ if in current schema, 'schemaLoc' is set to 'this'
+ -->
+ <xsl:template name="PrintWhitespaceListToken">
+ <xsl:param name="token"/>
+ <xsl:param name="compType"/>
+ <xsl:param name="isInList">false</xsl:param>
+ <xsl:param name="separator"/>
+ <xsl:param name="isFirst">true</xsl:param>
+ <xsl:param name="schemaLoc">this</xsl:param>
+
+ <xsl:variable name="displayValue">
+ <xsl:choose>
+ <xsl:when test="$compType!=''">
+ <xsl:call-template name="PrintCompRef">
+ <xsl:with-param name="ref" select="normalize-space($token)"/>
+ <xsl:with-param name="compType" select="$compType"/>
+ <xsl:with-param name="schemaLoc" select="$schemaLoc"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="normalize-space($token)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="$isInList!='false'">
+ <li>
+ <xsl:copy-of select="$displayValue"/>
+ </li>
+ </xsl:when>
+ <xsl:when test="$isFirst!='true'">
+ <xsl:choose>
+ <xsl:when test="$separator!=''">
+ <xsl:value-of select="$separator"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text> </xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:copy-of select="$displayValue"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="$displayValue"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Print out a wildcard.
+ Param(s):
+ componentType (attribute|element) required
+ XML Schema component type
+ namespaces (String) required
+ Namespace attribute of wildcard
+ processContents (String) required
+ Process contents attribute of wildcard
+ namespaces (String) required
+ Namespace attribute of wildcard
+ -->
+ <xsl:template name="PrintWildcard">
+ <xsl:param name="componentType">element</xsl:param>
+ <xsl:param name="namespace"/>
+ <xsl:param name="processContents"/>
+ <xsl:param name="minOccurs"/>
+ <xsl:param name="maxOccurs"/>
+
+ <xsl:text>Allow any </xsl:text>
+ <xsl:value-of select="$componentType"/>
+ <xsl:text>s from </xsl:text>
+
+ <xsl:choose>
+ <!-- ##any -->
+ <xsl:when test="not($namespace) or normalize-space($namespace)='##any'">
+ <xsl:text>any namespace</xsl:text>
+ </xsl:when>
+ <!-- ##other -->
+ <xsl:when test="normalize-space($namespace)='##other'">
+ <xsl:text>a namespace other than this schema's namespace</xsl:text>
+ </xsl:when>
+ <!-- ##targetNamespace, ##local, specific namespaces -->
+ <xsl:otherwise>
+ <!-- ##targetNamespace -->
+ <xsl:variable name="hasTargetNS">
+ <xsl:if test="contains($namespace, '##targetNamespace')">
+ <xsl:text>true</xsl:text>
+ </xsl:if>
+ </xsl:variable>
+ <!-- ##local -->
+ <xsl:variable name="hasLocalNS">
+ <xsl:if test="contains($namespace, '##local')">
+ <xsl:text>true</xsl:text>
+ </xsl:if>
+ </xsl:variable>
+ <!-- Specific namespaces -->
+ <!-- Remove '##targetNamespace' string if any-->
+ <xsl:variable name="temp">
+ <xsl:choose>
+ <xsl:when test="$hasTargetNS='true'">
+ <xsl:value-of select="concat(substring-before($namespace, '##targetNamespace'), substring-after($namespace, '##targetNamespace'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$namespace"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- Remove '##local' string if any -->
+ <xsl:variable name="specificNS">
+ <xsl:choose>
+ <xsl:when test="$hasLocalNS='true'">
+ <xsl:value-of select="concat(substring-before($temp, '##local'), substring-after($temp, '##local'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$temp"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="hasSpecificNS">
+ <xsl:if test="normalize-space($specificNS)!=''">
+ <xsl:text>true</xsl:text>
+ </xsl:if>
+ </xsl:variable>
+
+ <xsl:if test="$hasLocalNS='true'">
+ <xsl:text>no namespace</xsl:text>
+ </xsl:if>
+
+ <xsl:if test="$hasTargetNS='true'">
+ <xsl:choose>
+ <xsl:when test="$hasLocalNS='true' and $hasSpecificNS!='true'">
+ <xsl:text> and </xsl:text>
+ </xsl:when>
+ <xsl:when test="$hasLocalNS='true'">
+ <xsl:text>, </xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:text>this schema's namespace</xsl:text>
+ </xsl:if>
+
+ <xsl:if test="$hasSpecificNS='true'">
+ <xsl:choose>
+ <xsl:when test="$hasTargetNS='true' and $hasLocalNS='true'">
+ <xsl:text>, and </xsl:text>
+ </xsl:when>
+ <xsl:when test="$hasTargetNS='true' or $hasLocalNS='true'">
+ <xsl:text> and </xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:text>the following namespace(s): </xsl:text>
+ <xsl:call-template name="PrintWhitespaceList">
+ <xsl:with-param name="value" select="normalize-space($specificNS)"/>
+ <xsl:with-param name="separator">,</xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!-- Process contents -->
+ <xsl:text> (</xsl:text>
+ <xsl:choose>
+ <xsl:when test="$processContents">
+ <xsl:value-of select="normalize-space($processContents)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>strict</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text> validation)</xsl:text>
+ <xsl:text>.</xsl:text>
+
+ <!-- Print min/max occurs -->
+ <xsl:if test="$componentType='element'">
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="PrintOccurs">
+ <xsl:with-param name="minOccurs" select="$minOccurs"/>
+ <xsl:with-param name="maxOccurs" select="$maxOccurs"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Print out the pattern property for derivations by
+ restriction on simple content.
+ Param(s):
+ simpleRestrict (Node) required
+ 'restriction' element
+ -->
+ <xsl:template name="PrintPatternFacet">
+ <xsl:param name="simpleRestrict"/>
+
+ <xsl:if test="$simpleRestrict/xsd:pattern">
+ <em>pattern</em>
+ <xsl:text> = </xsl:text>
+ <xsl:value-of select="$simpleRestrict/xsd:pattern/@value"/>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Print out the total digits property for derivations by
+ restriction on simple content.
+ Param(s):
+ simpleRestrict (Node) required
+ 'restriction' element
+ -->
+ <xsl:template name="PrintTotalDigitsFacet">
+ <xsl:param name="simpleRestrict"/>
+
+ <xsl:if test="$simpleRestrict/xsd:totalDigits">
+ <em>total no. of digits</em>
+ <xsl:text> = </xsl:text>
+ <xsl:value-of select="$simpleRestrict/xsd:totalDigits/@value"/>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Print out the fraction digits property for derivations by
+ restriction on simple content.
+ Param(s):
+ simpleRestrict (Node) required
+ 'restriction' element
+ -->
+ <xsl:template name="PrintFractionDigitsFacet">
+ <xsl:param name="simpleRestrict"/>
+
+ <xsl:if test="$simpleRestrict/xsd:fractionDigits">
+ <em>
+ <xsl:text>no. of fraction digits</xsl:text>
+ </em>
+ <xsl:text> = </xsl:text>
+ <xsl:value-of select="$simpleRestrict/xsd:fractionDigits/@value"/>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Print out the enumeration list for derivations by
+ restriction on simple content.
+ Param(s):
+ simpleRestrict (Node) required
+ 'restriction' element
+ -->
+ <xsl:template name="PrintEnumFacets">
+ <xsl:param name="simpleRestrict"/>
+
+ <xsl:if test="$simpleRestrict/xsd:enumeration">
+ <em>value</em>
+ <xsl:text> comes from list: {</xsl:text>
+
+ <xsl:for-each select="$simpleRestrict/xsd:enumeration">
+ <xsl:if test="position()!=1">
+ <xsl:text>|</xsl:text>
+ </xsl:if>
+ <xsl:text>'</xsl:text>
+ <xsl:value-of select="@value"/>
+ <xsl:text>'</xsl:text>
+ </xsl:for-each>
+
+ <xsl:text>}</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <!--
+ Print out the length property for derivations by
+ restriction on simple content.
+ Param(s):
+ simpleRestrict (Node) required
+ 'restriction' element
+ -->
+ <xsl:template name="PrintLengthFacets">
+ <xsl:param name="simpleRestrict"/>
+
+ <xsl:choose>
+ <xsl:when test="$simpleRestrict/xsd:length">
+ <em>
+ <xsl:text>length</xsl:text>
+ </em>
+ <xsl:text> = </xsl:text>
+ <xsl:value-of select="$simpleRestrict/xsd:length/@value"/>
+ </xsl:when>
+ <xsl:when test="$simpleRestrict/xsd:minLength">
+ <em>
+ <xsl:text>length</xsl:text>
+ </em>
+ <xsl:text> >= </xsl:text>
+ <xsl:value-of select="$simpleRestrict/xsd:minLength/@value"/>
+ </xsl:when>
+ <xsl:when test="$simpleRestrict/xsd:maxLength">
+ <em>
+ <xsl:text>length</xsl:text>
+ </em>
+ <xsl:text> &lt;= </xsl:text>
+ <xsl:value-of select="$simpleRestrict/xsd:maxLength/@value"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Print out the whitespace property for derivations by
+ restriction on simple content.
+ Param(s):
+ simpleRestrict (Node) required
+ 'restriction' element
+ -->
+ <xsl:template name="PrintWhitespaceFacet">
+ <xsl:param name="simpleRestrict"/>
+
+ <xsl:variable name="facetValue" select="normalize-space(translate($simpleRestrict/xsd:whiteSpace/@value, 'ACELOPRSV', 'aceloprsv'))"/>
+
+ <xsl:choose>
+ <xsl:when test="$facetValue='preserve'">
+ <em>Whitespace policy: </em>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">PreserveWS</xsl:with-param>
+ <xsl:with-param name="term">preserve</xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$facetValue='replace'">
+ <em>Whitespace policy: </em>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">ReplaceWS</xsl:with-param>
+ <xsl:with-param name="term">replace</xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$facetValue='collapse'">
+ <em>Whitespace policy: </em>
+ <xsl:call-template name="PrintGlossaryTermRef">
+ <xsl:with-param name="code">CollapseWS</xsl:with-param>
+ <xsl:with-param name="term">collapse</xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Print out the value ranges for derivations by
+ restriction on simple content.
+ Param(s):
+ simpleRestrict (Node) required
+ 'restriction' element
+ -->
+ <xsl:template name="PrintRangeFacets">
+ <xsl:param name="simpleRestrict"/>
+
+ <xsl:choose>
+ <xsl:when test="($simpleRestrict/xsd:minInclusive or $simpleRestrict/xsd:minExclusive) and ($simpleRestrict/xsd:maxInclusive or $simpleRestrict/xsd:maxExclusive)">
+ <xsl:choose>
+ <xsl:when test="$simpleRestrict/xsd:minInclusive">
+ <xsl:value-of select="$simpleRestrict/xsd:minInclusive/@value"/>
+ <xsl:text> &lt;= </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$simpleRestrict/xsd:minExclusive/@value"/>
+ <xsl:text> &lt; </xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <em>
+ <xsl:text>value</xsl:text>
+ </em>
+ <xsl:choose>
+ <xsl:when test="$simpleRestrict/xsd:maxInclusive">
+ <xsl:text> &lt;= </xsl:text>
+ <xsl:value-of select="$simpleRestrict/xsd:maxInclusive/@value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text> &lt; </xsl:text>
+ <xsl:value-of select="$simpleRestrict/xsd:maxExclusive/@value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$simpleRestrict/xsd:minInclusive">
+ <em>
+ <xsl:text>value</xsl:text>
+ </em>
+ <xsl:text> >= </xsl:text>
+ <xsl:value-of select="$simpleRestrict/xsd:minInclusive/@value"/>
+ </xsl:when>
+ <xsl:when test="$simpleRestrict/xsd:minExclusive">
+ <em>
+ <xsl:text>value</xsl:text>
+ </em>
+ <xsl:text> > </xsl:text>
+ <xsl:value-of select="$simpleRestrict/xsd:minExclusive/@value"/>
+ </xsl:when>
+ <xsl:when test="$simpleRestrict/xsd:maxInclusive">
+ <em>
+ <xsl:text>value</xsl:text>
+ </em>
+ <xsl:text> &lt;= </xsl:text>
+ <xsl:value-of select="$simpleRestrict/xsd:maxInclusive/@value"/>
+ </xsl:when>
+ <xsl:when test="$simpleRestrict/xsd:maxExclusive">
+ <em>
+ <xsl:text>value</xsl:text>
+ </em>
+ <xsl:text> &lt; </xsl:text>
+ <xsl:value-of select="$simpleRestrict/xsd:maxExclusive/@value"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Prints out JavaScript code.
+ NOTE: Javascript code is placed within comments to make it
+ work with current browsers. In strict XHTML, JavaScript code
+ should be placed within CDATA sections. However, most
+ browsers generate a syntax error if the page contains
+ CDATA sections. Placing Javascript code within comments
+ means that the code cannot contain two dashes.
+ Param(s):
+ code (Result Tree Fragment) required
+ Javascript code
+ -->
+ <xsl:template name="PrintJSCode">
+ <xsl:param name="code"/>
+
+ <script type="text/javascript">
+ <!-- If browsers start supporting CDATA sections,
+ uncomment the following piece of code. -->
+ <!-- <xsl:text disable-output-escaping="yes">
+&lt;![CDATA[
+</xsl:text> -->
+ <!-- If browsers start supporting CDATA sections,
+ remove the following piece of code. -->
+ <xsl:text disable-output-escaping="yes">
+&lt;!--
+</xsl:text>
+
+ <xsl:value-of select="$code" disable-output-escaping="yes"/>
+ <!-- If browsers start supporting CDATA sections,
+ remove the following piece of code. -->
+ <xsl:text disable-output-escaping="yes">
+// --&gt;
+</xsl:text>
+ <!-- If browsers start supporting CDATA sections,
+ uncomment the following piece of code. -->
+ <!-- <xsl:text disable-output-escaping="yes">
+]]&gt;
+</xsl:text> -->
+ </script>
+ </xsl:template>
+
+ <!--
+ Translates occurrences of a string
+ in a piece of text with another string.
+ Param(s):
+ value (String) required
+ Text to translate
+ strToReplace (String) required
+ String to be replaced
+ replacementStr (String) required
+ Replacement text
+ -->
+ <xsl:template name="TranslateStr">
+ <xsl:param name="value"/>
+ <xsl:param name="strToReplace"/>
+ <xsl:param name="replacementStr"/>
+
+ <xsl:if test="$value != ''">
+ <xsl:variable name="beforeText" select="substring-before($value, $strToReplace)"/>
+ <xsl:choose>
+ <xsl:when test="$beforeText != ''">
+ <xsl:value-of select="$beforeText"/>
+ <xsl:value-of select="$replacementStr"/>
+ <xsl:call-template name="TranslateStr">
+ <xsl:with-param name="value" select="substring-after($value, $strToReplace)"/>
+ <xsl:with-param name="strToReplace" select="$strToReplace"/>
+ <xsl:with-param name="replacementStr" select="$replacementStr"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="HandleError">
+ <xsl:param name="errorMsg"/>
+ <xsl:param name="isTerminating">false</xsl:param>
+
+ <xsl:choose>
+ <xsl:when test="$isTerminating='true'">
+ <xsl:message terminate="yes">
+ <xsl:text>XS3P ERROR: </xsl:text>
+ <xsl:value-of select="$errorMsg"/>
+ </xsl:message>
+ </xsl:when>
+ <xsl:otherwise>
+ <span style="font-weight: bold; color: red">
+ <xsl:text>ERROR: </xsl:text>
+ <xsl:value-of select="$errorMsg"/>
+ </span>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+</xsl:stylesheet> \ No newline at end of file
diff --git a/src/Location.vala b/src/Location.vala
index 5d64e150..c417df7a 100644
--- a/src/Location.vala
+++ b/src/Location.vala
@@ -1,4 +1,25 @@
/*
+ * Copyright (C) 2008, 2009 Nokia Corporation.
+ *
+ * Contact: Marius Vollmer <marius.vollmer@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+/*
FIXME: Remember to unref the needed things!
*/
diff --git a/src/MCE.vala b/src/MCE.vala
index 089424da..6d0f43bc 100755
--- a/src/MCE.vala
+++ b/src/MCE.vala
@@ -1,3 +1,24 @@
+/*
+ * Copyright (C) 2008, 2009 Nokia Corporation.
+ *
+ * Contact: Marius Vollmer <marius.vollmer@nokia.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
using ContextProvider;
using Gee;
diff --git a/src/main.vala b/src/main.vala
index 07e75060..6e61cd88 100755
--- a/src/main.vala
+++ b/src/main.vala
@@ -1,19 +1,21 @@
-/* main.vala
+/*
+ * Copyright (C) 2008, 2009 Nokia Corporation.
*
- * Copyright (C) 2008 Rob Taylor
+ * Contact: Marius Vollmer <marius.vollmer@nokia.com>
*
- * This library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 2.1 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
*
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
*
* Author:
* Rob Taylor <rob.taylor@codethink.co.uk>
diff --git a/src/sqlite-test.vala b/src/sqlite-test.vala
deleted file mode 100644
index 363fd222..00000000
--- a/src/sqlite-test.vala
+++ /dev/null
@@ -1,8 +0,0 @@
-/**
- * Using SQLite in Vala Sample Code
- * Port of an example found on the SQLite site.
- * http://www.sqlite.org/quickstart.html
- */
-
-
-
diff --git a/src/sqlitevala.vala b/src/sqlitevala.vala
deleted file mode 100644
index 8b721d7d..00000000
--- a/src/sqlitevala.vala
+++ /dev/null
@@ -1,75 +0,0 @@
-/* sqlitevala.vala
- *
- * a vala-ified wrapper for sqlite
- *
- * Copyright (C) 2008 Rob Taylor
- *
- * This library is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- * Author:
- * Rob Taylor <rob.taylor@codethink.co.uk>
- */
-
-namespace SqliteVala
-{
- errordomain DatabaseError {
- OPEN_FAILED,
- CLOSE_FAILED
- }
-
- public class Database {
- string db_name;
- bool valid = false;
- internal Sqlite.Database db;
-
- public Database (string db_name) {
- this.db_name = db_name;
- }
-
- public Database.in_memory () {
- this.db_name = ":memory:";
- }
-
- public void open () throws DatabaseError {
- if (valid)
- throw new DatabaseError.OPEN_FAILED("Database already open");
-
- int rc = Sqlite.Database.open (db_name, out db);
- if (rc == Sqlite.OK)
- valid = true;
- else
- throw new DatabaseError.OPEN_FAILED (db.errmsg());
- }
-
- }
-
- public class Query {
- Database db;
- string sql;
- Sqlite.Statement stmt;
- bool valid = true;
-
- public Query (Database db, string sql) {
- this.db = db;
- this.sql = sql;
- if (db.db.prepare_v2 (sql, (int) sql.length, out stmt) == Sqlite.OK)
- valid = true;
- }
-
- public Array<Value> get_row () {
-
- }
- }
-}
-
diff --git a/tools/context2asciidoc.pl b/tools/context2asciidoc.pl
new file mode 100755
index 00000000..90ab644e
--- /dev/null
+++ b/tools/context2asciidoc.pl
@@ -0,0 +1,35 @@
+#!/usr/bin/perl
+#
+# Make a asciidoc document from spec/context.xml
+#
+
+use XML::LibXML::Reader;
+
+$reader = new XML::LibXML::Reader(FD => STDIN)
+ or die "cannot read standard input?";
+
+$depth = 0;
+while ($reader->read) {
+ if ($reader->name eq "node") { # keep track of our position in the context tree
+ if ($reader->nodeType == XML_READER_TYPE_ELEMENT) {
+ $name[$depth] = $reader->getAttribute(name);
+ $id[$depth]++;
+ $depth++ unless $reader->isEmptyElement;
+ } elsif ($reader->nodeType == XML_READER_TYPE_END_ELEMENT) {
+ $depth--;
+ if (!$firsttime++) {
+ pop @name;
+ pop @id;
+ }
+ }
+ } elsif ($reader->name eq "key") { # print keys with type
+ if ($reader->nodeType == XML_READER_TYPE_ELEMENT) {
+ print "*" . join('.', @name) . "." . $reader->getAttribute(name) . "*::\n";
+ } elsif ($reader->nodeType == XML_READER_TYPE_END_ELEMENT) {
+ print "\n";
+ }
+ } elsif ($reader->name eq "doc" && $reader->nodeType == XML_READER_TYPE_ELEMENT) {
+ # print the related documentation
+ print $reader->readInnerXml() . "\n";
+ }
+}
diff --git a/tools/context2html.pl b/tools/context2html.pl
index c5387f8a..a5d80b9d 100755
--- a/tools/context2html.pl
+++ b/tools/context2html.pl
@@ -17,8 +17,10 @@ while ($reader->read) {
$name[$depth] = $reader->getAttribute(name);
$id[$depth]++;
$depth++ unless $reader->isEmptyElement;
- print "<h2>" . join('.', @id) . " " . join('.', @name) . "</h2>\n";
- $firstKey = true;
+ if ($depth > 1) {
+ print "<h2>" . join('.', @id[1..depth+1]) . " " . join('.', @name) . "</h2>\n";
+ $firstKey = true;
+ }
} elsif ($reader->nodeType == XML_READER_TYPE_END_ELEMENT) {
$depth--;
if (!$firsttime++) {
@@ -32,7 +34,7 @@ while ($reader->read) {
print "<ul>\n";
$firstkey = false;
}
- print "<li><strong>" . $reader->getAttribute(name) . " (" . $reader->getAttribute(type). ")</strong> ";
+ print "<li><strong>" . $reader->getAttribute(name) . "</strong> ";
$inKey = !$reader->isEmptyElement;
print "</li>\n" unless ($inKey);
} elsif ($reader->nodeType == XML_READER_TYPE_END_ELEMENT) {
diff --git a/vapi/sqlite3.vapi b/vapi/sqlite3.vapi
deleted file mode 100644
index ae914215..00000000
--- a/vapi/sqlite3.vapi
+++ /dev/null
@@ -1,185 +0,0 @@
-/* sqlite3.vala
- *
- * Copyright (C) 2007 Jürg Billeter
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
-
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
-
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Author:
- * Jürg Billeter <j@bitron.ch>
- */
-
-[CCode (lower_case_cprefix = "sqlite3_", cheader_filename = "sqlite3.h")]
-namespace Sqlite {
- /* Database Connection Handle */
- [Compact]
- [CCode (free_function = "sqlite3_close", cname = "sqlite3", cprefix = "sqlite3_")]
- public class Database {
- public int busy_timeout (int ms);
- public int changes ();
- public int exec (string sql, Callback? sqlite3_callback = null, void* data = null, out string errmsg = null);
- public int extended_result_codes (int onoff);
- public int get_autocommit ();
- public void interrupt ();
- public int64 last_insert_rowid ();
- public int total_changes ();
-
- public int complete (string sql);
- [NoArrayLength]
- public int get_table (string sql, out weak string[] resultp, out int nrow, out int ncolumn, out string errmsg);
- [NoArrayLength]
- public static void free_table (string[] result);
- public static int open (string filename, out Database db);
- public static int open_v2 (string filename, out Database db, int flags = OPEN_READWRITE | OPEN_CREATE, string? zVfs = null);
-
- public int errcode ();
- public weak string errmsg ();
- public int prepare (string sql, int n_bytes, out Statement stmt, out string tail = null);
- public int prepare_v2 (string sql, int n_bytes, out Statement stmt, out string tail = null);
- }
-
- /* Dynamically Typed Value Object */
- [Compact]
- [CCode (cname = "sqlite3_value")]
- public class Value {
- [CCode (cname = "sqlite3_value_blob")]
- public void* to_blob ();
- [CCode (cname = "sqlite3_value_bytes")]
- public int to_bytes ();
- [CCode (cname = "sqlite3_value_double")]
- public double to_double ();
- [CCode (cname = "sqlite3_value_int")]
- public int to_int ();
- [CCode (cname = "sqlite3_value_int64")]
- public int64 to_int64 ();
- [CCode (cname = "sqlite3_value_text")]
- public weak string to_text ();
- [CCode (cname = "sqlite3_value_type")]
- public int to_type ();
- [CCode (cname = "sqlite3_value_numeric_type")]
- public int to_numeric_type ();
- }
-
- [NoArrayLength]
- [CCode (cname = "sqlite3_callback")]
- public static delegate int Callback (void* data, int n_columns, string[] values, string[] column_names);
-
- [CCode (cname = "SQLITE_OK")]
- public const int OK;
- [CCode (cname = "SQLITE_ERROR")]
- public const int ERROR;
- [CCode (cname = "SQLITE_INTERNAL")]
- public const int INTERNAL;
- [CCode (cname = "SQLITE_PERM")]
- public const int PERM;
- [CCode (cname = "SQLITE_ABORT")]
- public const int ABORT;
- [CCode (cname = "SQLITE_BUSY")]
- public const int BUSY;
- [CCode (cname = "SQLITE_LOCKED")]
- public const int LOCKED;
- [CCode (cname = "SQLITE_NOMEM")]
- public const int NOMEM;
- [CCode (cname = "SQLITE_READONLY")]
- public const int READONLY;
- [CCode (cname = "SQLITE_INTERRUPT")]
- public const int INTERRUPT;
- [CCode (cname = "SQLITE_IOERR")]
- public const int IOERR;
- [CCode (cname = "SQLITE_CORRUPT")]
- public const int CORRUPT;
- [CCode (cname = "SQLITE_NOTFOUND")]
- public const int NOTFOUND;
- [CCode (cname = "SQLITE_FULL")]
- public const int FULL;
- [CCode (cname = "SQLITE_CANTOPEN")]
- public const int CANTOPEN;
- [CCode (cname = "SQLITE_PROTOCOL")]
- public const int PROTOCOL;
- [CCode (cname = "SQLITE_EMPTY")]
- public const int EMPTY;
- [CCode (cname = "SQLITE_SCHEMA")]
- public const int SCHEMA;
- [CCode (cname = "SQLITE_TOOBIG")]
- public const int TOOBIG;
- [CCode (cname = "SQLITE_CONSTRAINT")]
- public const int CONSTRAINT;
- [CCode (cname = "SQLITE_MISMATCH")]
- public const int MISMATCH;
- [CCode (cname = "SQLITE_MISUSE")]
- public const int MISUSE;
- [CCode (cname = "SQLITE_NOLFS")]
- public const int NOLFS;
- [CCode (cname = "SQLITE_AUTH")]
- public const int AUTH;
- [CCode (cname = "SQLITE_FORMAT")]
- public const int FORMAT;
- [CCode (cname = "SQLITE_RANGE")]
- public const int RANGE;
- [CCode (cname = "SQLITE_NOTADB")]
- public const int NOTADB;
- [CCode (cname = "SQLITE_ROW")]
- public const int ROW;
- [CCode (cname = "SQLITE_DONE")]
- public const int DONE;
- [CCode (cname = "SQLITE_OPEN_READONLY")]
- public const int OPEN_READONLY;
- [CCode (cname = "SQLITE_OPEN_READWRITE")]
- public const int OPEN_READWRITE;
- [CCode (cname = "SQLITE_OPEN_CREATE")]
- public const int OPEN_CREATE;
- [CCode (cname = "SQLITE_INTEGER")]
- public const int INTEGER;
- [CCode (cname = "SQLITE_FLOAT")]
- public const int FLOAT;
- [CCode (cname = "SQLITE_BLOB")]
- public const int BLOB;
- [CCode (cname = "SQLITE_NULL")]
- public const int NULL;
- [CCode (cname = "SQLITE3_TEXT")]
- public const int TEXT;
-
- /* SQL Statement Object */
- [Compact]
- [CCode (free_function = "sqlite3_finalize", cname = "sqlite3_stmt", cprefix = "sqlite3_")]
- public class Statement {
- public int bind_parameter_count ();
- public int bind_parameter_index (string name);
- public string bind_parameter_name (int index);
- public int clear_bindings ();
- public int column_count ();
- public int data_count ();
- public weak Database db_handle ();
- public int reset ();
- public int step ();
- public int bind_blob (int index, void* value, int n, GLib.DestroyNotify destroy_notify);
- public int bind_double (int index, double value);
- public int bind_int (int index, int value);
- public int bind_int64 (int index, int64 value);
- public int bind_null (int index);
- public int bind_text (int index, string# value, int n = -1, GLib.DestroyNotify destroy_notify = GLib.g_free);
- public int bind_value (int index, Value value);
- public int bind_zeroblob (int index, int n);
- public void* column_blob (int col);
- public int column_bytes (int col);
- public double column_double (int col);
- public int column_int (int col);
- public int64 column_int64 (int col);
- public weak string column_text (int col);
- public int column_type (int col);
- public weak Value column_value (int col);
- public weak string column_name (int index);
- }
-}
-