You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by roy huang <li...@hotmail.com> on 2004/03/30 13:31:21 UTC

[cforms] tag attribute being eaten.

Hi,devs:
  I set <body> tag with attribute like <body style="margin:0" bgcolor="#6B82DF">,after transformed by forms-samples-styling.xsl,the style and bgcolor attribute is eaten.
  I saw a archive mail about onload in body and check the xsl file forms-field-styling.xsl,
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=107952785825215&w=2
  I think it will be better if the body attribute can reserve.
  Other question: If I use <Body> or <BODY> instead <body> ,the xsl won't work for <Body>, any suggestions?
  xsl file:
  <xsl:template match="body" mode="forms-field">
    <xsl:attribute name="onload">forms_onload(); <xsl:value-of select="@onload"/></xsl:attribute>
  </xsl:template>

Roy Huang


Re: [cforms] tag attribute being eaten.

Posted by Joerg Heinicke <jo...@gmx.de>.
roy huang <lingererhuang <at> hotmail.com> writes:

> 
> Hi,devs:
>   I set <body> tag with attribute like <body style="margin:0"
bgcolor="#6B82DF">,after transformed by
> forms-samples-styling.xsl,the style and bgcolor attribute is eaten.
>   I saw a archive mail about onload in body and check the xsl file
forms-field-styling.xsl,
> http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=107952785825215&w=2
>   I think it will be better if the body attribute can reserve.

Though your attributes should better be separated into CSS, you are right in
general, we should not ignore the attributes.

I applied a patch for it that copies all attributes through.

>   Other question: If I use <Body> or <BODY> instead <body> ,the xsl won't work
for <Body>, any suggestions?

Of course. That's due to case sensitiveness of XML. You must use <body>.

Joerg