Author: jonathan
Date: Wed Dec  5 11:03:42 2007
New Revision: 10563

Log:

Accomodate empty param/@type, designate restrictions, widen the parameter 
textarea a little so that restrictions of XS types don't require scrolling.

Modified:
   trunk/commons/dynamic-codegen/src/tryit.xslt

Modified: trunk/commons/dynamic-codegen/src/tryit.xslt
==============================================================================
--- trunk/commons/dynamic-codegen/src/tryit.xslt        (original)
+++ trunk/commons/dynamic-codegen/src/tryit.xslt        Wed Dec  5 11:03:42 2007
@@ -117,7 +117,7 @@
         for (var i in textareas) {
             if (textareas[i].className == "emptyfield") {
                 // extract the type from the title.
-                var type = "(" + textareas[i].title.split(' ')[1] + ")";
+                var type = "(" + textareas[i].onblur.split("'")[1] + ")";
                 if (textareas[i].value == '')
                     textareas[i].value = type;
                 else if (textareas[i].value != type)
@@ -767,6 +767,13 @@
                                     <xsl:variable name="prefix">
                                         <xsl:if test="@type-namespace = 
'http://www.w3.org/2001/XMLSchema'">xs:</xsl:if>
                                     </xsl:variable>
+                                    <xsl:variable name="restriction">
+                                        <xsl:if test="@restriction-of">
+                                            <xsl:if 
test="@restriction-namespace = 'http://www.w3.org/2001/XMLSchema'">xs:</xsl:if>
+                                            <xsl:value-of 
select="@restriction-of"/>
+                                            <xsl:text> restriction</xsl:text>  
                                          
+                                        </xsl:if>
+                                    </xsl:variable>
                                     <td class="label"><div>
                                         <xsl:value-of select="@name"/>
                                         <xsl:if test="@minOccurs &lt; 1 or 
@maxOccurs &gt; 1 or @maxOccurs = 'unbounded'"><sub>(<xsl:value-of 
select="@minOccurs"/>..<xsl:choose><xsl:when test="@maxOccurs = 
'unbounded'">*</xsl:when><xsl:otherwise><xsl:value-of 
select="@maxOccurs"/></xsl:otherwise></xsl:choose>)</sub></xsl:if></div></td>
@@ -774,11 +781,11 @@
                                         <div id="[EMAIL PROTECTED]">
                                             <!-- first child is a hidden 
template for cloning additional array items -->
                                             <div style="display:none">
-                                                <textarea id="[EMAIL 
PROTECTED]" class="emptyfield" onfocus="prepareInput(event)" 
onblur="restoreInput(event,'([EMAIL PROTECTED])')" title="An [EMAIL PROTECTED] 
value representing the [EMAIL PROTECTED]">(<xsl:value-of 
select="$prefix"/><xsl:value-of select="@type"/>)</textarea>
+                                                <textarea id="[EMAIL 
PROTECTED]" class="emptyfield" onfocus="prepareInput(event)" 
onblur="restoreInput(event,'([EMAIL PROTECTED])')" title="A [EMAIL PROTECTED] 
value representing the [EMAIL PROTECTED]">(<xsl:value-of 
select="$prefix"/><xsl:value-of select="@type"/><xsl:value-of 
select="$restriction"/>)</textarea>
                                                 <img 
src="{$image-path}expand.gif" class="cornerExpand" onclick="expand(event)" 
title="Increase typing space"/>
                                             </div>
                                             <div>
-                                                <textarea id="[EMAIL 
PROTECTED]" class="emptyfield" onfocus="prepareInput(event)" 
onblur="restoreInput(event,'([EMAIL PROTECTED])')" title="An [EMAIL PROTECTED] 
value representing the [EMAIL PROTECTED]">(<xsl:value-of 
select="$prefix"/><xsl:value-of select="@type"/>)</textarea>
+                                                <textarea id="[EMAIL 
PROTECTED]" class="emptyfield" onfocus="prepareInput(event)" 
onblur="restoreInput(event,'([EMAIL PROTECTED])')" title="A [EMAIL PROTECTED] 
value representing the [EMAIL PROTECTED]">(<xsl:value-of 
select="$prefix"/><xsl:value-of select="@type"/><xsl:value-of 
select="$restriction"/>)</textarea>
                                                 <img 
src="{$image-path}expand.gif" class="cornerExpand" onclick="expand(event)" 
title="Increase typing space"/>
                                             </div>
                                         </div>
@@ -1120,6 +1127,7 @@
                 overflow-y:auto;
                 margin:0px;
                 border: 1px solid #CCCCCC;
+                width: 15em;
             }
             table.ops textarea.emptyfield {
                 height: 1.7em;
@@ -1128,6 +1136,7 @@
                 overflow-y:auto;
                 margin:0px;
                 border: 1px solid #CCCCCC;
+                width: 15em;
             }
             table.ops .typeannotation {
                 color:#CCC;

_______________________________________________
Commons-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/commons-dev

Reply via email to