xsddoc/src/net/sf/xframe/xsddoc/xslt model.xsl,1.29,1.30

Kurt Riede <[email protected]> Sat, 26 Feb 2005 13:44:13 +0000
Newsgroups gmane.text.xml.xframe.xsddoc.devel
Message-ID <[email protected]>
Update of /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/xslt
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7996/src/net/sf/xframe/xsddoc/xslt

Modified Files:
	model.xsl 
Log Message:
minor fix for simple types

Index: model.xsl
===================================================================
RCS file: /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/xslt/model.xsl,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** model.xsl	15 Dec 2004 12:02:49 -0000	1.29
--- model.xsl	26 Feb 2005 13:44:11 -0000	1.30
***************
*** 72,75 ****
--- 72,78 ----
          </xsl:apply-templates>
        </xsl:when>
+       <xsl:when test="local-name() = 'simpleType'">
+         <xsl:apply-templates select="xs:*" mode="simpleModel"/>
+       </xsl:when>
        <xsl:otherwise>
          <xsl:apply-templates select="xs:*" mode="model"/>
***************
*** 443,446 ****
--- 446,481 ----
    </xsl:template>
    <!--
+     extension or restriction model of simple types.
+   -->
+   <xsl:template match="xs:extension | xs:restriction" mode="simpleModel">
+     <doc:base>
+       <xsl:apply-templates select="." mode="base"/>
+     </doc:base>
+   </xsl:template>
+   <!--
+     Return root base of type.
+   -->
+   <xsl:template match="xs:extension | xs:restriction" mode="base">
+     <xsl:variable name="qname">
+       <xsl:apply-templates select="." mode="resolve">
+         <xsl:with-param name="qname" select="@base"/>
+       </xsl:apply-templates>
+     </xsl:variable>
+     <xsl:variable name="refType">
+       <xsl:apply-templates select="$mainSchema" mode="referenceType">
+         <xsl:with-param name="qname" select="$qname"/>
+         <xsl:with-param name="referer" select="@type"/>
+       </xsl:apply-templates>
+     </xsl:variable>
+     <xsl:choose>
+       <xsl:when test="$refType">
+         <xsl:apply-templates select="$refType" mode="base"/>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:value-of select="$refType"/>
+       </xsl:otherwise>
+     </xsl:choose>
+   </xsl:template>
+   <!--
      extension or restriction model.
    -->
***************
*** 886,890 ****
      - included or imported schemas.</p>
    -->
!   <!-- XXX FIXME -->
    <xsl:template match="xs:schema" mode="groupModel">
      <xsl:param name="qname"/>
--- 921,925 ----
      - included or imported schemas.</p>
    -->
!   <!-- FIXME -->
    <xsl:template match="xs:schema" mode="groupModel">
      <xsl:param name="qname"/>



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click