xsddoc/src/net/sf/xframe/xsddoc/xslt index-all.xsl,NONE,1.1 overview-all.xsl,NONE,1.1 index.xsl,1.4,1.5 xml2html.xsl,1.35,1.36 util.xsl,1.18,1.19
Kurt Riede <[email protected]> Thu, 13 Jan 2005 15:56:45 +0000
| Newsgroups | gmane.text.xml.xframe.xsddoc.devel |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/xslt
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24880/src/net/sf/xframe/xsddoc/xslt
Modified Files:
index.xsl xml2html.xsl util.xsl
Added Files:
index-all.xsl overview-all.xsl
Log Message:
fist version of an index of all components (see RFE 1100551)
--- NEW FILE: overview-all.xsl ---
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the xframe software package
hosted at http://xframe.sourceforge.net
Copyright (c) 2003 Kurt Riede.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xalan="http://xml.apache.org/xslt" xmlns:doc="http://xframe.sf.net/xsddoc/doc">
<!--
This transformation creates an index of all components in all known namespaces
-->
<xsl:output indent="yes" version="4.0" method="xml" encoding="ISO-8859-1" xalan:indent-amount="2" />
<!--
Include xsddoc utilities templates.
-->
<xsl:include href="xmldoc.xsl"/>
<!--
Include xframe utilities templates.
-->
<xsl:include href="util.xsl"/>
<!--
The file name of the schema to extract from.
-->
<xsl:param name="schemaLocation" select="undefined"/>
<!--
The element name to extract.
-->
<xsl:param name="type" select="undefined"/>
<!--
The name attribute of the element to extract.
-->
<xsl:param name="name" select="undefined"/>
<!--
Namespace prefix of target namespace
-->
<xsl:variable name="targetNamespacePrefix">
<xsl:if test="/xs:schema/@targetNamespace">
<xsl:value-of select="local-name(/xs:schema/namespace::*[normalize-space(.)=normalize-space(/xs:schema/@targetNamespace)])"/>
</xsl:if>
</xsl:variable>
<!--
Root template.
-->
<xsl:template match="/">
<xsl:apply-templates select="*"/>
</xsl:template>
<!--
Processing the schema tag, the root element of a schema.
todo change to intermediate XML format
todo also recurse included schemas
-->
<xsl:template match="xs:schema">
<doc:overview-all href="./schema-summary.html">
<xsl:for-each select="@*">
<xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute>
</xsl:for-each>
<xsl:call-template name="xsddocComment"/>
<xsl:apply-templates select="." mode="overview"/>
<xsl:if test="xs:annotation/xs:documentation">
<doc:documentation>
<xsl:for-each select="xs:annotation/xs:documentation">
<xsl:copy-of select="* | text()"/>
</xsl:for-each>
</doc:documentation>
</xsl:if>
</doc:overview-all>
</xsl:template>
<!--
process all schema components.
-->
<xsl:template match="xs:schema" mode="overview">
<xsl:param name="processedLocations" select="/xs:schema/@targetNamespace"/>
<xsl:param name="ignore"/>
<xsl:apply-templates select="xs:element | xs:attribute | xs:complexType | xs:simpleType | xs:group | xs:attributeGroup" mode="doc">
<xsl:with-param name="ignore" select="$ignore"/>
</xsl:apply-templates>
<xsl:for-each select="xs:element | xs:complexType">
<xsl:apply-templates select=".//xs:element[(not (@ref)) and (not (@type))]" mode="doc">
<xsl:with-param name="ignore" select="$ignore"/>
</xsl:apply-templates>
</xsl:for-each>
<xsl:for-each select="xs:include | xs:redefine | xs:import">
<xsl:variable name="schemaLocation" select="@schemaLocation"/>
<xsl:variable name="redefinedComponents">
<xsl:call-template name="tostring">
<xsl:with-param name="nodes" select="xs:element | xs:attribute | xs:complexType | xs:simpleType | xs:group | xs:attributeGroup"/>
</xsl:call-template>
</xsl:variable>
<xsl:apply-templates select="xs:element | xs:attribute | xs:complexType | xs:simpleType | xs:group | xs:attributeGroup" mode="doc">
<xsl:with-param name="ignore" select="$ignore"/>
</xsl:apply-templates>
<xsl:if test="not(contains($processedLocations, $schemaLocation))">
<xsl:apply-templates select="document($schemaLocation)/xs:schema" mode="overview">
<xsl:with-param name="processedLocations" select="concat($processedLocations, ' ', $schemaLocation)"/>
<xsl:with-param name="ignore" select="$redefinedComponents"/>
</xsl:apply-templates>
</xsl:if>
</xsl:for-each>
</xsl:template>
<!--
Create an index entry.
-->
<xsl:template match="*" mode="doc">
<xsl:param name="ignore"/>
<xsl:if test="string(@name) != '' and not(contains($ignore, concat('|', local-name(), ':', @name, '|')))">
<xsl:variable name="hierarchy">
<xsl:apply-templates select=".." mode="parent"/>
</xsl:variable>
<xsl:variable name="name">
<xsl:choose>
<xsl:when test="string($hierarchy) != ''">
<xsl:value-of select="concat(string($hierarchy), @name)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(local-name(), '/', @name)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="ns">
<xsl:choose>
<xsl:when test="normalize-space(/xs:schema/@targetNamespace) = ''">
<xsl:value-of select="string('noNamespace')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="/xs:schema/@targetNamespace"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="nsFolder">
<xsl:call-template name="namespaceFolder">
<xsl:with-param name="uri" select="/xs:schema/@targetNamespace"/>
</xsl:call-template>
</xsl:variable>
<doc:component type="{substring-before($name, '/')}">
<xsl:attribute name="localtype">
<xsl:value-of select="local-name()"/>
</xsl:attribute>
<xsl:attribute name="namespace">
<xsl:value-of select="$ns"/>
</xsl:attribute>
<xsl:attribute name="name">
<xsl:value-of select="substring-after($name, '/')"/>
</xsl:attribute>
<xsl:attribute name="tag">
<xsl:call-template name="last-substring">
<xsl:with-param name="string" select="@name"/>
<xsl:with-param name="substring" select="string('.')"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="concat($nsFolder, '/', $name, '.html')"/>
</xsl:attribute>
<xsl:if test="xs:annotation/xs:documentation">
<doc:documentation>
<xsl:for-each select="xs:annotation/xs:documentation">
<xsl:copy-of select="* | text()"/>
</xsl:for-each>
</doc:documentation>
</xsl:if>
</doc:component>
</xsl:if>
</xsl:template>
<!--
-->
<xsl:template match="*" mode="parent">
<xsl:param name="parent"/>
<xsl:choose>
<xsl:when test="local-name() = 'schema'">
<xsl:value-of select="$parent"/>
</xsl:when>
<xsl:when test="@name">
<xsl:apply-templates select=".." mode="parent">
<xsl:with-param name="parent">
<xsl:if test="local-name(..) = 'schema'">
<xsl:value-of select="concat(local-name(), '/')"/>
</xsl:if>
<xsl:value-of select="@name"/>
<xsl:text>.</xsl:text>
<xsl:value-of select="$parent"/>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select=".." mode="parent">
<xsl:with-param name="parent" select="$parent"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!--
-->
<xsl:template name="tostring">
<xsl:param name="nodes"/>
<xsl:for-each select="$nodes">
<xsl:value-of select="concat('|', local-name(), ':', @name, '|')"/>
</xsl:for-each>
</xsl:template>
<!--
Type definitions keys.
-->
<xsl:key name="typeDefinitions" match="/xs:schema/xs:complexType | /xs:schema/xs:simpleType" use="concat('{', ../@targetNamespace, '}', @name)"/>
<!--
Type redefinitions keys.
-->
<xsl:key name="typeRedefinitions" match="/xs:schema/xs:redefine/xs:simpleType | /xs:schema/xs:redefine/xs:complexType" use="concat('{', ../../@targetNamespace, '}', @name)"/>
<!--
Attribute declarations key.
-->
<xsl:key name="attributeDeclarations" match="/xs:schema/xs:attribute" use="concat('{', ../@targetNamespace, '}', @name)"/>
<!--
Element declarations key.
-->
<xsl:key name="elementDeclarations" match="/xs:schema/xs:element" use="concat('{', ../@targetNamespace, '}', @name)"/>
<!--
Attribute group declarations key.
-->
<xsl:key name="attributeGroupDefinitions" match="/xs:schema/xs:attributeGroup" use="concat('{', ../@targetNamespace, '}', @name)"/>
<!--
Attribute group declarations key.
-->
<xsl:key name="attributeGroupRedefinitions" match="/xs:schema/xs:redefine/xs:attributeGroup" use="concat('{', ../../@targetNamespace, '}', @name)"/>
<!--
Group declarations key.
-->
<xsl:key name="modelGroupDefinitions" match="/xs:schema/xs:group" use="concat('{', ../@targetNamespace, '}', @name)"/>
<!--
Group redeclarations key.
-->
<xsl:key name="modelGroupRedefinitions" match="/xs:schema/xs:redefine/xs:group" use="concat('{', ../../@targetNamespace, '}', @name)"/>
<!--
Notation declarations key.
-->
<xsl:key name="notationDeclarations" match="/xs:schema/xs:notation" use="concat('{', ../@targetNamespace, '}', @name)"/>
<!--
Derived complex type definitions key.
-->
<xsl:key name="derivedComplexTypeDefinitions" match="/xs:schema/xs:complexType" use="xs:complexContent/xs:*/@base"/>
<!--
Derived simple type definitions key.
-->
<xsl:key name="derivedSimpleTypeDefinitions" match="/xs:schema/xs:simpleType" use="xs:*/@base"/>
</xsl:stylesheet>
--- NEW FILE: index-all.xsl ---
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the xframe software package
hosted at http://xframe.sourceforge.net
Copyright (c) 2003 Kurt Riede.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xalan="http://xml.apache.org/xslt" xmlns:doc="http://xframe.sf.net/xsddoc/doc">
<!--
This transformation creates an index of all components in all known namespaces
-->
<xsl:output indent="yes" version="4.0" method="xml" encoding="ISO-8859-1" xalan:indent-amount="2" />
<!--
Include xsddoc utilities templates.
-->
<xsl:include href="xmldoc.xsl"/>
<!--
Include xframe utilities templates.
-->
<xsl:include href="util.xsl"/>
<!--
The file name of the schema to extract from.
-->
<xsl:param name="schemaLocation" select="undefined"/>
<!--
The element name to extract.
-->
<xsl:param name="type" select="undefined"/>
<!--
The name attribute of the element to extract.
-->
<xsl:param name="name" select="undefined"/>
<!--
Namespace prefix of target namespace
-->
<xsl:variable name="targetNamespacePrefix">
<xsl:if test="/xs:schema/@targetNamespace">
<xsl:value-of select="local-name(/xs:schema/namespace::*[normalize-space(.)=normalize-space(/xs:schema/@targetNamespace)])"/>
</xsl:if>
</xsl:variable>
<!--
Root template.
-->
<xsl:template match="/">
<xsl:apply-templates select="*"/>
</xsl:template>
<!--
Processing the schema tag, the root element of a schema.
todo change to intermediate XML format
todo also recurse included schemas
-->
<xsl:template match="xs:schema">
<doc:index-all href="./schema-summary.html">
<xsl:for-each select="@*">
<xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute>
</xsl:for-each>
<xsl:call-template name="xsddocComment"/>
<xsl:apply-templates select="." mode="overview"/>
<xsl:if test="xs:annotation/xs:documentation">
<doc:documentation>
<xsl:for-each select="xs:annotation/xs:documentation">
<xsl:copy-of select="* | text()"/>
</xsl:for-each>
</doc:documentation>
</xsl:if>
</doc:index-all>
</xsl:template>
<!--
process all schema components.
-->
<xsl:template match="xs:schema" mode="overview">
<xsl:param name="processedLocations" select="/xs:schema/@targetNamespace"/>
<xsl:param name="ignore"/>
<xsl:apply-templates select="xs:element | xs:attribute | xs:complexType | xs:simpleType | xs:group | xs:attributeGroup" mode="doc">
<xsl:with-param name="ignore" select="$ignore"/>
</xsl:apply-templates>
<xsl:for-each select="xs:element | xs:complexType">
<xsl:apply-templates select=".//xs:element[(not (@ref)) and (not (@type))]" mode="doc">
<xsl:with-param name="ignore" select="$ignore"/>
</xsl:apply-templates>
</xsl:for-each>
<xsl:for-each select="xs:include | xs:redefine | xs:import">
<xsl:variable name="schemaLocation" select="@schemaLocation"/>
<xsl:variable name="redefinedComponents">
<xsl:call-template name="tostring">
<xsl:with-param name="nodes" select="xs:element | xs:attribute | xs:complexType | xs:simpleType | xs:group | xs:attributeGroup"/>
</xsl:call-template>
</xsl:variable>
<xsl:apply-templates select="xs:element | xs:attribute | xs:complexType | xs:simpleType | xs:group | xs:attributeGroup" mode="doc">
<xsl:with-param name="ignore" select="$ignore"/>
</xsl:apply-templates>
<xsl:if test="not(contains($processedLocations, $schemaLocation))">
<xsl:apply-templates select="document($schemaLocation)/xs:schema" mode="overview">
<xsl:with-param name="processedLocations" select="concat($processedLocations, ' ', $schemaLocation)"/>
<xsl:with-param name="ignore" select="$redefinedComponents"/>
</xsl:apply-templates>
</xsl:if>
</xsl:for-each>
</xsl:template>
<!--
Create an index entry.
-->
<xsl:template match="*" mode="doc">
<xsl:param name="ignore"/>
<xsl:if test="string(@name) != '' and not(contains($ignore, concat('|', local-name(), ':', @name, '|')))">
<xsl:variable name="hierarchy">
<xsl:apply-templates select=".." mode="parent"/>
</xsl:variable>
<xsl:variable name="name">
<xsl:choose>
<xsl:when test="string($hierarchy) != ''">
<xsl:value-of select="concat(string($hierarchy), @name)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(local-name(), '/', @name)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="ns">
<xsl:choose>
<xsl:when test="normalize-space(/xs:schema/@targetNamespace) = ''">
<xsl:value-of select="string('noNamespace')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="/xs:schema/@targetNamespace"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="nsFolder">
<xsl:call-template name="namespaceFolder">
<xsl:with-param name="uri" select="/xs:schema/@targetNamespace"/>
</xsl:call-template>
</xsl:variable>
<doc:component type="{substring-before($name, '/')}">
<xsl:attribute name="localtype">
<xsl:value-of select="local-name()"/>
</xsl:attribute>
<xsl:attribute name="namespace">
<xsl:value-of select="$ns"/>
</xsl:attribute>
<xsl:attribute name="name">
<xsl:value-of select="substring-after($name, '/')"/>
</xsl:attribute>
<xsl:attribute name="tag">
<xsl:call-template name="last-substring">
<xsl:with-param name="string" select="@name"/>
<xsl:with-param name="substring" select="string('.')"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="concat($nsFolder, '/', $name, '.html')"/>
</xsl:attribute>
<xsl:if test="xs:annotation/xs:documentation">
<doc:documentation>
<xsl:for-each select="xs:annotation/xs:documentation">
<xsl:copy-of select="* | text()"/>
</xsl:for-each>
</doc:documentation>
</xsl:if>
</doc:component>
</xsl:if>
</xsl:template>
<!--
-->
<xsl:template match="*" mode="parent">
<xsl:param name="parent"/>
<xsl:choose>
<xsl:when test="local-name() = 'schema'">
<xsl:value-of select="$parent"/>
</xsl:when>
<xsl:when test="@name">
<xsl:apply-templates select=".." mode="parent">
<xsl:with-param name="parent">
<xsl:if test="local-name(..) = 'schema'">
<xsl:value-of select="concat(local-name(), '/')"/>
</xsl:if>
<xsl:value-of select="@name"/>
<xsl:text>.</xsl:text>
<xsl:value-of select="$parent"/>
</xsl:with-param>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select=".." mode="parent">
<xsl:with-param name="parent" select="$parent"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!--
-->
<xsl:template name="tostring">
<xsl:param name="nodes"/>
<xsl:for-each select="$nodes">
<xsl:value-of select="concat('|', local-name(), ':', @name, '|')"/>
</xsl:for-each>
</xsl:template>
<!--
Type definitions keys.
-->
<xsl:key name="typeDefinitions" match="/xs:schema/xs:complexType | /xs:schema/xs:simpleType" use="concat('{', ../@targetNamespace, '}', @name)"/>
<!--
Type redefinitions keys.
-->
<xsl:key name="typeRedefinitions" match="/xs:schema/xs:redefine/xs:simpleType | /xs:schema/xs:redefine/xs:complexType" use="concat('{', ../../@targetNamespace, '}', @name)"/>
<!--
Attribute declarations key.
-->
<xsl:key name="attributeDeclarations" match="/xs:schema/xs:attribute" use="concat('{', ../@targetNamespace, '}', @name)"/>
<!--
Element declarations key.
-->
<xsl:key name="elementDeclarations" match="/xs:schema/xs:element" use="concat('{', ../@targetNamespace, '}', @name)"/>
<!--
Attribute group declarations key.
-->
<xsl:key name="attributeGroupDefinitions" match="/xs:schema/xs:attributeGroup" use="concat('{', ../@targetNamespace, '}', @name)"/>
<!--
Attribute group declarations key.
-->
<xsl:key name="attributeGroupRedefinitions" match="/xs:schema/xs:redefine/xs:attributeGroup" use="concat('{', ../../@targetNamespace, '}', @name)"/>
<!--
Group declarations key.
-->
<xsl:key name="modelGroupDefinitions" match="/xs:schema/xs:group" use="concat('{', ../@targetNamespace, '}', @name)"/>
<!--
Group redeclarations key.
-->
<xsl:key name="modelGroupRedefinitions" match="/xs:schema/xs:redefine/xs:group" use="concat('{', ../../@targetNamespace, '}', @name)"/>
<!--
Notation declarations key.
-->
<xsl:key name="notationDeclarations" match="/xs:schema/xs:notation" use="concat('{', ../@targetNamespace, '}', @name)"/>
<!--
Derived complex type definitions key.
-->
<xsl:key name="derivedComplexTypeDefinitions" match="/xs:schema/xs:complexType" use="xs:complexContent/xs:*/@base"/>
<!--
Derived simple type definitions key.
-->
<xsl:key name="derivedSimpleTypeDefinitions" match="/xs:schema/xs:simpleType" use="xs:*/@base"/>
</xsl:stylesheet>
Index: xml2html.xsl
===================================================================
RCS file: /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/xslt/xml2html.xsl,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** xml2html.xsl 27 Dec 2004 15:28:14 -0000 1.35
--- xml2html.xsl 13 Jan 2005 15:56:35 -0000 1.36
***************
*** 78,85 ****
</head>
<body>
! <a href="{@href}" target="content">
! <xsl:value-of select="@namespace"/>
! </a>
! <br/>
<xsl:if test="doc:component[@type = 'element']">
<br/>
--- 78,93 ----
</head>
<body>
! <xsl:choose>
! <xsl:when test="@namespace">
! <a href="{@href}" target="content">
! <xsl:value-of select="@namespace"/>
! </a>
! <br/>
! </xsl:when>
! <xsl:otherwise>
! <xsl:text>All components</xsl:text>
! <br/>
! </xsl:otherwise>
! </xsl:choose>
<xsl:if test="doc:component[@type = 'element']">
<br/>
***************
*** 146,149 ****
--- 154,243 ----
</xsl:template>
<!--
+ Template for the overview of all elements.
+ -->
+ <xsl:template match="doc:overview-all">
+ <html>
+ <xsl:call-template name="xsddocComment"/>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+ <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"/>
+ </head>
+ <body>
+ <xsl:choose>
+ <xsl:when test="@namespace">
+ <a href="{@href}" target="content">
+ <xsl:value-of select="@namespace"/>
+ </a>
+ <br/>
+ </xsl:when>
+ <xsl:otherwise>
+ <b><xsl:text>All components</xsl:text></b>
+ <br/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="doc:component[@localtype = 'element']">
+ <br/>
+ <b>
+ <xsl:text>elements</xsl:text>
+ </b>
+ <br/>
+ <xsl:apply-templates select="doc:component[@localtype = 'element']" mode="overview-all">
+ <xsl:sort select="@tag"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ <xsl:if test="$hideAttributes = 'false' and doc:component[@localtype = 'attribute']">
+ <br/>
+ <b>
+ <xsl:text>attributes</xsl:text>
+ </b>
+ <br/>
+ <xsl:apply-templates select="doc:component[@localtype = 'attribute']" mode="overview-all">
+ <xsl:sort select="@tag"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ <xsl:if test="$hideTypes = 'false' and doc:component[@localtype = 'complexType']">
+ <br/>
+ <b>
+ <xsl:text>complexTypes</xsl:text>
+ </b>
+ <br/>
+ <xsl:apply-templates select="doc:component[@localtype = 'complexType']" mode="overview-all">
+ <xsl:sort select="@tag"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ <xsl:if test="$hideTypes = 'false' and doc:component[@localtype = 'simpleType']">
+ <br/>
+ <b>
+ <xsl:text>simpleTypes</xsl:text>
+ </b>
+ <br/>
+ <xsl:apply-templates select="doc:component[@localtype = 'simpleType']" mode="overview-all">
+ <xsl:sort select="@tag"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ <xsl:if test="$hideGroups = 'false' and doc:component[@localtype = 'group']">
+ <br/>
+ <b>
+ <xsl:text>groups</xsl:text>
+ </b>
+ <br/>
+ <xsl:apply-templates select="doc:component[@localtype = 'group']" mode="overview-all">
+ <xsl:sort select="@tag"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ <xsl:if test="$hideGroups = 'false' and doc:component[@localtype = 'attributeGroup']">
+ <br/>
+ <b>
+ <xsl:text>attributeGroups</xsl:text>
+ </b>
+ <br/>
+ <xsl:apply-templates select="doc:component[@localtype = 'attributeGroup']" mode="overview">
+ <xsl:sort select="@name"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ </body>
+ </html>
+ </xsl:template>
+ <!--
Template for the list entries in overviews.
-->
***************
*** 155,158 ****
--- 249,261 ----
</xsl:template>
<!--
+ Template for the list entries in overviews-all.
+ -->
+ <xsl:template match="*" mode="overview-all">
+ <a href="{@href}" target="content">
+ <xsl:value-of select="@tag"/>
+ </a>
+ <br/>
+ </xsl:template>
+ <!--
Template for schema-summary pages
-->
***************
*** 279,282 ****
--- 382,453 ----
</xsl:template>
<!--
+ Template for index of all components.
+ -->
+ <xsl:template match="doc:index-all">
+ <html>
+ <xsl:call-template name="xsddocComment"/>
+ <head>
+ <title>Index of all Namespace</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+ <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"/>
+ </head>
+ <body>
+ <xsl:call-template name="navigationIndex"/>
+ <p>
+ <xsl:apply-templates select="doc:component" mode="index-all">
+ <xsl:sort select="concat(@tag, '.', @namespace)"/>
+ </xsl:apply-templates>
+ </p>
+ <hr/>
+ <xsl:call-template name="navigationIndex"/>
+ <xsl:call-template name="bottom"/>
+ </body>
+ </html>
+ </xsl:template>
+ <!--
+ Format index entry in index-all.
+ -->
+ <xsl:template match="doc:component" mode="index-all">
+ <xsl:variable name="base">
+ <xsl:choose>
+ <xsl:when test="contains(@name, '.')">
+ <xsl:value-of select="substring-before(@name, concat('.', @tag))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="string('')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <dl>
+ <a href="{@href}">
+ <b><xsl:value-of select="@tag"/></b>
+ </a>
+ <xsl:text> - </xsl:text>
+ <xsl:if test="contains(@name, '.')">
+ <xsl:text>nested element in </xsl:text>
+ </xsl:if>
+ <xsl:value-of select="@type"/>
+ <xsl:choose>
+ <xsl:when test="@namespace">
+ <xsl:text> of namespace </xsl:text>
+ <xsl:value-of select="@namespace"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text> in no namespace.</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <dd>
+ <xsl:choose>
+ <xsl:when test="doc:documentation">
+ <xsl:apply-templates select="doc:documentation" mode="short-documentation"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </dd>
+ </dl>
+ </xsl:template>
+ <!--
Format description of schema component in schema indices.
-->
***************
*** 484,487 ****
--- 655,665 ----
</xsl:for-each>
</xsl:if>
+ <xsl:if test="doc:component/doc:error">
+ <xsl:text>An error occured:</xsl:text>
+ <br/>
+ <pre>
+ <xsl:apply-templates select="doc:component/doc:error/text()"/>
+ </pre>
+ </xsl:if>
<dl>
<dt>Properties</dt>
***************
*** 1628,1631 ****
--- 1806,1819 ----
</xsl:template>
<!--
+ Navigation bar placed on top and bottom of index-all pages.
+ -->
+ <xsl:template name="navigationIndex">
+ <xsl:call-template name="navigationHandler">
+ <xsl:with-param name="rootFolder" select="'./'"/>
+ <xsl:with-param name="namespaceFolder" select="'./'"/>
+ <xsl:with-param name="selected" select="'index'"/>
+ </xsl:call-template>
+ </xsl:template>
+ <!--
Navigation bar placed on top and bottom of component pages.
-->
***************
*** 1649,1652 ****
--- 1837,1841 ----
<table border="0" cellpadding="0" cellspacing="3">
<tr align="center" valign="top">
+ <!-- Overview -->
<td bgcolor="#EEEEFF">
<xsl:choose>
***************
*** 1684,1687 ****
--- 1873,1877 ----
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
</td>
+ <!-- Namespace -->
<td bgcolor="#EEEEFF">
<xsl:choose>
***************
*** 1716,1719 ****
--- 1906,1910 ----
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
</td>
+ <!-- Component -->
<td bgcolor="#EEEEFF" class="NavBarCell1">
<xsl:choose>
***************
*** 1739,1742 ****
--- 1930,1934 ----
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
</td>
+ <!-- Use -->
<!--
<td bgcolor="#EEEEFF" class="NavBarCell1">
***************
*** 1761,1764 ****
--- 1953,1993 ----
</td>
-->
+ <!-- Index -->
+ <td bgcolor="#EEEEFF">
+ <xsl:choose>
+ <xsl:when test="starts-with($selected, 'index')">
+ <xsl:attribute name="class">NavBarCell1Rev</xsl:attribute>
+ <font>
+ <xsl:choose>
+ <xsl:when test="starts-with($selected, 'index')">
+ <xsl:attribute name="class">NavBarFont1Rev</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="class">NavBarFont1</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <b>Index</b>
+ </font>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="class">NavBarCell1</xsl:attribute>
+ <a href="{concat($rootFolder, 'index-all.html')}">
+ <font>
+ <xsl:choose>
+ <xsl:when test="starts-with($selected, 'index')">
+ <xsl:attribute name="class">NavBarFont1Rev</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="class">NavBarFont1</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <b>Index</b>
+ </font>
+ </a>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
+ </td>
+ <!-- Help -->
<td bgcolor="#EEEEFF">
<xsl:choose>
Index: index.xsl
===================================================================
RCS file: /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/xslt/index.xsl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** index.xsl 25 Mar 2004 15:05:54 -0000 1.4
--- index.xsl 13 Jan 2005 15:56:34 -0000 1.5
***************
*** 66,70 ****
<frameset rows="30%,70%">
<frame name="namespaces" src="./overview-namespaces.html"/>
! <frame name="index" src="{concat('./', $nsFolder, '/overview-namespace.html')}"/>
</frameset>
<frame name="content" src="./schema-summary.html"/>
--- 66,70 ----
<frameset rows="30%,70%">
<frame name="namespaces" src="./overview-namespaces.html"/>
! <frame name="index" src="{concat('./', 'overview-all.html')}"/>
</frameset>
<frame name="content" src="./schema-summary.html"/>
Index: util.xsl
===================================================================
RCS file: /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/xslt/util.xsl,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** util.xsl 27 Dec 2004 14:54:12 -0000 1.18
--- util.xsl 13 Jan 2005 15:56:36 -0000 1.19
***************
*** 121,124 ****
--- 121,146 ----
</xsl:choose>
</xsl:template>
+
+ <!--
+ Returns the substring after the last occurance of a substring.
+ Example:
+ last-substring('a.b.c', '.') = 'c'
+ -->
+ <xsl:template name="last-substring">
+ <xsl:param name="string"/>
+ <xsl:param name="substring"/>
+ <xsl:choose>
+ <xsl:when test="contains($string, $substring)">
+ <xsl:call-template name="last-substring">
+ <xsl:with-param name="string" select="substring-after($string, $substring)"/>
+ <xsl:with-param name="substring" select="$substring"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$string"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
<!--
Checks if a schema (or any included schema) defines any component.
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt