Author: jonathan
Date: Wed Dec  5 11:01:57 2007
New Revision: 10562

Log:

WSAS-628: Recognize local element restrictions.  Added "param/@restriction-of" 
and "param/@restriction-namespace" attribute, made "param/@type-namespace" 
optional (missing for a local element declaration), made param/@type empty for 
local element declarations.

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

Modified: trunk/commons/dynamic-codegen/src/wsdl2sig.xslt
==============================================================================
--- trunk/commons/dynamic-codegen/src/wsdl2sig.xslt     (original)
+++ trunk/commons/dynamic-codegen/src/wsdl2sig.xslt     Wed Dec  5 11:01:57 2007
@@ -610,10 +610,16 @@
     
                     <!-- Not in a built-in type, do some more inference -->
                     <xsl:otherwise>
-                        <xsl:attribute name="type"><xsl:value-of 
select="substring-after(@type,':')"/></xsl:attribute>
-                        <xsl:attribute name="type-namespace"><xsl:value-of 
select="namespace::*[local-name() =
-                            
substring-before(current()/@type,':')]"/></xsl:attribute>
-                        <xsl:variable name="this-type-def" select="[EMAIL 
PROTECTED](current()/@type,':')]"/>
+                        <xsl:if test="@type">
+                            <xsl:attribute name="type"><xsl:value-of 
select="substring-after(@type,':')"/></xsl:attribute>
+                            <xsl:attribute name="type-namespace"><xsl:value-of 
select="namespace::*[local-name() =
+                                
substring-before(current()/@type,':')]"/></xsl:attribute>
+                        </xsl:if>
+                        <xsl:if test="@name">
+                            <xsl:attribute name="type"></xsl:attribute>
+                        </xsl:if>
+                        <!-- this-type-def will either point to the named type 
(if there is a @type) or to the child type (if there is a @name) -->
+                        <xsl:variable name="this-type-def" select="[EMAIL 
PROTECTED](current()/@type,':')] | xs:simpleType | xs:complexType"/>
                         <xsl:attribute name="simple">
                             <xsl:choose>
                                 <xsl:when test="local-name($this-type-def) = 
'simpleType'">yes</xsl:when>
@@ -621,6 +627,15 @@
                             </xsl:choose>
                         </xsl:attribute>
                         
+                        <!-- look into the type and see if we can determine 
whether it's a restriction of another type -->
+                        <xsl:if test="$this-type-def/xs:restriction">
+                            <xsl:for-each 
select="$this-type-def/xs:restriction">
+                                <xsl:attribute 
name="restriction-of"><xsl:value-of 
select="substring-after(@base,':')"/></xsl:attribute>
+                                <xsl:attribute 
name="restriction-namespace"><xsl:value-of select="namespace::*[local-name() =
+                                
substring-before(current()/@base,':')]"/></xsl:attribute>
+                            </xsl:for-each>
+                        </xsl:if>
+                        
                         <!-- Does the type represent an enumeration of strings 
(as generated by the Mashup Server? 
                              If so capture the possible values.  -->
                         <xsl:if 
test="$this-type-def/xs:restriction[substring-after(@base,':') = 
'string']/xs:enumeration">

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

Reply via email to