cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikael Geijer <mik...@nufort.net>
Subject XHTML serializer bug?
Date Thu, 15 Apr 2004 11:17:40 GMT
Hi all.
Fairly new to cocoon, finding it really powerful though. Using 2.1.4 on 
Linux w 1.4.2 JVM. I'm using the XHTML serializer (w the Transitional 
DTD) to create output for some smartphones. I'm having problems with 
unwanted additional form-attributes when the page is generated. An extra 
"selected" attribute with empty value is generated. The browser bails 
out on this. The generated xhtml ooks like:

    <form selected="" action="do-login" method="post">

Is this a (known) bug? Is there any workaround? Been banging my head 
into the wall for some time know so any hints are highly apreciated.

Cheers

/Mikael




 From sitemap:
      <map:when test="smartphone">
        <map:transform src="style/{1}2xhtml.xsl"/>
        <map:transform type="encodeURL"/>
        <map:serialize type="xhtml"/>

Here's the (yes I know -static) XSP input:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java"
      xmlns:xsp="http://apache.org/xsp"
      xmlns:xsp-request="http://apache.org/xsp/request/2.0"
      xmlns:xsp-session="http://apache.org/xsp/session/2.0">
<page>
 <title>Sök kontakt på inmatat värde</title>
 <titleshort>Sök på värde</titleshort>
 <content>
   <form target="valueSearch.html">
     <input type="text" name="searchname" label="Sök på namn. Sökvärde:"/>
     <input type="text" name="searchcompany" label="Sök på företag. 
Sökvärde:"/>
     <input type="submit" name="sendbutton" value="Sök"/>
   </form>
   <linkbar/>
 </content>
</page>
</xsp:page>

And here's the xsl:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="chtmlutil.xsl"/>

<xsl:param name="contextPath"/>

<xsl:template match="page">
  <html>
    <head>
      <title><xsl:value-of select="titleshort"/></title>
      <link rel="stylesheet" href="xhtmlmpstyle.css" type="text/css" />
    </head>
    <body>
      <p>
       <xsl:apply-templates/>
      </p>
    </body>
  </html>
</xsl:template>
 
<xsl:template match="content">
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="form">
  <form action="{@target}" method="post">
    <center>
      <xsl:apply-templates/>
    </center>
  </form>
</xsl:template>

<xsl:template match="input">
  <xsl:value-of select="@label"/> <input type="{@type}" name="{@name}" 
value="{@value}" maxlength="8"/><br/>
</xsl:template>

<xsl:template match="linkbar">
    <xsl:call-template name="chtmlmenu"/>
</xsl:template>

<xsl:template match="*">
  <!--NOOP-->
</xsl:template>

</xsl:stylesheet>

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=- Mikael Geijer, nufort HB (nufort.net), Oebb AB (oebb.net)
=- mobile: +46 70 7455239 office +46 70 7455239
=- email:  mikael@nufort.net
=- snail:  Kyrklunden 8, 122 32 Enskede, Sweden
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message