Skip to content

Commit

Permalink
restructuring
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.xmpp.org:7938/xmpp/trunk@1552 4b5297f7-1745-476d-ba37-a9c6900126ab
  • Loading branch information
stpeter committed Jan 9, 2008
1 parent c5e63ee commit a8f1df1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 35 deletions.
7 changes: 5 additions & 2 deletions protocols/manifest.dtd
@@ -1,10 +1,13 @@
<?xml version='1.0' encoding='UTF-8'?>

<!ELEMENT manifest ( title, abstract, specnum, specurl, status, publisher, namespace+ ) >
<!ELEMENT manifest ( title, abstract, specnum, specurl, status, publisher, namespaces*, schemas* ) >
<!ELEMENT title (#PCDATA)* >
<!ELEMENT abstract (#PCDATA)* >
<!ELEMENT specnum (#PCDATA)* >
<!ELEMENT specurl (#PCDATA)* >
<!ELEMENT status (#PCDATA)* >
<!ELEMENT publisher (#PCDATA)* >
<!ELEMENT namespace ( name, schema? ) >
<!ELEMENT namespaces ( name+ ) >
<!ELEMENT schemas ( schema+ ) >
<!ELEMENT name (#PCDATA)* >
<!ELEMENT schema (#PCDATA)* >
53 changes: 20 additions & 33 deletions protocols/proto.xsl
Expand Up @@ -19,9 +19,17 @@
<xsl:attribute name='name'><xsl:text>description</xsl:text></xsl:attribute>
<xsl:attribute name='content'>Information about <xsl:value-of select='/manifest/specnum'/>: <xsl:value-of select='/manifest/title'/>, a <xsl:value-of select='/manifest/status'/> Standard of the <xsl:value-of select='/manifest/publisher'/>. <xsl:value-of select='/manifest/abstract'/></xsl:attribute>
</meta>
<xsl:variable name='ns.count' select='count(/manifest/namespaces/name)'/>
<meta>
<xsl:attribute name='name'><xsl:text>keywords</xsl:text></xsl:attribute>
<xsl:attribute name='content'><xsl:apply-templates select='/manifest/namespace' mode='keywords'/> <xsl:value-of select='/manifest/title'/><xsl:text>, Extensible Messaging and Presence Protocol, XMPP, Jabber</xsl:text></xsl:attribute>
<xsl:choose>
<xsl:when test="$ns.count &gt; 0">
<xsl:attribute name='content'><xsl:apply-templates select='/manifest/namespaces/name' mode='keywords'/> <xsl:value-of select='/manifest/title'/><xsl:text>, Extensible Messaging and Presence Protocol, XMPP, Jabber</xsl:text></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name='content'><xsl:value-of select='/manifest/title'/><xsl:text>, Extensible Messaging and Presence Protocol, XMPP, Jabber</xsl:text></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</meta>
<meta>
<xsl:attribute name='name'><xsl:text>DC.Title</xsl:text></xsl:attribute>
Expand All @@ -38,57 +46,36 @@
<xsl:value-of select='/manifest/specnum'/>
</a>
(a <xsl:value-of select='/manifest/status'/> Standard of the <xsl:value-of select='/manifest/publisher'/>). <xsl:value-of select='/manifest/abstract'/></p>
<xsl:variable name='name.count' select='count(/manifest/namespace/name)'/>
<xsl:variable name='name.count' select='count(/manifest/namespaces/name)'/>
<xsl:if test='$name.count &gt; 0'>
<p>The following XML namespaces are used in the context of the <xsl:value-of select='/manifest/title'/> protocol:</p>
<ul>
<xsl:apply-templates select='/manifest/namespace' mode='name'/>
<xsl:apply-templates select='/manifest/namespaces/name' mode='names'/>
</ul>
</xsl:if>
<xsl:variable name='schema.count' select='count(/manifest/namespace/schema)'/>
<xsl:variable name='schema.count' select='count(/manifest/schemas/schema)'/>
<xsl:if test='$schema.count &gt; 0'>
<p>The following XML schemas are available for the <xsl:value-of select='/manifest/title'/> protocol:</p>
<ul>
<xsl:apply-templates select='/manifest/namespace' mode='schema'/>
<xsl:apply-templates select='/manifest/schemas/schema'/>
</ul>
</xsl:if>
<p>Information about this <a href='http://www.xmpp.org/protocols/'>XMPP protocol</a> is maintained by the <a href='http://www.xmpp.org/registrar/'>XMPP Registrar</a>.</p>
</body>
</html>
</xsl:template>

<xsl:template match='namespace' mode='keywords'>
<xsl:variable name='ns.count' select='count(name)'/>
<xsl:choose>
<xsl:when test="$ns.count &gt; 0"><xsl:value-of select='name'/>, </xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:template match='name' mode='keywords'>
<xsl:value-of select='.'/><xsl:text>, </xsl:text>
</xsl:template>

<xsl:template match='namespace' mode='name'>
<xsl:variable name='ns.count' select='count(name)'/>
<xsl:choose>
<xsl:when test="$ns.count &gt; 0">
<li><xsl:value-of select='name'/></li>
</xsl:when>
<xsl:otherwise>
<li><xsl:value-of select='name'/></li>
</xsl:otherwise>
</xsl:choose>
<xsl:template match='name' mode='names'>
<li><xsl:value-of select='.'/></li>
</xsl:template>

<xsl:template match='namespace' mode='schema'>
<xsl:variable name='this.url' select='schema'/>
<xsl:variable name='ns.count' select='count(name)'/>
<xsl:choose>
<xsl:when test="$ns.count &gt; 0">
<li><a href='{$this.url}'><xsl:value-of select='schema'/></a></li>
</xsl:when>
<xsl:otherwise>
<li><a href='{$this.url}'><xsl:value-of select='schema'/></a></li>
</xsl:otherwise>
</xsl:choose>
<xsl:template match='schema'>
<xsl:variable name='this.url' select='.'/>
<li><a href='{$this.url}'><xsl:value-of select='.'/></a></li>
</xsl:template>

</xsl:stylesheet>

0 comments on commit a8f1df1

Please sign in to comment.