cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Torsten Curdt" <tcu...@dff.st>
Subject xforms
Date Mon, 23 Jul 2001 11:53:55 GMT
Ok, here is the new version of the DOMObject
and the xform logisheet.

What already works:
-on the first view the XSP page passes the SAX events
 to a new DOMObject. This holds the instance data of
 the XForm.
-the XForm instances are saved inside the session
-the XForm instance data are inserted into the XSP page
 via XMLFragment interface
-the getValue( String XPath ) should work, too

Files are attached.

With the inserting of the XMLFragment I've run into
an odd behavior. This seems to be a namespace problem
but I cannot figure out what there is the problem:
(I see the difference but I don't see the problem)

Here is what comes out of the XSP page:

<?xml version="1.0" encoding="UTF-8" ?> 
<root xmlns:xsp="http://apache.org/xsp"
      xmlns:xform="http://www.w3.org/2001/06/xforms"
      xmlns:sel="http://apache.org/xsp/sel/1.0"
>
    <!-- note: there is NO xmlns declaration -->
    <xform:xform id="orderForm">
     <xform:instance>
       <order>
         <firstname /> 
         <lastname /> 
         <email>default@aol.com</email> 
         <city /> 
         <country /> 
         <newsletter /> 
       </order>
     </xform:instance>
    </xform:xform>

    <p xmlns:xform="http://www.w3.org/2001/06/xforms"
       xmlns:sel="http://apache.org/xsp/sel/1.0"
       >
       Please enter your name and email address
    </p> 

    <!-- here is one -->
    <xform:xform id="orderForm"
      xmlns:xform="http://www.w3.org/2001/06/xforms"
      xmlns:sel="http://apache.org/xsp/sel/1.0"
      >

    <xform:textbox ref="order/firstname">
      <caption>Firstname</caption> 
    </xform:textbox>
    <xform:textbox ref="order/lastname">
      <caption>Lastname</caption> 
    </xform:textbox>
    <xform:textbox ref="order/email">
      <caption>Email</caption> 
    </xform:textbox>
    </xform:xform>
</root>

Now I use a simple copy stylesheet...

###############################################
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:xform="http://www.w3.org/2001/06/xforms"
   xmlns:xalan="http://xml.apache.org/xalan"
   >
 <xsl:template match="@*|node()" priority="-2"><xsl:copy><xsl:apply-templates
select="@*|node()"/></xsl:copy></xsl:template>
 <xsl:template match="text()" priority="-1"><xsl:value-of select="."/></xsl:template>
</xsl:stylesheet>
##############################################

And I get this:

<?xml version="1.0" encoding="UTF-8" ?> 
<root xmlns:xsp="http://apache.org/xsp"
      xmlns:xform="http://www.w3.org/2001/06/xforms"
      xmlns:sel="http://apache.org/xsp/sel/1.0"
   >
 <xform:xform id="orderForm">
  <xform:instance /> 
 </xform:xform>
</root>

I cannot figure out why!? Maybe someone has a clue?
(Hope this is not too OT - well, I attached the files ;)

Thanks
--
Torsten

Mime
View raw message