Added: incubator/woden/trunk/java/wsdl-viewer/src/wsdl-viewer-xsd-tree.xsl
URL: 
http://svn.apache.org/viewvc/incubator/woden/trunk/java/wsdl-viewer/src/wsdl-viewer-xsd-tree.xsl?rev=602769&view=auto
==============================================================================
--- incubator/woden/trunk/java/wsdl-viewer/src/wsdl-viewer-xsd-tree.xsl (added)
+++ incubator/woden/trunk/java/wsdl-viewer/src/wsdl-viewer-xsd-tree.xsl Sun Dec 
 9 17:41:55 2007
@@ -0,0 +1,512 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
+<!--
+* ====================================================================
+* wsdl-viewer.xsl
+* Author: tomi vanek
+* ====================================================================
+* Description:
+*              XSD rendered as a tree
+* ====================================================================
+-->
+
+<xsl:stylesheet version="1.0"
+       xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+       xmlns="http://www.w3.org/1999/xhtml";
+       xmlns:ws="http://schemas.xmlsoap.org/wsdl/";
+       xmlns:ws2="http://www.w3.org/ns/wsdl";
+       xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+       xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
+       xmlns:local="http://tomi.vanek.sk/xml/wsdl-viewer";
+       exclude-result-prefixes="ws xsd soap local">
+
+<!--
+==================================================================
+       Rendering: XSD parsing and rendering
+==================================================================
+-->
+
+<xsl:template match="xsd:simpleType" mode="operations.message.part"/>
+
+<xsl:template name="recursion.should.continue">
+       <xsl:param name="anti.recursion"/>
+       <xsl:param name="recursion.label"/>
+       <xsl:param name="recursion.count">1</xsl:param>
+       <xsl:variable name="has.recursion" select="contains($anti.recursion, 
$recursion.label)"/>
+       <xsl:variable name="anti.recursion.fragment" 
select="substring-after($anti.recursion, $recursion.label)"/>
+       <xsl:choose>
+               <xsl:when test="$recursion.count &gt; $ANTIRECURSION-DEPTH"/>
+
+               <xsl:when test="not($ENABLE-ANTIRECURSION-PROTECTION) or 
string-length($anti.recursion) = 0 or not($has.recursion)">
+                       <xsl:text>1</xsl:text>
+               </xsl:when>
+
+               <xsl:otherwise>
+                       <xsl:call-template name="recursion.should.continue">
+                               <xsl:with-param name="anti.recursion" 
select="$anti.recursion.fragment"/>
+                               <xsl:with-param name="recursion.label" 
select="$recursion.label"/>
+                               <xsl:with-param name="recursion.count" 
select="$recursion.count + 1"/>
+                       </xsl:call-template>
+               </xsl:otherwise>
+       </xsl:choose>
+</xsl:template>
+
+<xsl:template match="xsd:complexType" mode="operations.message.part">
+       <xsl:param name="anti.recursion"/>
+
+       <xsl:variable name="recursion.label" select="concat('[', @name, ']')"/>
+       <xsl:variable name="recursion.test">
+               <xsl:call-template name="recursion.should.continue">
+                       <xsl:with-param name="anti.recursion" 
select="$anti.recursion"/>
+                       <xsl:with-param name="recursion.label" 
select="$recursion.label"/>
+               </xsl:call-template>
+       </xsl:variable>
+
+       <xsl:choose>
+               <xsl:when test="string-length($recursion.test) != 0">
+                       <xsl:apply-templates select="*" 
mode="operations.message.part">
+                               <xsl:with-param name="anti.recursion" 
select="concat($anti.recursion, $recursion.label)"/>
+                       </xsl:apply-templates>
+               </xsl:when>
+               <xsl:otherwise>
+                       <small style="color:blue">
+                               <xsl:value-of select="$RECURSIVE"/>
+                       </small>
+               </xsl:otherwise>
+       </xsl:choose>
+
+</xsl:template>
+
+<xsl:template match="xsd:complexContent" mode="operations.message.part">
+       <xsl:param name="anti.recursion"/>
+
+       <xsl:apply-templates select="*" mode="operations.message.part">
+               <xsl:with-param name="anti.recursion" select="$anti.recursion"/>
+       </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="xsd:complexType[descendant::xsd:attribute[ 
not(@*[local-name() = 'arrayType']) ]]" mode="operations.message.part">
+       <xsl:param name="anti.recursion"/>
+       <xsl:variable name="recursion.label" select="concat('[', @name, ']')"/>
+       <xsl:variable name="recursion.test">
+               <xsl:call-template name="recursion.should.continue">
+                       <xsl:with-param name="anti.recursion" 
select="$anti.recursion"/>
+                       <xsl:with-param name="recursion.label" 
select="$recursion.label"/>
+               </xsl:call-template>
+       </xsl:variable>
+
+       <xsl:choose>
+               <xsl:when test="string-length($recursion.test) != 0">
+                       <ul type="circle">
+                               <xsl:apply-templates select="*" 
mode="operations.message.part">
+                                       <xsl:with-param name="anti.recursion" 
select="concat($anti.recursion, $recursion.label)"/>
+                               </xsl:apply-templates>
+                       </ul>
+               </xsl:when>
+               <xsl:otherwise>
+                       <small style="color:blue">
+                               <xsl:value-of select="$RECURSIVE"/>
+                       </small>
+               </xsl:otherwise>
+       </xsl:choose>
+</xsl:template>
+
+<xsl:template match="xsd:restriction | xsd:extension" 
mode="operations.message.part">
+       <xsl:param name="anti.recursion"/>
+       <xsl:variable name="type-local-name" select="substring-after(@base, 
':')"/>
+       <xsl:variable name="type-name">
+               <xsl:choose>
+                       <xsl:when test="$type-local-name"><xsl:value-of 
select="$type-local-name"/></xsl:when>
+                       <xsl:when test="@base"><xsl:value-of 
select="@base"/></xsl:when>
+                       <xsl:otherwise>unknown type</xsl:otherwise>
+               </xsl:choose>
+       </xsl:variable>
+       <xsl:variable name="base-type" select="[EMAIL PROTECTED] = 
$type-name][1]"/>
+       <!-- xsl:if test="not($type/@abstract)">
+               <xsl:apply-templates select="$type"/>
+       </xsl:if -->
+       <xsl:if test="$base-type != 'Array'">
+               <xsl:apply-templates select="$base-type" 
mode="operations.message.part">
+                       <xsl:with-param name="anti.recursion" 
select="$anti.recursion"/>
+               </xsl:apply-templates>
+       </xsl:if>
+       <xsl:apply-templates select="*" mode="operations.message.part">
+               <xsl:with-param name="anti.recursion" select="$anti.recursion"/>
+       </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="xsd:union" mode="operations.message.part">
+       <xsl:call-template name="process-union">
+               <xsl:with-param name="set" select="@memberTypes"/>
+       </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="process-union">
+       <xsl:param name="set"/>
+       <xsl:if test="$set">
+               <xsl:variable name="item" select="substring-before($set, ' ')"/>
+               <xsl:variable name="the-rest" select="substring-after($set, ' 
')"/>
+
+               <xsl:variable name="type-local-name" 
select="substring-after($item, ':')"/>
+               <xsl:variable name="type-name">
+                       <xsl:choose>
+                               <xsl:when test="$type-local-name"><xsl:value-of 
select="$type-local-name"/></xsl:when>
+                               <xsl:otherwise><xsl:value-of 
select="$item"/></xsl:otherwise>
+                       </xsl:choose>
+               </xsl:variable>
+
+               <xsl:call-template name="render-type">
+                       <xsl:with-param name="type-local-name" 
select="$type-name"/>
+               </xsl:call-template>
+
+               <xsl:call-template name="process-union">
+                       <xsl:with-param name="set" select="$the-rest"/>
+               </xsl:call-template>
+       </xsl:if>
+</xsl:template>
+
+<xsl:template match="xsd:sequence" mode="operations.message.part">
+       <xsl:param name="anti.recursion"/>
+       <ul type="square">
+               <xsl:apply-templates select="*" mode="operations.message.part">
+                       <xsl:with-param name="anti.recursion" 
select="$anti.recursion"/>
+               </xsl:apply-templates>
+       </ul>
+</xsl:template>
+
+<xsl:template match="xsd:all" mode="operations.message.part">
+       <xsl:param name="anti.recursion"/>
+       <ul type="diamond">
+               <xsl:apply-templates select="*" mode="operations.message.part">
+                       <xsl:with-param name="anti.recursion" 
select="$anti.recursion"/>
+               </xsl:apply-templates>
+       </ul>
+</xsl:template>
+
+<xsl:template match="xsd:any" mode="operations.message.part">
+       <xsl:param name="anti.recursion"/>
+       <ul type="box">
+               <xsl:apply-templates select="*" mode="operations.message.part">
+                       <xsl:with-param name="anti.recursion" 
select="$anti.recursion"/>
+               </xsl:apply-templates>
+       </ul>
+</xsl:template>
+
+<xsl:template match="xsd:element[parent::xsd:schema]" 
mode="operations.message.part">
+       <xsl:param name="anti.recursion"/>
+       <xsl:variable name="recursion.label" select="concat('[', @name, ']')"/>
+       <xsl:variable name="recursion.test">
+               <xsl:call-template name="recursion.should.continue">
+                       <xsl:with-param name="anti.recursion" 
select="$anti.recursion"/>
+                       <xsl:with-param name="recursion.label" 
select="$recursion.label"/>
+               </xsl:call-template>
+       </xsl:variable>
+
+       <xsl:choose>
+               <xsl:when test="string-length($recursion.test) != 0">
+                       <xsl:variable name="type-name"><xsl:call-template 
name="xsd.element-type"/></xsl:variable>
+                       <xsl:variable name="elem-type" 
select="$consolidated-xsd[generate-id() != generate-id(current()) and 
$type-name and @name=$type-name and contains(local-name(), 'Type')][1]"/>
+       
+                       <xsl:if test="$type-name != @name">
+                               <xsl:apply-templates select="$elem-type" 
mode="operations.message.part">
+                                       <xsl:with-param name="anti.recursion" 
select="concat($anti.recursion, $recursion.label)"/>
+                               </xsl:apply-templates>
+       
+                               <xsl:if test="not($elem-type)">
+                                       <xsl:call-template name="render-type">
+                                               <xsl:with-param 
name="type-local-name" select="$type-name"/>
+                                       </xsl:call-template>
+                               </xsl:if>
+               
+                               <xsl:apply-templates select="*" 
mode="operations.message.part">
+                                       <xsl:with-param name="anti.recursion" 
select="concat($anti.recursion, $recursion.label)"/>
+                               </xsl:apply-templates>
+                       </xsl:if>
+               </xsl:when>
+               <xsl:otherwise>
+                       <small style="color:blue">
+                               <xsl:value-of select="$RECURSIVE"/>
+                       </small>
+               </xsl:otherwise>
+       </xsl:choose>
+
+</xsl:template>
+
+<xsl:template match="xsd:element | xsd:attribute" 
mode="operations.message.part">
+       <xsl:param name="anti.recursion"/>
+<!--
+       <xsl:variable name="recursion.label" select="concat('[', @name, ']')"/>
+-->
+       <li>
+               <xsl:variable name="local-ref" select="concat(@name, 
substring-after(@ref, ':'))"/>
+               <xsl:variable name="elem-name">
+                       <xsl:choose>
+                               <xsl:when test="@name"><xsl:value-of 
select="@name"/></xsl:when>
+                               <xsl:when test="$local-ref"><xsl:value-of 
select="$local-ref"/></xsl:when>
+                               <xsl:when test="@ref"><xsl:value-of 
select="@ref"/></xsl:when>
+                               <xsl:otherwise>anonymous</xsl:otherwise>
+                       </xsl:choose>
+               </xsl:variable>
+               <xsl:value-of select="$elem-name"/>
+
+               <xsl:variable name="type-name"><xsl:call-template 
name="xsd.element-type"/></xsl:variable>
+
+               <xsl:call-template name="render-type">
+                       <xsl:with-param name="type-local-name" 
select="$type-name"/>
+               </xsl:call-template>
+
+               <xsl:variable name="elem-type" select="[EMAIL PROTECTED] = 
$type-name and contains(local-name(), 'Type')][1]"/>
+               <xsl:apply-templates select="$elem-type | *" 
mode="operations.message.part">
+                       <xsl:with-param name="anti.recursion" 
select="$anti.recursion"/>
+               </xsl:apply-templates>
+       </li>
+</xsl:template>
+
+<xsl:template match="xsd:attribute[ @*[local-name() = 'arrayType'] ]" 
mode="operations.message.part">
+       <xsl:param name="anti.recursion"/>
+       <xsl:variable name="array-local-name" 
select="substring-after(@*[local-name() = 'arrayType'], ':')"/>
+       <xsl:variable name="type-local-name" 
select="substring-before($array-local-name, '[')"/>
+       <xsl:variable name="array-type" select="[EMAIL PROTECTED] = 
$type-local-name][1]"/>
+
+       <xsl:variable name="recursion.label" select="concat('[', 
$type-local-name, ']')"/>
+       <xsl:variable name="recursion.test">
+               <xsl:call-template name="recursion.should.continue">
+                       <xsl:with-param name="anti.recursion" 
select="$anti.recursion"/>
+                       <xsl:with-param name="recursion.label" 
select="$recursion.label"/>
+               </xsl:call-template>
+       </xsl:variable>
+
+       <xsl:choose>
+               <xsl:when test="string-length($recursion.test) != 0">
+                       <xsl:apply-templates select="$array-type" 
mode="operations.message.part">
+                               <xsl:with-param name="anti.recursion" 
select="concat($anti.recursion, $recursion.label)"/>
+                       </xsl:apply-templates>
+               </xsl:when>
+               <xsl:otherwise>
+                       <small style="color:blue">
+                               <xsl:value-of select="$RECURSIVE"/>
+                       </small>
+               </xsl:otherwise>
+       </xsl:choose>
+</xsl:template>
+
+<xsl:template name="xsd.element-type">
+       <xsl:variable name="ref-or-type">
+               <xsl:choose>
+                       <xsl:when test="@type"><xsl:value-of 
select="@type"/></xsl:when>
+                       <xsl:otherwise><xsl:value-of 
select="@ref"/></xsl:otherwise>
+               </xsl:choose>
+       </xsl:variable>
+
+       <xsl:variable name="type-local-name" 
select="substring-after($ref-or-type, ':')"/>
+       <xsl:variable name="type-name">
+               <xsl:choose>
+                       <xsl:when test="$type-local-name"><xsl:value-of 
select="$type-local-name"/></xsl:when>
+                       <xsl:when test="$ref-or-type"><xsl:value-of 
select="$ref-or-type"/></xsl:when>
+                       <xsl:otherwise>undefined</xsl:otherwise>
+               </xsl:choose>
+       </xsl:variable>
+       <xsl:value-of select="$type-name"/>
+</xsl:template>
+
+<xsl:template match="xsd:documentation" mode="operations.message.part">
+       <div style="color:green"><xsl:value-of select="." 
disable-output-escaping="yes"/></div>
+</xsl:template>
+
+
+<!--
+==================================================================
+       render-type
+==================================================================
+-->
+<xsl:template name="render-type">
+       <xsl:param name="anti.recursion"/>
+       <xsl:param name="type-local-name"/>
+
+       <xsl:if test="$ENABLE-OPERATIONS-TYPE">
+               <xsl:variable name="properties">
+                       <xsl:if test="self::xsd:element | 
self::xsd:attribute[parent::xsd:complexType]">
+                               <xsl:variable name="min"><xsl:if 
test="@minOccurs = '0'">optional</xsl:if></xsl:variable>
+                               <xsl:variable name="max"><xsl:if 
test="@maxOccurs = 'unbounded'">unbounded</xsl:if></xsl:variable>
+                               <xsl:variable name="nillable"><xsl:if 
test="@nillable">nillable</xsl:if></xsl:variable>
+       
+                               <xsl:if test="(string-length($min) + 
string-length($max) + string-length($nillable) + string-length(@use)) &gt; 0">
+                                       <xsl:text> - </xsl:text>
+                                       <xsl:value-of select="$min"/>
+                                       <xsl:if test="string-length($min) and 
string-length($max)"><xsl:text>, </xsl:text></xsl:if>
+                                       <xsl:value-of select="$max"/>
+                                       <xsl:if test="(string-length($min) + 
string-length($max)) &gt; 0 and string-length($nillable)"><xsl:text>, 
</xsl:text></xsl:if>
+                                       <xsl:value-of select="$nillable"/>
+                                       <xsl:if test="(string-length($min) + 
string-length($max) + string-length($nillable)) &gt; 0 and 
string-length(@use)"><xsl:text>, </xsl:text></xsl:if>
+                                       <xsl:value-of select="@use"/>
+                                       <xsl:text>; </xsl:text>
+                               </xsl:if>
+                       </xsl:if>
+               </xsl:variable>
+
+               <xsl:variable name="recursion.label" select="concat('[', 
$type-local-name, ']')"/>
+               <xsl:variable name="recursion.test">
+                       <xsl:call-template name="recursion.should.continue">
+                               <xsl:with-param name="anti.recursion" 
select="$anti.recursion"/>
+                               <xsl:with-param name="recursion.label" 
select="$recursion.label"/>
+                               <xsl:with-param name="recursion.count" 
select="$ANTIRECURSION-DEPTH"/>
+                       </xsl:call-template>
+               </xsl:variable>
+
+               <xsl:if test="string-length($recursion.test) != 0">
+                       <small style="color:blue">
+                               <xsl:value-of select="$properties"/>
+                               <xsl:variable name="elem-type" select="[EMAIL 
PROTECTED] = $type-local-name and (not(contains(local-name(current()), 
'element')) or contains(local-name(), 'Type'))][1]"/>
+                               <xsl:if test="string-length($type-local-name) 
&gt; 0">
+                                       <xsl:call-template 
name="render-type.write-name">
+                                               <xsl:with-param 
name="type-local-name" select="$type-local-name"/>
+                                       </xsl:call-template>
+                               </xsl:if>
+
+                               <xsl:choose>
+                                       <xsl:when test="$elem-type">
+
+                                               <xsl:apply-templates 
select="$elem-type" mode="render-type">
+                                                       <xsl:with-param 
name="anti.recursion" select="concat($anti.recursion, $recursion.label)"/>
+                                               </xsl:apply-templates>
+                                       </xsl:when>
+                                       <xsl:otherwise>
+
+                                               <xsl:apply-templates select="*" 
mode="render-type">
+                                                       <xsl:with-param 
name="anti.recursion" select="concat($anti.recursion, $recursion.label)"/>
+                                               </xsl:apply-templates>
+                                       </xsl:otherwise>
+                               </xsl:choose>
+                       </small>
+               </xsl:if>
+       </xsl:if>
+</xsl:template>
+
+<xsl:template name="render-type.write-name">
+       <xsl:param name="type-local-name"/>
+       <xsl:text> type </xsl:text>
+       <big><i>
+               <xsl:choose>
+                       <xsl:when test="$type-local-name"><xsl:value-of 
select="$type-local-name"/></xsl:when>
+                       <xsl:otherwise>undefined</xsl:otherwise>
+               </xsl:choose>
+       </i></big>
+</xsl:template>
+
+<xsl:template match="*" mode="render-type"/>
+
+<xsl:template match="xsd:element | xsd:complexType | xsd:simpleType | 
xsd:complexContent" mode="render-type">
+       <xsl:param name="anti.recursion"/>
+       <xsl:apply-templates select="*" mode="render-type">
+               <xsl:with-param name="anti.recursion" select="$anti.recursion"/>
+       </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="xsd:restriction[ parent::xsd:simpleType ]" 
mode="render-type">
+       <xsl:param name="anti.recursion"/>
+       <xsl:variable name="type-local-name" select="substring-after(@base, 
':')"/>
+       <xsl:variable name="type-name">
+               <xsl:choose>
+                       <xsl:when test="$type-local-name"><xsl:value-of 
select="$type-local-name"/></xsl:when>
+                       <xsl:when test="@base"><xsl:value-of 
select="@base"/></xsl:when>
+                       <xsl:otherwise>undefined</xsl:otherwise>
+               </xsl:choose>
+       </xsl:variable>
+
+       <xsl:text> - </xsl:text>
+       <xsl:call-template name="render-type.write-name">
+               <xsl:with-param name="type-local-name" 
select="$type-local-name"/>
+       </xsl:call-template>
+       <xsl:text> with </xsl:text>
+       <xsl:value-of select="local-name()" />
+       <xsl:apply-templates select="*" mode="render-type">
+               <xsl:with-param name="anti.recursion" select="$anti.recursion"/>
+       </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template 
match="xsd:simpleType/xsd:restriction/xsd:*[not(self::xsd:enumeration)]" 
mode="render-type">
+       <xsl:text> </xsl:text>
+       <xsl:value-of select="local-name()"/>
+       <xsl:text>(</xsl:text>
+       <xsl:value-of select="@value"/>
+       <xsl:text>)</xsl:text>
+</xsl:template>
+
+<xsl:template match="xsd:restriction | xsd:extension" mode="render-type">
+       <xsl:param name="anti.recursion"/>
+       <xsl:variable name="type-local-name" select="substring-after(@base, 
':')"/>
+       <xsl:variable name="type-name">
+               <xsl:choose>
+                       <xsl:when test="$type-local-name"><xsl:value-of 
select="$type-local-name"/></xsl:when>
+                       <xsl:when test="@base"><xsl:value-of 
select="@base"/></xsl:when>
+                       <xsl:otherwise>undefined</xsl:otherwise>
+               </xsl:choose>
+       </xsl:variable>
+       <xsl:variable name="base-type" select="[EMAIL PROTECTED] = 
$type-name][1]"/>
+       <xsl:variable name="abstract"><xsl:if 
test="$base-type/@abstract">abstract </xsl:if></xsl:variable>
+
+       <xsl:if test="not($type-name = 'Array')">
+               <xsl:value-of select="concat(' - ', local-name(), ' of ', 
$abstract)" />
+               <xsl:call-template name="render-type.write-name">
+                       <xsl:with-param name="type-local-name" 
select="$type-name"/>
+               </xsl:call-template>
+       </xsl:if>
+
+       <xsl:apply-templates select="$base-type | *" mode="render-type">
+               <xsl:with-param name="anti.recursion" select="$anti.recursion"/>
+       </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="xsd:attribute[ @*[local-name() = 'arrayType'] ]" 
mode="render-type">
+       <xsl:param name="anti.recursion"/>
+       <xsl:variable name="array-local-name" 
select="substring-after(@*[local-name() = 'arrayType'], ':')"/>
+       <xsl:variable name="type-local-name" 
select="substring-before($array-local-name, '[')"/>
+       <xsl:variable name="array-type" select="[EMAIL PROTECTED] = 
$type-local-name][1]"/>
+
+       <xsl:text> - array of </xsl:text>
+       <xsl:call-template name="render-type.write-name">
+               <xsl:with-param name="type-local-name" 
select="$type-local-name"/>
+       </xsl:call-template>
+
+       <xsl:apply-templates select="$array-type" mode="render-type">
+               <xsl:with-param name="anti.recursion" select="$anti.recursion"/>
+       </xsl:apply-templates>
+</xsl:template>
+
+<xsl:template match="xsd:enumeration" mode="render-type"/>
+
+<xsl:template match="xsd:enumeration[not(preceding-sibling::xsd:enumeration)]" 
mode="render-type">
+       <xsl:text> - enum { </xsl:text>
+       <xsl:apply-templates select="self::* | 
following-sibling::xsd:enumeration" mode="render-type.enum"/>
+       <xsl:text> }</xsl:text>
+</xsl:template>
+
+<xsl:template match="xsd:enumeration" mode="render-type.enum">
+       <xsl:if test="preceding-sibling::xsd:enumeration">
+               <xsl:text>, </xsl:text>
+       </xsl:if>
+       <xsl:text disable-output-escaping="yes">&apos;</xsl:text>
+       <xsl:value-of select="@value"/>
+       <xsl:text disable-output-escaping="yes">&apos;</xsl:text>
+</xsl:template>
+
+
+</xsl:stylesheet>

Added: incubator/woden/trunk/java/wsdl-viewer/src/wsdl-viewer.css
URL: 
http://svn.apache.org/viewvc/incubator/woden/trunk/java/wsdl-viewer/src/wsdl-viewer.css?rev=602769&view=auto
==============================================================================
--- incubator/woden/trunk/java/wsdl-viewer/src/wsdl-viewer.css (added)
+++ incubator/woden/trunk/java/wsdl-viewer/src/wsdl-viewer.css Sun Dec  9 
17:41:55 2007
@@ -0,0 +1,528 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+       wsdl-viewer.css
+*/
+
+/**
+=========================================
+       Body
+=========================================
+*/
+html {
+       background-color: teal;
+}
+
+body {
+       margin: 0;
+       padding: 0;
+       height: auto;
+       color: white;
+       background-color: teal;
+       font: normal 80%/120% Arial, Helvetica, sans-serif;
+}
+
+#outer_box {
+       padding: 3px 3px 3px 194px;
+}
+
+#inner_box {
+       width: auto;
+       background-color: white;
+       color: black;
+       border: 1px solid navy;
+}
+
+/**
+=========================================
+       Fixed box with links
+=========================================
+*/
+#outer_links { 
+       position: fixed;
+       left: 0px;
+       top: 0px;
+       margin: 3px;
+       padding: 1px;
+       z-index: 200; 
+       width: 180px;
+       height: auto;
+       background-color: gainsboro;
+       padding-top: 2px;
+       border: 1px solid navy;
+}
+
+* html #outer_links /* Override above rule for IE */ 
+{ 
+       position: absolute; 
+       width: 188px;
+       top: expression(offsetParent.scrollTop + 0); 
+} 
+
+#links {
+       margin: 1px;
+       padding: 3px;
+       background-color: white;
+       height: 350px;
+       overflow: auto;
+       border: 1px solid navy;
+}
+
+#links ul {
+       left: -999em;
+       list-style: none;
+       margin: 0;
+       padding: 0;
+       z-index: 100;
+}
+
+#links li {
+       margin: 0;
+       padding: 2px 4px;
+       width: auto;
+       z-index: 100;
+}
+
+#links ul li {
+       margin: 0;
+       padding: 2px 4px;
+       width: auto;
+       z-index: 100;
+}
+
+#links a {
+       display: block;
+       padding: 0 2px;
+       color: blue;
+       width: auto;
+       border: 1px solid white;
+       text-decoration: none;
+       white-space: nowrap;
+}
+
+#links a:hover {
+       color: white;
+       background-color: gray;
+       border: 1px solid gray;
+} 
+
+
+/**
+=========================================
+       Navigation tabs
+=========================================
+*/
+
+#outer_nav {
+       background-color: yellow;
+       padding: 0;
+       margin: 0;
+}
+
+#nav {
+       height: 100%;
+       width: auto;
+       margin: 0;
+       padding: 0;
+       background-color: gainsboro;
+       border-top: 1px solid gray;
+       border-bottom: 3px solid gray;
+       z-index: 100;
+       font: bold 90%/120% Arial, Helvetica, sans-serif;
+       letter-spacing: 2px;
+} 
+
+#nav ul { 
+       background-color: gainsboro;
+       height: auto;
+       width: auto;
+       list-style: none;
+       margin: 0;
+       padding: 0;
+       z-index: 100;
+
+       border: 1px solid silver; 
+       border-top-color: black; 
+       border-width: 1px 0 9px; 
+} 
+
+#nav li { 
+       display: inline; 
+       padding: 0;
+       margin: 0;
+} 
+
+#nav a { 
+       position: relative;
+       top: 3px;
+       float:left; 
+       width:auto; 
+       padding: 8px 10px 6px 10px;
+       margin: 3px 3px 0;
+       border: 1px solid gray; 
+       border-width: 2px 2px 3px 2px;
+
+       color: black; 
+       background-color: silver; 
+       text-decoration:none; 
+       text-transform: uppercase;
+}
+
+#nav a:hover { 
+       margin-top: 1px;
+       padding-top: 9px;
+       padding-bottom: 7px;
+       color: blue;
+       background-color: gainsboro;
+} 
+
+#nav a.current:link,
+#nav a.current:visited,
+#nav a.current:hover {
+       background: white; 
+       color: black; 
+       text-shadow:none; 
+       margin-top: 0;
+       padding-top: 11px;
+       padding-bottom: 9px;
+       border-bottom-width: 0;
+       border-color: red; 
+}
+
+#nav a:active { 
+       background-color: silver; 
+       color: white;
+} 
+
+
+
+/**
+=========================================
+       Content
+=========================================
+*/
+#header {
+       margin: 0;
+       padding: .5em 4em;
+       color: white;
+       background-color: red;
+       border: 1px solid darkred;
+}
+
+#content {
+       margin: 0;
+       padding: 0 2em .5em;
+}
+
+#footer {
+       clear: both;
+       margin: 0;
+       padding: .5em 2em;
+       color: gray;
+       background-color: gainsboro;
+       font-size: 80%;
+       border-top: 1px dotted gray;
+       text-align: right
+}
+
+.single_column {
+       padding: 10px 10px 10px 10px;
+       /*margin: 0px 33% 0px 0px; */
+       margin: 3px 0;
+}
+
+#flexi_column {
+       padding: 10px 10px 10px 10px;
+       /*margin: 0px 33% 0px 0px; */
+       margin: 0px 212px 0px 0px;
+}
+
+#fix_column {
+       float: right;
+       padding: 10px 10px 10px 10px;
+       margin: 0px;
+       width: 205px;
+       /*width: 30%; */
+       voice-family: "\"}\"";
+       voice-family:inherit;
+       /* width: 30%; */
+       width: 205px;
+}
+html>body #rightColumn {
+       width: 205px; /* ie5win fudge ends */
+} /* Opera5.02 shows a 2px gap between. N6.01Win sometimes does.
+       Depends on amount of fill and window size and wind direction. */
+
+/**
+=========================================
+       Label / value
+=========================================
+*/
+
+.page {
+       border-bottom: 3px dotted navy;
+       margin: 0;
+       padding: 10px 0 20px 0;
+}
+
+.value, .label {
+       margin: 0;
+       padding: 0;
+}
+
+.label {
+       float: left;
+       width: 140px;
+       text-align: right;
+       font-weight: bold;
+       padding-bottom: .5em;
+       margin-right: 0;
+       color: darkblue;
+}
+
+.value {
+       margin-left: 147px;
+       color: darkblue;
+       padding-bottom: .5em;
+}
+
+strong, strong a {
+       color: darkblue;
+       font-weight: bold;
+       letter-spacing: 1px;
+       margin-left: 2px;
+}
+
+
+/**
+=========================================
+       Links
+=========================================
+*/
+
+a.local:link,
+a.local:visited {
+       color: blue; 
+       margin-left: 10px;
+       border-bottom: 1px dotted blue;
+       text-decoration: none;
+       font-style: italic;
+}
+
+a.local:hover {
+       background-color: gainsboro; 
+       color: darkblue;
+       padding-bottom: 1px;
+       border-bottom: 1px solid darkblue;
+}
+
+a.target:link,
+a.target:visited,
+a.target:hover
+{
+       text-decoration: none;
+       background-color: transparent;
+       border-bottom-type: none;
+}
+
+/**
+=========================================
+       Box, Shadow
+=========================================
+*/
+
+.box {
+       padding: 6px;
+       color: black;
+       background-color: gainsboro;
+       border: 1px solid gray;
+}
+
+.shadow {
+       background: silver;
+       position: relative;
+       top: 5px;
+       left: 4px;
+}
+
+.shadow div {
+       position: relative;
+       top: -5px;
+       left: -4px;
+}
+
+/**
+=========================================
+       Floatcontainer
+=========================================
+*/
+
+.spacer
+{
+       display: block;
+       height: 0;
+       font-size: 0;
+       line-height: 0;
+       margin: 0;
+       padding: 0;
+       border-style: none;
+       clear: both; 
+       visibility:hidden;
+}
+
+.floatcontainer:after {
+       content: ".";
+       display: block;
+       height: 0;
+       font-size:0; 
+       clear: both;
+       visibility:hidden;
+}
+.floatcontainer{
+       display: inline-table;
+} /* Mark Hadley's fix for IE Mac */ /* Hides from IE Mac \*/ * 
+html .floatcontainer {
+       height: 1%;
+}
+.floatcontainer{
+       display:block;
+} /* End Hack 
+*/ 
+
+/**
+=========================================
+       Source code
+=========================================
+*/
+
+.indent {
+       margin: 2px 0 2px 20px;
+}
+
+.xml-element, .xml-proc, .xml-comment {
+       margin: 2px 0;
+       padding: 2px 0 2px 0;
+}
+
+.xml-element {
+       word-spacing: 3px;
+       color: red;
+       font-weight: bold;
+       font-style:normal;
+       border-left: 1px dotted silver;
+}
+
+.xml-element div {
+       margin: 2px 0 2px 40px;
+}
+
+.xml-att {
+       color: blue;
+       font-weight: bold;
+}
+
+.xml-att-val {
+       color: blue;
+       font-weight: normal;
+}
+
+.xml-proc {
+       color: darkred;
+       font-weight: normal;
+       font-style: italic;
+}
+
+.xml-comment {
+       color: green;
+       font-weight: normal;
+       font-style: italic;
+}
+
+.xml-text {
+       color: green;
+       font-weight: normal;
+       font-style: normal;
+}
+
+
+/**
+=========================================
+       Heading
+=========================================
+*/
+h1, h2, h3 {
+       margin: 10px 10px 2px;
+       font-family: Georgia, Times New Roman, Times, Serif;
+       font-weight: normal;
+       }
+
+h1 {
+       font-weight: bold;
+       letter-spacing: 3px;
+       font-size: 220%;
+       line-height: 100%;
+}
+
+h2 {
+       font-weight: bold;
+       font-size: 175%;
+       line-height: 200%;
+}
+
+h3 {
+       font-size: 150%;
+       line-height: 150%;
+       font-style: italic;
+}
+
+/**
+=========================================
+       Content formatting
+=========================================
+*/
+.port {
+       margin-bottom: 10px;
+       padding-bottom: 10px;
+       border-bottom: 1px dashed gray;
+}
+
+.operation {
+       margin-bottom: 20px;
+       padding-bottom: 10px;
+       border-bottom: 1px dashed gray;
+}
+
+
+/* --------------------------------------------------------
+       Printing
+*/
+
+/*
[EMAIL PROTECTED] print
+{
+       #outer_links, #outer_nav { 
+               display: none;
+       }
+*/
+
+       #outer_box {
+               padding: 3px;
+       }
+/* END print media definition
+}
+*/

Added: incubator/woden/trunk/java/wsdl-viewer/src/wsdl-viewer.js
URL: 
http://svn.apache.org/viewvc/incubator/woden/trunk/java/wsdl-viewer/src/wsdl-viewer.js?rev=602769&view=auto
==============================================================================
--- incubator/woden/trunk/java/wsdl-viewer/src/wsdl-viewer.js (added)
+++ incubator/woden/trunk/java/wsdl-viewer/src/wsdl-viewer.js Sun Dec  9 
17:41:55 2007
@@ -0,0 +1,29 @@
+function pagingInit()
+{
+       var nav = document.getElementById("nav");
+       var tabs = nav.getElementsByTagName("li");
+       for(ii = 0; ii < nav.length; ++ii) {
+               tabs[ii].className = "close";
+               aa = nav[ii].getElementsByTagName("a")
+//             aa.onclick = function() { activate(this.href); return false; }
+               if ( ii = 0 ) {
+                       aa.className = "current";
+               }
+       }
+       print("DONE!");
+}
+
+function pagingActivate(name)
+{
+//     var page
+//   if (curHeader.className=="close")
+//   {
+//     curHeader.className="";
+//     curHeader.firstChild.className="";
+//   }
+//   else if (curHeader.className=="")
+//   {
+//     curHeader.className="close";
+//     curHeader.firstChild.className="close";
+//   }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to