[MOBY-guts] biomoby commit
Paul Gordon
gordonp at dev.open-bio.org
Thu Oct 26 01:32:06 UTC 2006
gordonp
Wed Oct 25 21:32:06 EDT 2006
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources
In directory dev.open-bio.org:/tmp/cvs-serv15257/src/main/ca/ucalgary/seahawk/resources
Modified Files:
moby2HTML.xsl
Log Message:
Became more lenient with moby-s namespace for tags
moby-live/Java/src/main/ca/ucalgary/seahawk/resources moby2HTML.xsl,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/moby2HTML.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/moby2HTML.xsl 2006/10/25 02:33:22 1.1
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/resources/moby2HTML.xsl 2006/10/26 01:32:06 1.2
@@ -31,7 +31,8 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
- xmlns:moby="http://www.biomoby.org/moby">
+ xmlns:moby="http://www.biomoby.org/moby"
+ xmlns:mobys="http://www.biomoby.org/moby-s">
<!-- Normally, the calling transformer would pass in the URL for the moby document.
it is used by the stylesheet as part of the XPointer to the original data in the HTML
@@ -53,21 +54,21 @@
<!-- * Root template. Sets page layout. * -->
<!-- ****************************************************** -->
- <xsl:template match="moby:mobyContent">
+ <xsl:template match="moby:mobyContent | mobys:MobyContent">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta name="Author" content="Paul Gordon/Bluejay" />
</head>
<body>
- <xsl:if test="@moby:authority | authority">
- <h2 id="start"><a href="http://www.biomoby.org">MOBY</a> Data from <xsl:value-of select="@moby:authority | authority" />
+ <xsl:if test="@moby:authority | @mobys:authority | @authority">
+ <h2 id="start"><a href="http://www.biomoby.org">MOBY</a> Data from <xsl:value-of select="@moby:authority | @mobys:authority | @authority" />
</h2>
</xsl:if>
- <xsl:apply-templates select="moby:serviceNotes | serviceNotes | moby:ServiceNotes | moby:ServiceNotes"/>
+ <xsl:apply-templates select="moby:serviceNotes | serviceNotes | mobys:serviceNotes | moby:ServiceNotes | moby:ServiceNotes | mobys:ServiceNotes"/>
- <xsl:variable name="num_elements" select="count(moby:mobyData | mobyData)" />
+ <xsl:variable name="num_elements" select="count(moby:mobyData | mobys:mobyData | mobyData)" />
<xsl:choose>
<xsl:when test="$num_elements = 1">
<p>The MOBY data is:</p>
@@ -84,7 +85,7 @@
<!-- For each child MOBY data block (corresponding usually to
multiple input queries submitted at once), process and
display as a table -->
- <xsl:apply-templates select="moby:mobyData | mobyData"/>
+ <xsl:apply-templates select="moby:mobyData | mobys:mobyData | mobyData"/>
<!-- HTML output footer/end -->
</body>
@@ -93,9 +94,9 @@
<!-- ServiceNotes have things like bibliographic or credit information in them
for the service being provided, also excpetions are held here -->
- <xsl:template match="moby:serviceNotes | serviceNotes">
+ <xsl:template match="moby:serviceNotes | mobys:serviceNotes | serviceNotes">
<p>
- <xsl:variable name="exceptions" select="moby:mobyException | mobyException"/>
+ <xsl:variable name="exceptions" select="moby:mobyException | mobys:mobyException | mobyException"/>
<xsl:choose>
<xsl:when test="count($exceptions) > 0">
<table width="100%" border="0" cellspacing="0">
@@ -109,7 +110,7 @@
</p>
</xsl:template>
- <xsl:template match="moby:mobyException| mobyException">
+ <xsl:template match="moby:mobyException | mobys:mobyException | mobyException">
<xsl:variable name="severity" select="@severity"/>
<xsl:choose>
@@ -136,7 +137,7 @@
</th></tr>
<tr bgcolor="#F0FFE0">
- <xsl:variable name="code" select="moby:exceptionCode | exceptionCode" />
+ <xsl:variable name="code" select="moby:exceptionCode | mobys:exceptionCode | exceptionCode" />
<xsl:variable name="message" select="moby:exceptionMessage | exceptionMessage" />
<xsl:choose>
<xsl:when test="starts-with($code, '2')">
@@ -162,7 +163,7 @@
</xsl:otherwise>
</xsl:choose>
- <td><xsl:value-of select="moby:exceptionMessage | exceptionMessage"/></td>
+ <td><xsl:value-of select="moby:exceptionMessage | mobys:exceptionMessage | exceptionMessage"/></td>
</tr>
</xsl:template>
@@ -170,17 +171,17 @@
<!-- * Wrapper element for each query response * -->
<!-- ****************************************************** -->
- <xsl:template match="moby:mobyData | mobyData">
+ <xsl:template match="moby:mobyData | mobys:mobyData | mobyData">
<!-- Create the hit summary information -->
<table width="100%" border="1" cellpadding="2" cellspacing="0">
<tr align="left" colspan="2"><th>MOBY Data for query
- <xsl:value-of select="@moby:queryID | @queryID"/>
+ <xsl:value-of select="@moby:queryID | @mobys:queryID | @queryID"/>
</th></tr>
<!-- One row per top level child of the mobyData, either Simples
or Collections (basically arrays), do HTML setup -->
- <xsl:for-each select="moby:Collection | Collection | moby:Simple | Simple">
+ <xsl:for-each select="moby:Collection | @mobys:Collection | Collection | moby:Simple | mobys:Simple | Simple">
<!-- Alternate row colors for readability -->
<xsl:choose>
@@ -207,24 +208,24 @@
<!-- * Prints the contents of the template data elements * -->
<!-- ****************************************************** -->
- <xsl:template match="moby:Simple | Simple">
+ <xsl:template match="moby:Simple | mobys:Simple | Simple">
<xsl:apply-templates select="*" mode="elucidate"/>
</xsl:template> <!-- end Simple template -->
- <xsl:template match="moby:CrossReference | CrossReference" mode="elucidate">
+ <xsl:template match="moby:CrossReference | mobys:CrossReference | CrossReference" mode="elucidate">
<br />Xref: <xsl:apply-templates select="*" mode="elucidate"/>
</xsl:template>
<!-- Base Object class, has a namespace and ID. That's it. -->
- <xsl:template match="moby:Object | Object" mode="elucidate">
- <a href="http://moby/{@moby:namespace | @namespace}?id={@moby:id | @id}">ID <xsl:value-of select="@moby:namespace | @namespace"/>:<xsl:value-of select="@moby:id | @id"/> (<xsl:value-of select="@moby:articleName | @articleName"/>)</a><xsl:text> </xsl:text>
- <xsl:apply-templates select="moby:CrossReference | CrossReference" mode="elucidate"/>
+ <xsl:template match="moby:Object | mobys:Object | Object" mode="elucidate">
+ <a href="http://moby/{@moby:namespace | @mobys:namespace | @namespace}?id={@moby:id | @mobys:id | @id}">ID <xsl:value-of select="@moby:namespace | @mobys:namespace | @namespace"/>:<xsl:value-of select="@moby:id | @mobys:id | @id"/> (<xsl:value-of select="@moby:articleName | mobys:articleName | @articleName"/>)</a><xsl:text> </xsl:text>
+ <xsl:apply-templates select="moby:CrossReference | mobys:CrossReference | CrossReference" mode="elucidate"/>
</xsl:template> <!-- end Object template -->
- <xsl:template match="moby:String | String" mode="elucidate">
+ <xsl:template match="moby:String | mobys:String | String" mode="elucidate">
<xsl:variable name="xptr"><xsl:call-template name="getXPointer"/></xsl:variable>
- <a href="{$sourceURL}#{$xptr}"><xsl:if test="string-length(@moby:namespace | @namespace)">ID <xsl:value-of select="@moby:namespace | @namespace"/>:</xsl:if><xsl:if test="string-length(@moby:id | @id)"><xsl:value-of select="@moby:id | @id"/> </xsl:if>(<xsl:value-of select="@moby:articleName | @articleName"/>)</a>: <xsl:value-of select="."/><br/>
- <xsl:apply-templates select="moby:CrossReference | CrossReference" mode="elucidate"/>
+ <a href="{$sourceURL}#{$xptr}"><xsl:if test="string-length(@moby:namespace | @mobys:namespace | @namespace)">ID <xsl:value-of select="@moby:namespace | @mobys:namespace | @namespace"/>:</xsl:if><xsl:if test="string-length(@moby:id | @mobys:id | @id)"><xsl:value-of select="@moby:id | @mobys:id | @id"/> </xsl:if>(<xsl:value-of select="@moby:articleName | @mobys:articleName | @articleName"/>)</a>: <xsl:value-of select="."/><br/>
+ <xsl:apply-templates select="moby:CrossReference | mobys:CrossReference | CrossReference" mode="elucidate"/>
</xsl:template> <!-- end String template -->
<!-- objects with "text" in their name are assumed to be subclasses of text-formatted, so show their contents
@@ -232,8 +233,8 @@
<xsl:value-of select="@moby:articleName | @articleName"/> <pre><xsl:value-of select="."/></pre><br/>
</xsl:template> end formatted text template -->
- <xsl:template match="moby:Integer | Integer | moby:Float | Float" mode="elucidate">
- <xsl:value-of select="@moby:articleName | @articleName"/>: <xsl:value-of select="."/><br/>
+ <xsl:template match="moby:Integer | mobys:Integer | Integer | moby:Float | mobys:Float | Float" mode="elucidate">
+ <xsl:value-of select="@moby:articleName | @mobys:articleName | @articleName"/>: <xsl:value-of select="."/><br/>
</xsl:template> <!-- end Integer template -->
<!-- Should match more complex objects -->
@@ -241,7 +242,7 @@
<xsl:variable name="num_members" select="count(*)"/>
<xsl:variable name="xptr"><xsl:call-template name="getXPointer"/></xsl:variable>
<table border="1"><tr><th align="left" colspan="{$num_members+1}"><a href="{$sourceURL}#{$xptr}">
- <xsl:value-of select="local-name(.)"/> (ID <xsl:value-of select="@moby:namespace | @namespace"/>:<xsl:value-of select="@moby:id | @id"/>)</a></th></tr>
+ <xsl:value-of select="local-name(.)"/> (ID <xsl:value-of select="@moby:namespace | @mobys:namespace | @namespace"/>:<xsl:value-of select="@moby:id | @mobys:id | @id"/>)</a></th></tr>
<xsl:for-each select="*">
<tr><td><xsl:apply-templates select="." mode="elucidate"/></td></tr>
</xsl:for-each>
@@ -253,11 +254,11 @@
<!-- ******************************************************* -->
<!-- A collection is just provides an array facility in MOBY for Simples -->
- <xsl:template match="moby:Collection | Collection">
+ <xsl:template match="moby:Collection | mobys:Collection | Collection">
<xsl:variable name="xptr"><xsl:call-template name="getXPointer"/></xsl:variable>
- <a href="{$sourceURL}#{$xptr}">Collection</a> of <xsl:value-of select="count(moby:Simple | Simple)"/> data elements: <br/>
+ <a href="{$sourceURL}#{$xptr}">Collection</a> of <xsl:value-of select="count(moby:Simple | mobys:Simple | Simple)"/> data elements: <br/>
<ol>
- <xsl:for-each select="moby:Simple | Simple">
+ <xsl:for-each select="moby:Simple | mobys:Simple | Simple">
<li><xsl:apply-templates select="."/></li>
</xsl:for-each>
</ol>
More information about the MOBY-guts
mailing list