ivelin      2002/06/08 10:59:54

  Modified:    src/webapp/stylesheets/xmlform xmlform2html.xsl
  Log:
  modification to the xmlform2html.xsl file which removes the
  hard-coded class attributes and allows all attributes to be copied through. 
This
  allows size to be used on textboxes amongst others, it also allows the class
  attribute to be ignored.
  
  by Andrew Timberlake
  
  Revision  Changes    Path
  1.3       +26 -12    
xml-cocoon2/src/webapp/stylesheets/xmlform/xmlform2html.xsl
  
  Index: xmlform2html.xsl
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/webapp/stylesheets/xmlform/xmlform2html.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- xmlform2html.xsl  2 Jun 2002 03:33:36 -0000       1.2
  +++ xmlform2html.xsl  8 Jun 2002 17:59:54 -0000       1.3
  @@ -17,7 +17,8 @@
     Different widgets are broken into templates 
     to allow customization in importing stylesheets
   
  -  author: Ivelin Ivanov, [EMAIL PROTECTED], May 2002
  +  author: Ivelin Ivanov, [EMAIL PROTECTED], June 2002
  +  author: Andrew Timberlake <[EMAIL PROTECTED]>, June 2002
     author: Michael Ratliff, [EMAIL PROTECTED] <[EMAIL PROTECTED]>, May 2002
     author: Torsten Curdt, [EMAIL PROTECTED], March 2002
   
  @@ -48,27 +49,35 @@
      </xsl:template>
   
      <xsl:template match="xf:textbox">
  -      <input name="[EMAIL PROTECTED]" type="textbox" 
value="{xf:value/text()}"  class="[EMAIL PROTECTED]"/>
  +      <input name="[EMAIL PROTECTED]" type="textbox" 
value="{xf:value/text()}">
  +             <xsl:copy-of select="@*[not(name()='ref')]"/>
  +      </input>
      </xsl:template>
   
      <xsl:template match="xf:password">
  -      <input name="[EMAIL PROTECTED]" type="password" 
value="{xf:value/text()}"  class="[EMAIL PROTECTED]"/>
  +      <input name="[EMAIL PROTECTED]" type="password" 
value="{xf:value/text()}">
  +             <xsl:copy-of select="@*[not(name()='ref')]"/>
  +      </input>
      </xsl:template>
   
      <xsl:template match="xf:hidden">
  -      <input name="[EMAIL PROTECTED]" type="hidden" 
value="{xf:value/text()}"  class="[EMAIL PROTECTED]"/>
  +      <input name="[EMAIL PROTECTED]" type="hidden" 
value="{xf:value/text()}">
  +             <xsl:copy-of select="@*[not(name()='ref')]"/>
  +      </input>
      </xsl:template>
   
      <xsl:template match="xf:selectBoolean">
  -      <input name="[EMAIL PROTECTED]" type="checkbox" value="true"  
class="[EMAIL PROTECTED]">
  -        <xsl:if test="xf:value/text() = 'true'">
  +      <input name="[EMAIL PROTECTED]" type="checkbox" value="true">
  +             <xsl:copy-of select="@*[not(name()='ref')]"/>
  +          <xsl:if test="xf:value/text() = 'true'">
             <xsl:attribute name="checked"/>
           </xsl:if>
         </input>
      </xsl:template>
   
      <xsl:template match="xf:selectOne | xf:[EMAIL PROTECTED]'listbox']">
  -     <select name="[EMAIL PROTECTED]"  class="[EMAIL PROTECTED]">
  +     <select name="[EMAIL PROTECTED]">
  +        <xsl:copy-of select="@*[not(name()='ref')]"/>
          <xsl:variable name="selected" select="xf:value"/>
          <xsl:for-each select="xf:item">
            <option value="{xf:value}">
  @@ -85,7 +94,8 @@
                <xsl:variable name="selected" select="xf:value"/>
                <xsl:variable name="ref" select="@ref"/>
           <xsl:for-each select="xf:item">
  -            <input name="{$ref}" type="radio" value="{xf:value}" 
class="[EMAIL PROTECTED]">
  +            <input name="{$ref}" type="radio" value="{xf:value}">
  +                             <xsl:copy-of select="@*[not(name()='ref')]"/>
                   <xsl:if test="xf:value = $selected">
                       <xsl:attribute name="checked"/>
                   </xsl:if>
  @@ -98,8 +108,9 @@
      
      <xsl:template match="xf:selectMany | xf:[EMAIL PROTECTED]'listbox']">
                <xsl:variable name="selected" select="xf:value"/>
  -             <select name="[EMAIL PROTECTED]"  class="[EMAIL PROTECTED]">
  -                     <xsl:attribute name="multiple"/>
  +             <select name="[EMAIL PROTECTED]">
  +                     <xsl:copy-of select="@*[not(name()='ref')]"/>
  +                     <xsl:attribute name="multiple"/>
                        <xsl:for-each select="xf:item">
                                <option value="{xf:value}">
                                        <xsl:if test="xf:value = $selected">
  @@ -116,7 +127,8 @@
                <xsl:variable name="selected" select="xf:value"/>
                <xsl:variable name="ref" select="@ref"/>
           <xsl:for-each select="xf:item">
  -            <input name="{$ref}" type="checkbox" value="{xf:value}" 
class="[EMAIL PROTECTED]">
  +            <input name="{$ref}" type="checkbox" value="{xf:value}">
  +                             <xsl:copy-of select="@*[not(name()='ref')]"/>
                   <xsl:if test="xf:value = $selected">
                     <xsl:attribute name="checked"/>
                   </xsl:if>
  @@ -129,7 +141,9 @@
      
      
      <xsl:template match="xf:submit">
  -      <input name="[EMAIL PROTECTED]" type="submit" 
value="{xf:caption/text()}"  class="[EMAIL PROTECTED]"/>
  +      <input name="[EMAIL PROTECTED]" type="submit" 
value="{xf:caption/text()}">
  +             <xsl:copy-of select="@*[not(name()='id')]"/>
  +      </input>
      </xsl:template>
   
   
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to