xsddoc/src/net/sf/xframe/xsddoc/xslt component.xsl,1.27,1.28 xml2html.xsl,1.32,1.33

Kurt Riede <[email protected]> Tue, 07 Dec 2004 14:47:54 +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-serv14900/src/net/sf/xframe/xsddoc/xslt

Modified Files:
	component.xsl xml2html.xsl 
Log Message:
first version commited for attributes like 'nillable', 'final', 'substitutionGroup' and other

Index: xml2html.xsl
===================================================================
RCS file: /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/xslt/xml2html.xsl,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** xml2html.xsl	7 Oct 2004 22:55:12 -0000	1.32
--- xml2html.xsl	7 Dec 2004 14:47:51 -0000	1.33
***************
*** 207,211 ****
          <xsl:choose>
            <xsl:when test="doc:documentation">
-             <xsl:apply-templates select="doc:documentation" mode="short-documentation"/>
            </xsl:when>
            <xsl:otherwise>
--- 207,210 ----
***************
*** 484,487 ****
--- 483,540 ----
            </xsl:for-each>
          </xsl:if>
+         <dl>
+           <dt>Properties</dt>
+           <dd>
+             <xsl:choose>
+               <xsl:when test="@nillable = 'true'">
+                 <xsl:text>This component is not nillable.</xsl:text>
+               </xsl:when>
+               <xsl:otherwise>
+                 <xsl:text>This component is nillable.</xsl:text>
+               </xsl:otherwise>
+             </xsl:choose>
+                 <br/>
+             <xsl:if test="@abstract = 'true'">
+               <xsl:text>This component is abstract.</xsl:text>
+               <br/>
+             </xsl:if>
+             <xsl:if test="string(@final) != ''">
+               <xsl:text>This component is final by: </xsl:text>
+               <xsl:value-of select="@final"/>
+               <xsl:text>.</xsl:text>
+               <br/>
+             </xsl:if>
+             <xsl:if test="string(@block) != ''">
+               <xsl:text>This component is blocked from derivation by: </xsl:text>
+               <xsl:value-of select="@block"/>
+               <xsl:text>.</xsl:text>
+               <br/>
+             </xsl:if>
+             <xsl:if test="@mixed = 'true'">
+               <xsl:text>This component allowes mixed content.</xsl:text>
+               <br/>
+             </xsl:if>
+             <xsl:if test="@mixed = 'false'">
+               <xsl:text>This component doesn't allow mixed content.</xsl:text>
+               <br/>
+             </xsl:if>
+             <xsl:if test="@substitutionGroup">
+               <xsl:text>This element is a substitution group for type </xsl:text>
+               <tt>
+                 <xsl:choose>
+                   <xsl:when test="@substitutionGroupHref">
+                     <a href="{@substitutionGroupHref}"><xsl:value-of select="@substitutionGroup"/></a>
+                   </xsl:when>
+                   <xsl:otherwise>
+                     <xsl:value-of select="@substitutionGroup"/>
+                   </xsl:otherwise>
+                 </xsl:choose>
+                 </tt>
+               <xsl:text>.</xsl:text>
+               <br/>
+             </xsl:if>
+           </dd>
+         </dl>
+         <hr/>
          <xsl:apply-templates select="doc:component/doc:model"/>
          <xsl:apply-templates select="doc:component/doc:subTypes"/>
***************
*** 717,721 ****
        </dl>
      </xsl:if>
-     <hr/>
    </xsl:template>
    <!--
--- 770,773 ----

Index: component.xsl
===================================================================
RCS file: /cvsroot/xframe/xsddoc/src/net/sf/xframe/xsddoc/xslt/component.xsl,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** component.xsl	20 Sep 2004 19:30:41 -0000	1.27
--- component.xsl	7 Dec 2004 14:47:51 -0000	1.28
***************
*** 158,165 ****
        </xsl:attribute>
        <xsl:choose>
!         <xsl:when test="$type = 'element' or $type = 'complexType'">
            <xsl:attribute name="final">
              <xsl:apply-templates select="@final"/>
            </xsl:attribute>
          </xsl:when>
          <xsl:when test="$type = 'simpleType'">
--- 158,176 ----
        </xsl:attribute>
        <xsl:choose>
!         <xsl:when test="$type = 'element' or $type = 'complexType' or $type = 'simpleType'">
            <xsl:attribute name="final">
              <xsl:apply-templates select="@final"/>
            </xsl:attribute>
+           <xsl:attribute name="block">
+             <xsl:apply-templates select="@block"/>
+           </xsl:attribute>
+           <xsl:choose>
+             <xsl:when test="@abstract">
+               <xsl:attribute name="abstract"><xsl:value-of select="@abstract"/></xsl:attribute>
+             </xsl:when>
+             <xsl:otherwise>
+               <xsl:attribute name="abstract">false</xsl:attribute>
+             </xsl:otherwise>
+           </xsl:choose>
          </xsl:when>
          <xsl:when test="$type = 'simpleType'">
***************
*** 167,170 ****
--- 178,239 ----
          </xsl:when>
        </xsl:choose>
+      <xsl:if test="$type = 'element'">
+       <xsl:choose>
+         <xsl:when test="@nillable">
+           <xsl:attribute name="nillable"><xsl:value-of select="@nillable"/></xsl:attribute>
+         </xsl:when>
+         <xsl:otherwise>
+           <xsl:attribute name="nillable">false</xsl:attribute>
+         </xsl:otherwise>
+       </xsl:choose>
+       <xsl:if test="@substitutionGroup">
+         <xsl:attribute name="substitutionGroup"><xsl:value-of select="@substitutionGroup"/></xsl:attribute>
+         <xsl:variable name="prefix" select="substring-before(@substitutionGroup, ':')"/>
+         <xsl:variable name="namespace" select="namespace::*[name() = $prefix]"/>
+         <xsl:variable name="localname">
+           <xsl:choose>
+             <xsl:when test="contains(@substitutionGroup, ':')">
+               <xsl:value-of select="substring-after(@substitutionGroup, ':')"/>
+             </xsl:when>
+             <xsl:otherwise>
+               <xsl:value-of select="@substitutionGroup"/>
+             </xsl:otherwise>
+           </xsl:choose>
+         </xsl:variable>
+         <xsl:variable name="qname">
+           <xsl:apply-templates select="." mode="resolve">
+             <xsl:with-param name="qname" select="@substitutionGroup"/>
+           </xsl:apply-templates>
+         </xsl:variable>
+         <xsl:variable name="folder">
+           <xsl:call-template name="namespaceFolder">
+             <xsl:with-param name="uri" select="../namespace::*[name() = $prefix]"/>
+           </xsl:call-template>
+         </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="@substitutionGroup"/>
+           </xsl:apply-templates>
+         </xsl:variable>
+         <xsl:if test="string($refType) != ''">
+           <xsl:attribute name="substitutionGroupHref">
+             <xsl:value-of select="concat('../../', $folder, '/', $refType, '/', $localname, '.html')"/>
+           </xsl:attribute>
+         </xsl:if>
+       </xsl:if>
+     </xsl:if>
+ 
+ 
+     <xsl:if test="$type = 'complexType'">
+       <xsl:choose>
+         <xsl:when test="@mixed">
+           <xsl:attribute name="mixed"><xsl:value-of select="@mixed"/></xsl:attribute>
+         </xsl:when>
+         <xsl:otherwise>
+           <xsl:attribute name="mixed">false</xsl:attribute>
+         </xsl:otherwise>
+       </xsl:choose>
+      </xsl:if>
       <xsl:if test="$type = 'complexType' or $type = 'simpleType'">
          <doc:superTypes>
***************
*** 491,496 ****
    -->
    <xs:finalValues>
!      <xs:value>extension</xs:value>
!      <xs:value>restriction</xs:value>
    </xs:finalValues>
    <xsl:variable name="finalValues" select="document('')/*/xs:finalValues/xs:value" />
--- 560,565 ----
    -->
    <xs:finalValues>
!     <xs:value>extension</xs:value>
!     <xs:value>restriction</xs:value>
    </xs:finalValues>
    <xsl:variable name="finalValues" select="document('')/*/xs:finalValues/xs:value" />
***************
*** 498,505 ****
    -->
    <xsl:template match="@final | @finalDefault">
!      <xsl:variable name="final" select="concat(' ', normalize-space(), ' ')" />
!      <xsl:call-template name="list">
!         <xsl:with-param name="items" select="$finalValues[$final = ' ##all ' or contains($final, concat(' ', ., ' '))]" />
!      </xsl:call-template>
    </xsl:template>
    <!--
--- 567,574 ----
    -->
    <xsl:template match="@final | @finalDefault">
!     <xsl:variable name="final" select="concat(' ', normalize-space(), ' ')" />
!     <xsl:call-template name="list">
!       <xsl:with-param name="items" select="$finalValues[$final = ' #all ' or contains($final, concat(' ', ., ' '))]" />
!     </xsl:call-template>
    </xsl:template>
    <!--
***************
*** 507,513 ****
    -->
    <xs:simpleFinalValues>
!      <xs:value>restriction</xs:value>
!      <xs:value>list</xs:value>
!      <xs:value>union</xs:value>
    </xs:simpleFinalValues>
    <xsl:variable name="simpleFinalValues" select="document('')/*/xs:simpleFinalValues/xs:value" />
--- 576,582 ----
    -->
    <xs:simpleFinalValues>
!     <xs:value>restriction</xs:value>
!     <xs:value>list</xs:value>
!     <xs:value>union</xs:value>
    </xs:simpleFinalValues>
    <xsl:variable name="simpleFinalValues" select="document('')/*/xs:simpleFinalValues/xs:value" />
***************
*** 515,522 ****
    -->
    <xsl:template match="@final | @finalDefault" mode="simple">
!      <xsl:variable name="final" select="concat(' ', normalize-space(), ' ')" />
!      <xsl:call-template name="list">
!         <xsl:with-param name="items" select="$simpleFinalValues[$final = ' ##all ' or contains($final, concat(' ', ., ' '))]" />
!      </xsl:call-template>
    </xsl:template>
    <!--
--- 584,591 ----
    -->
    <xsl:template match="@final | @finalDefault" mode="simple">
!     <xsl:variable name="final" select="concat(' ', normalize-space(), ' ')" />
!     <xsl:call-template name="list">
!       <xsl:with-param name="items" select="$simpleFinalValues[$final = ' #all ' or contains($final, concat(' ', ., ' '))]" />
!     </xsl:call-template>
    </xsl:template>
    <!--
***************
*** 524,530 ****
    -->
    <xs:blockValues>
!      <xs:value>substitution</xs:value>
!      <xs:value>extension</xs:value>
!      <xs:value>restriction</xs:value>
    </xs:blockValues>
    <xsl:variable name="blockValues" select="document('')/*/xs:blockValues/xs:value" />
--- 593,599 ----
    -->
    <xs:blockValues>
!     <xs:value>substitution</xs:value>
!     <xs:value>extension</xs:value>
!     <xs:value>restriction</xs:value>
    </xs:blockValues>
    <xsl:variable name="blockValues" select="document('')/*/xs:blockValues/xs:value" />
***************
*** 532,539 ****
    -->
    <xsl:template match="@block | @blockDefault">
!      <xsl:variable name="block" select="concat(' ', normalize-space(), ' ')" />
!      <xsl:call-template name="list">
!         <xsl:with-param name="items" select="$blockValues[$block = ' ##all ' or contains($block, concat(' ', ., ' '))]" />
!      </xsl:call-template>
    </xsl:template>
    <!--
--- 601,608 ----
    -->
    <xsl:template match="@block | @blockDefault">
!     <xsl:variable name="block" select="concat(' ', normalize-space(), ' ')" />
!     <xsl:call-template name="list">
!       <xsl:with-param name="items" select="$blockValues[$block = ' #all ' or contains($block, concat(' ', ., ' '))]" />
!     </xsl:call-template>
    </xsl:template>
    <!--
***************
*** 547,557 ****
      </xsl:for-each>
    </xsl:template>
- 
-   <xsl:template match="@fixed | @default">
-      <tr>
-         <th><xsl:value-of select="name()" /> value</th>
-         <td><xsl:value-of select="." /></td>
-      </tr>
-   </xsl:template>
    <!--
      Note about keys:
--- 616,619 ----



-------------------------------------------------------
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://productguide.itmanagersjournal.com/