<?xsl version='1.0'?>
<!--
== $Id: //guest/julian_hyde/mondrian/misc/Meta.xsl#1 $
== This software is subject to the terms of the Common Public License
== Agreement, available at the following URL:
== http://www.opensource.org/licenses/cpl.html.
== (C) Copyright 2000-2002 Kana Software, Inc. and others.
== All Rights Reserved.
== You must accept the terms of that agreement to use this software.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<!-- Main document -->
<xsl:template match="/">
<HTML>
<HEAD>
<LINK rel="stylesheet" type="text/css" href="http://code/bb/main/spec/DesignDoc.css" />
</HEAD>
<BODY>
<xsl:apply-templates select="Model"/>
</BODY>
</HTML>
</xsl:template>
<!--
- Doc processing
-->
<xsl:template match="@*|node()" mode="copy">
<xsl:copy>
<xsl:apply-templates select="@*" mode="copy"/>
<xsl:apply-templates mode="copy"/>
</xsl:copy>
</xsl:template>
<!-- Model -->
<xsl:template match="Model">
<h1>Mining Meta Model Instance <u><xsl:value-of select="@name"/></u></h1>
<p>
<b>DTD Name:</b>
<a><xsl:attribute name="href"><xsl:value-of select="@dtdName"/>
</xsl:attribute>
<xsl:value-of select="@dtdName"/></a><br/>
<b>Class Name:</b>
<a><xsl:attribute name="href">http://code/bb/main/mining/Broadbase/mining/xml/<xsl:value-of select="@className"/>.java</xsl:attribute>
<xsl:value-of select="@className"/></a> <br/>
<b>Root Element:</b>
<a><xsl:attribute name="href">#<xsl:value-of select="@root"/></xsl:attribute>
<xsl:value-of select="@root"/></a> <br/>
<b>Version:</b> <xsl:value-of select="@version"/> <br/>
</p>
<table width="100%" cellspacing="0" border="1">
<tr>
<td bgcolor="#3366cc" colspan="2">
<font color="white">
<h2>Overview</h2>
</font>
</td>
</tr>
</table>
<blockquote>
<xsl:apply-templates select="Doc" mode="copy"/>
</blockquote>
<h2>Imports</h2>
<ul>
<xsl:for-each select="Import">
<li>
<a><xsl:attribute name="href">#<xsl:value-of select="@type"/></xsl:attribute>
<xsl:value-of select="@type"/>
</a>
</li>
</xsl:for-each>
</ul>
<h2>Element Summary</h2>
<ul>
<xsl:for-each select="Element|StringElement|Plugin" order-by="+@type">
<li>
<a><xsl:attribute name="href">#<xsl:value-of select="@type"/></xsl:attribute>
<xsl:value-of select="@type"/>
</a>
</li>
</xsl:for-each>
</ul>
<h2>Classes</h2>
<ul>
<xsl:for-each select="Class" order-by="+@class">
<li>
<a><xsl:attribute name="href">#<xsl:value-of select="@class"/></xsl:attribute>
<xsl:value-of select="@class"/>
</a>
</li>
</xsl:for-each>
</ul>
<xsl:apply-templates select="//Element"/>
<xsl:apply-templates select="//Plugin"/>
<xsl:apply-templates select="//Class"/>
<xsl:apply-templates select="//Import"/>
</xsl:template>
<!--
- Element processing
-->
<xsl:template match="Element">
<p/>
<a><xsl:attribute name="name"><xsl:value-of select="@type"/></xsl:attribute>
<table width="100%" cellspacing="0" border="1">
<tr>
<td bgcolor="#3366cc">
<font color="white">
<h2><i>Element</i> <xsl:value-of select="@type"/></h2>
</font>
</td>
</tr>
</table>
</a>
<blockquote>
<xsl:apply-templates select="Doc" mode="copy"/>
</blockquote>
<xsl:if test="@class">
<h3>Class</h3>
<blockquote>
<a><xsl:attribute name="href">#<xsl:value-of select="@class"/></xsl:attribute>
<xsl:value-of select="@class"/>
</a>
</blockquote>
</xsl:if>
<h3>Attributes</h3>
<blockquote>
<xsl:choose>
<xsl:when test="Attribute">
<table border="1" class="clsStd">
<tr><th>Attribute</th><th>Type</th><th>Default</th>
<th>Description</th></tr>
<xsl:for-each select="Attribute">
<tr><td>
<xsl:choose>
<xsl:when test=".[@required='true']">
<b><xsl:value-of select="@name"/></b>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@name"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td><i>
<xsl:choose>
<xsl:when test="@type">
<xsl:value-of select="@type"/>
</xsl:when>
<xsl:otherwise>String</xsl:otherwise>
</xsl:choose>
</i></td>
<td>
<xsl:choose>
<xsl:when test="@default">
<xsl:value-of select="@default"/>
</xsl:when>
<xsl:otherwise><i>none</i></xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:choose>
<xsl:when test="Doc">
<xsl:apply-templates select="Doc" mode="copy"/>
</xsl:when>
<xsl:otherwise><i>none</i></xsl:otherwise>
</xsl:choose>
</td></tr>
</xsl:for-each>
</table>
</xsl:when>
<xsl:otherwise><i>none</i></xsl:otherwise>
</xsl:choose>
</blockquote>
<h3>Content</h3>
<blockquote>
<xsl:choose>
<xsl:when test="Object|Array">
<table border="1" class="clsStd">
<tr><th>Element</th><th>Java Name</th><th>Constraints</th><th>Description</th></tr>
<xsl:for-each select="Object|Array">
<tr><td>
<a><xsl:attribute name="href">#<xsl:value-of select="@type"/>
</xsl:attribute>
<xsl:value-of select="@type"/></a>
</td>
<td><xsl:value-of select="@name"/></td>
<td>
<xsl:choose>
<xsl:when test=".[@required='true']">
<i>Required</i>
</xsl:when>
<xsl:when test="@min">
<i>Array [<xsl:value-of select="@min"/> ..
<xsl:value-of select="@max"/>]</i>
</xsl:when>
<xsl:when test=".[@name=../Array/@name]">
<i>Array</i>
</xsl:when>
<xsl:otherwise>
<i>Optional</i>
</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:choose>
<xsl:when test="Doc">
<xsl:apply-templates select="Doc" mode="copy"/>
</xsl:when>
<xsl:otherwise><i>none</i></xsl:otherwise>
</xsl:choose>
</td></tr>
</xsl:for-each>
</table>
</xsl:when>
<xsl:when test="Any"><i>Any</i></xsl:when>
<xsl:when test="CData"><i>Text</i></xsl:when>
<xsl:otherwise><i>empty</i></xsl:otherwise>
</xsl:choose>
<xsl:if test=".[@keepDef='true']">; keep DOM node</xsl:if>
</blockquote>
</xsl:template>
<!--
- Plugin processing
-->
<xsl:template match="Plugin">
<p/>
<a><xsl:attribute name="name"><xsl:value-of select="@type"/></xsl:attribute>
<table width="100%" cellspacing="0" border="0">
<tr>
<td bgcolor="#3366cc">
<font face="arial,sans-serif" size="-1" color="white">
<h2><i>Plugin</i> <xsl:value-of select="@type"/></h2>
</font>
</td>
</tr>
</table>
</a>
<blockquote>
<xsl:apply-templates select="Doc" mode="copy"/>
</blockquote>
<xsl:if test="@class">
<h3>Class</h3>
<blockquote>
<a><xsl:attribute name="href">#<xsl:value-of select="@class"/></xsl:attribute>
<xsl:value-of select="@class"/>
</a>
</blockquote>
</xsl:if>
<h3>Attributes</h3>
<blockquote>
<table border="1" class="clsStd">
<tr><th>Attribute</th><th>Type</th><th>Default</th>
<th>Description</th></tr>
<xsl:for-each select="Attribute">
<tr><td>
<xsl:choose>
<xsl:when test=".[@required='true']">
<b><xsl:value-of select="@name"/></b>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@name"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td><i>
<xsl:choose>
<xsl:when test="@type">
<xsl:value-of select="@type"/>
</xsl:when>
<xsl:otherwise>String</xsl:otherwise>
</xsl:choose>
</i></td>
<td>
<xsl:choose>
<xsl:when test="@default">
<xsl:value-of select="@default"/>
</xsl:when>
<xsl:otherwise><i>none</i></xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:choose>
<xsl:when test="Doc">
<xsl:apply-templates select="Doc" mode="copy"/>
</xsl:when>
<xsl:otherwise><i>none</i></xsl:otherwise>
</xsl:choose>
</td></tr>
</xsl:for-each>
<tr><td>defPackage</td><td><i>String</i></td>
<td>Broadbase.mining.xml</td>
<td>The <i>defPackage</i> attribute, available to all Plugins, specifies
the package of the Java Class used to parse all plugin contents.</td>
</tr>
<tr><td><b>defClass</b></td><td><i>String</i></td>
<td>Broadbase.mining.xml</td>
<td>The <i>defClass</i> attribute, available to all Plugins, specifies
the class name of the Java Class used to parse all plugin contents.</td>
</tr>
</table>
</blockquote>
<h3>Content</h3>
<blockquote>
<i>Any</i> from <i>defClass</i>
</blockquote>
</xsl:template>
<!--
- Class processing
-->
<xsl:template match="Class">
<p/>
<a><xsl:attribute name="name"><xsl:value-of select="@class"/></xsl:attribute>
<table width="100%" cellspacing="0" border="0">
<tr>
<td bgcolor="#3366cc">
<font face="arial,sans-serif" size="-1" color="white">
<h2><i>Class</i> <xsl:value-of select="@class"/></h2>
</font>
</td>
</tr>
</table>
</a>
<blockquote>
<xsl:apply-templates select="Doc" mode="copy"/>
</blockquote>
<xsl:if test="@superclass">
<h3>Superclass</h3>
<blockquote>
<a><xsl:attribute name="href">#<xsl:value-of select="@superclass"/></xsl:attribute>
<xsl:value-of select="@superclass"/>
</a>
</blockquote>
</xsl:if>
<h3>Attributes</h3>
<blockquote>
<xsl:choose>
<xsl:when test="Attribute">
<table border="1" class="clsStd">
<tr><th>Attribute</th><th>Type</th><th>Default</th>
<th>Description</th></tr>
<xsl:for-each select="Attribute">
<tr><td>
<xsl:choose>
<xsl:when test=".[@required='true']">
<b><xsl:value-of select="@name"/></b>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@name"/>
</xsl:otherwise>
</xsl:choose>
</td>
<td><i>
<xsl:choose>
<xsl:when test="@type">
<xsl:value-of select="@type"/>
</xsl:when>
<xsl:otherwise>String</xsl:otherwise>
</xsl:choose>
</i></td>
<td>
<xsl:choose>
<xsl:when test="@default">
<xsl:value-of select="@default"/>
</xsl:when>
<xsl:otherwise><i>none</i></xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:choose>
<xsl:when test="Doc">
<xsl:apply-templates select="Doc" mode="copy"/>
</xsl:when>
<xsl:otherwise><i>none</i></xsl:otherwise>
</xsl:choose>
</td></tr>
</xsl:for-each>
</table>
</xsl:when>
<xsl:otherwise><i>none</i></xsl:otherwise>
</xsl:choose>
</blockquote>
<h3>Content</h3>
<blockquote>
<xsl:choose>
<xsl:when test="Object|Array">
<table border="1" class="clsStd">
<tr><th>Element</th><th>Java Name</th><th>Constraints</th><th>Description</th></tr>
<xsl:for-each select="Object|Array">
<tr><td>
<a><xsl:attribute name="href">#<xsl:value-of select="@type"/>
</xsl:attribute>
<xsl:value-of select="@type"/></a>
</td>
<td><xsl:value-of select="@name"/></td>
<td>
<xsl:choose>
<xsl:when test=".[@required='true']">
<i>Required</i>
</xsl:when>
<xsl:when test="@min">
<i>Array [<xsl:value-of select="@min"/> ..
<xsl:value-of select="@max"/>]</i>
</xsl:when>
<xsl:when test=".[@name=../Array/@name]">
<i>Array</i>
</xsl:when>
<xsl:otherwise>
<i>Optional</i>
</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:choose>
<xsl:when test="Doc">
<xsl:apply-templates select="Doc" mode="copy"/>
</xsl:when>
<xsl:otherwise><i>none</i></xsl:otherwise>
</xsl:choose>
</td></tr>
</xsl:for-each>
</table>
</xsl:when>
<xsl:when test="Any"><i>Any</i></xsl:when>
<xsl:when test="CData"><i>Text</i></xsl:when>
<xsl:otherwise><i>empty</i></xsl:otherwise>
</xsl:choose>
</blockquote>
</xsl:template>
<!--
- StringElement processing
-->
<xsl:template match="StringElement">
<p/>
<a><xsl:attribute name="name"><xsl:value-of select="@type"/></xsl:attribute>
<table width="100%" cellspacing="0" border="0">
<tr>
<td bgcolor="#3366cc">
<font face="arial,sans-serif" size="-1" color="white">
<h2><i>StringElement</i> <xsl:value-of select="@type"/></h2>
</font>
</td>
</tr>
</table>
</a>
<blockquote>
<xsl:apply-templates select="Doc" mode="copy"/>
</blockquote>
<h3>Attributes</h3>
<blockquote>
<i>none</i>
</blockquote>
<h3>Content</h3>
<blockquote>
<i>Text</i>
</blockquote>
</xsl:template>
<!--
- Import processing
-->
<xsl:template match="Import">
<p/>
<a><xsl:attribute name="name"><xsl:value-of select="@type"/></xsl:attribute>
<table width="100%" cellspacing="0" border="0">
<tr>
<td bgcolor="#3366cc">
<font face="arial,sans-serif" size="-1" color="white">
<h2><i>Import</i> <xsl:value-of select="@type"/></h2>
</font>
</td>
</tr>
</table>
</a>
<b>Package</b>: <xsl:value-of select="@defPackage"/><br/>
<b>Class</b>: <xsl:value-of select="@defClass"/><br/>
<b>DTD</b>: <xsl:value-of select="@dtdName"/><br/>
<blockquote>
<xsl:apply-templates select="Doc" mode="copy"/>
</blockquote>
</xsl:template>
</xsl:stylesheet>