xsddoc/src/net/sf/xframe/xsddoc/xslt model.xsl,1.24,1.25 xml2html.xsl,1.30,1.31
Kurt Riede <[email protected]>
| 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-serv7251/src/net/sf/xframe/xsddoc/xslt
Modified Files:
model.xsl xml2html.xsl
Log Message:
improved handling of documentation of nested element declarations
Index: xml2html.xsl
===================================================================
RCS file: /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/xslt/xml2html.xsl,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** xml2html.xsl 15 Sep 2004 15:18:01 -0000 1.30
--- xml2html.xsl 28 Sep 2004 13:30:53 -0000 1.31
***************
*** 773,776 ****
--- 773,791 ----
</table>
</xsl:if>
+ <xsl:if test="$nested">
+ <br/>
+ <table border="1" cellpadding="3" cellspacing="0" width="100%">
+ <tr bgcolor="#CCCCFF" class="TableHeadingColor">
+ <td colspan="2">
+ <font size="+2">
+ <b>Nested Element Detail</b>
+ </font>
+ </td>
+ </tr>
+ </table>
+ <xsl:apply-templates select="$nested" mode="detail">
+ <xsl:sort select="@name"/>
+ </xsl:apply-templates>
+ </xsl:if>
<xsl:if test="doc:attribute">
<br/>
***************
*** 790,794 ****
</xsl:template>
<!--
! Format the model.
-->
<xsl:template match="doc:attribute" mode="detail">
--- 805,809 ----
</xsl:template>
<!--
! Format the attribute model.
-->
<xsl:template match="doc:attribute" mode="detail">
***************
*** 963,982 ****
<td>
<code>
! <xsl:choose>
! <xsl:when test="@type and ($ns = 'http://www.w3.org/2001/XMLSchema')">
! <xsl:value-of select="@name"/>
! </xsl:when>
! <xsl:when test="@name and @href">
! <a href="{@href}">
! <xsl:value-of select="@name"/>
! </a>
! </xsl:when>
! <xsl:when test="@type">
! <xsl:value-of select="@type"/>
! </xsl:when>
! <xsl:otherwise>
! <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
! </xsl:otherwise>
! </xsl:choose>
</code>
<br/>
--- 978,984 ----
<td>
<code>
! <a href="{concat('#elem_', @name)}">
! <xsl:value-of select="@name"/>
! </a>
</code>
<br/>
***************
*** 987,990 ****
--- 989,1047 ----
</xsl:template>
<!--
+ Format the nested element model.
+ -->
+ <xsl:template match="doc:element" mode="detail">
+ <xsl:variable name="prefix" select="substring-before(@type, ':')"/>
+ <xsl:variable name="ns" select="namespace::*[name() = $prefix]"/>
+ <a name="elem_{@name}"/>
+ <h3>
+ <xsl:value-of select="@name"/>
+ </h3>
+ <dl>
+ <xsl:if test="doc:documentation">
+ <dd>
+ <xsl:apply-templates select="doc:documentation" mode="documentation"/>
+ </dd>
+ <br/>
+ </xsl:if>
+ <xsl:if test="@type">
+ <dl>
+ <dt>Type:</dt>
+ <dd>
+ <code>
+ <xsl:choose>
+ <xsl:when test="@type and ($ns = 'http://www.w3.org/2001/XMLSchema')">
+ <xsl:value-of select="@type"/>
+ </xsl:when>
+ <xsl:when test="@type and @href">
+ <a href="{@href}">
+ <xsl:value-of select="@type"/>
+ </a>
+ </xsl:when>
+ <xsl:when test="@type">
+ <xsl:value-of select="@type"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </code>
+ </dd>
+ </dl>
+ </xsl:if>
+ <xsl:if test="@href">
+ <dl>
+ <dt>Details:</dt>
+ <dd>
+ <a href="{@href}">
+ <xsl:value-of select="@name"/>
+ </a>
+ </dd>
+ </dl>
+ </xsl:if>
+ </dl>
+ <hr/>
+ </xsl:template>
+ <!--
Format the model.
-->
***************
*** 1143,1147 ****
<xsl:variable name="count" select="count(*)"/>
<xsl:value-of select="$indent"/>
! <xsl:if test="count(*) > 1">
<xsl:text>(</xsl:text>
</xsl:if>
--- 1200,1204 ----
<xsl:variable name="count" select="count(*)"/>
<xsl:value-of select="$indent"/>
! <xsl:if test="$count > 1">
<xsl:text>(</xsl:text>
</xsl:if>
***************
*** 1153,1157 ****
</xsl:for-each>
<xsl:value-of select="$indent"/>
! <xsl:if test="count(*) > 1">
<xsl:text>)</xsl:text>
</xsl:if>
--- 1210,1214 ----
</xsl:for-each>
<xsl:value-of select="$indent"/>
! <xsl:if test="$count > 1">
<xsl:text>)</xsl:text>
</xsl:if>
***************
*** 1165,1169 ****
<xsl:variable name="count" select="count(*)"/>
<xsl:value-of select="$indent"/>
! <xsl:if test="count(*) > 1">
<xsl:text>(</xsl:text>
</xsl:if>
--- 1222,1226 ----
<xsl:variable name="count" select="count(*)"/>
<xsl:value-of select="$indent"/>
! <xsl:if test="$count > 1">
<xsl:text>(</xsl:text>
</xsl:if>
***************
*** 1174,1178 ****
</xsl:if>
</xsl:for-each>
! <xsl:if test="count(*) > 1">
<xsl:text>)</xsl:text>
</xsl:if>
--- 1231,1235 ----
</xsl:if>
</xsl:for-each>
! <xsl:if test="$count > 1">
<xsl:text>)</xsl:text>
</xsl:if>
***************
*** 1187,1191 ****
<xsl:variable name="count" select="count(*)"/>
<xsl:value-of select="$indent"/>
! <xsl:if test="count(*) > 1">
<xsl:text>(</xsl:text>
</xsl:if>
--- 1244,1248 ----
<xsl:variable name="count" select="count(*)"/>
<xsl:value-of select="$indent"/>
! <xsl:if test="$count > 1">
<xsl:text>(</xsl:text>
</xsl:if>
***************
*** 1196,1200 ****
</xsl:if>
</xsl:for-each>
! <xsl:if test="count(*) > 1">
<xsl:text>)</xsl:text>
</xsl:if>
--- 1253,1257 ----
</xsl:if>
</xsl:for-each>
! <xsl:if test="$count > 1">
<xsl:text>)</xsl:text>
</xsl:if>
***************
*** 1244,1254 ****
<xsl:param name="count"/>
<xsl:choose>
! <xsl:when test="@href">
! <a href="{@href}">
<xsl:value-of select="@name"/>
</a>
</xsl:when>
<xsl:otherwise>
! <xsl:value-of select="@name"/>
</xsl:otherwise>
</xsl:choose>
--- 1301,1311 ----
<xsl:param name="count"/>
<xsl:choose>
! <xsl:when test="@name">
! <a href="{concat('#elem_', @name)}">
<xsl:value-of select="@name"/>
</a>
</xsl:when>
<xsl:otherwise>
! <xsl:value-of select="@name"/>
</xsl:otherwise>
</xsl:choose>
***************
*** 1704,1708 ****
<xsl:if test="string($selected) = 'component'">
<a href="#elements">
! <b>NESTED</b>
</a>
<xsl:text disable-output-escaping="yes">&nbsp;|&nbsp;</xsl:text>
--- 1761,1765 ----
<xsl:if test="string($selected) = 'component'">
<a href="#elements">
! <b>ELEMENTS</b>
</a>
<xsl:text disable-output-escaping="yes">&nbsp;|&nbsp;</xsl:text>
Index: model.xsl
===================================================================
RCS file: /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/xslt/model.xsl,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** model.xsl 20 Sep 2004 19:31:18 -0000 1.24
--- model.xsl 28 Sep 2004 13:30:53 -0000 1.25
***************
*** 139,142 ****
--- 139,147 ----
</xsl:attribute>
</xsl:if>
+ <xsl:if test="@type">
+ <xsl:attribute name="type">
+ <xsl:value-of select="@type"/>
+ </xsl:attribute>
+ </xsl:if>
<xsl:if test="local-name() = 'any'">
<xsl:attribute name="namespace">
***************
*** 470,482 ****
</xsl:call-template>
</xsl:variable>
! <xsl:element name="doc:{local-name()}">
<xsl:apply-templates select="@*" mode="model"/>
<xsl:variable name="hierarchy">
<xsl:apply-templates select="." mode="parent"/>
</xsl:variable>
! <xsl:attribute name="href"><!-- xxxxx -->
<xsl:value-of select="concat('../../', $folder, '/', $hierarchy, 'html')"/>
</xsl:attribute>
- <!--
<xsl:if test="xs:annotation/xs:documentation">
<doc:documentation>
--- 475,491 ----
</xsl:call-template>
</xsl:variable>
! <xsl:element name="doc:element">
<xsl:apply-templates select="@*" mode="model"/>
<xsl:variable name="hierarchy">
<xsl:apply-templates select="." mode="parent"/>
</xsl:variable>
! <xsl:if test="@type">
! <xsl:attribute name="type">
! <xsl:value-of select="@type"/>
! </xsl:attribute>
! </xsl:if>
! <xsl:attribute name="href">
<xsl:value-of select="concat('../../', $folder, '/', $hierarchy, 'html')"/>
</xsl:attribute>
<xsl:if test="xs:annotation/xs:documentation">
<doc:documentation>
***************
*** 486,490 ****
</doc:documentation>
</xsl:if>
! -->
</xsl:element>
</xsl:template>
--- 495,501 ----
</doc:documentation>
</xsl:if>
! <xsl:if test="xs:simpleType">
! <xsl:apply-templates select="xs:simpleType" mode="model"/>
! </xsl:if>
</xsl:element>
</xsl:template>
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php