The latest Cocoon CVS HEAD (2.1) is working again, but...

Read details below:

After I spent a few hours trying to debug the problem,
I realized that there is an issue with Xerces 2.2.0 and 2.2.1 (or
incompatibility between it and the new Xalan libs).
I rolled back to Xerces 2.1.0 and things are looking good again.
I kept the latest versions of Xalan.
The combination appears to work well.

As far as XSLTC is concerned, there appears to be a difference in the
behaviour between its latest version and Xalan.
I am attaching two html files, result from XSLTC and Xalan applied against
the same xml source file.
The stylesheet is also attached.
Xalan produces the results that I would like to see,
although it is possible that my stylesheet is buggy.

Until now all XMLForm demo pages have been working equally good with both
XSLTC and Xalan.
I will now have to switch the demo to Xalan until this difference in the
translators is resolved.


If anybody has a better diagnostics of the problem, please notify the Xalan
group of your findings.


Cheers,

Ivelin


----- Original Message -----
From: "Ramy Mamdouh" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 15, 2002 5:53 AM
Subject: [XMLFORMS exception] was Re: Exception with current CVS of 2.1


> Hi
>
> using the latest xerces with xmlforms (either mine or the wizard sample)
> resulted in :
>
> /org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
> java.util.EmptyStackException/
> Original exception : java.util.EmptyStackException
> at java.util.Stack.peek(Stack.java:82)
> at java.util.Stack.pop(Stack.java:64)
> at org.apache.xml.utils.DOMBuilder.endElement(DOMBuilder.java:375)
> at
>
org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerI
dentityImpl.java:1050)
> at
> org.apache.cocoon.xml.AbstractXMLPipe.endElement(AbstractXMLPipe.java:147)
> at
> org.apache.cocoon.xml.AbstractXMLPipe.endElement(AbstractXMLPipe.java:147)
> at
>
org.apache.cocoon.transformation.AbstractSAXTransformer.endElement(AbstractS
AXTransformer.java:366)
> at
>
org.apache.cocoon.components.sax.XMLTeePipe.endElement(XMLTeePipe.java:124)
> at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
> at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
So
>
> and eveything else seems working properly in Cocoon with the new xerces
> in the COMMON/endorsed.
>
> Anyway to get over this exception?
> Thanks in advance.
>
> Enke, Michael wrote:
>
> >Tomcat looks into all WEB-INF/lib directorys and into
$CATALINA_HOME/common/endorsed.
> >To work properly you must have xerces, xml-apis, xalan and xslt in
common/endorsed.
> >Probably this one are old ones and in latest cocoon you have new one.
> >
> >But be careful with throwing away your old ones: xml-form doesn't work
> >with the new xerces. Error was reported and is reproducable. With old
libs it is working.
> >
> >Michael
> >
> >
> >Jeremy Quinn wrote:
> >
> >
> >>With the latest CVS of cocoon-dev 2.1, I am getting this exception
> >>(below) from TomCat4.1.12 when I access anything in cocoon webapp.
> >>
> >>The problem seems to be : "java.lang.VerifyError: Cannot inherit from
> >>final class", while setting up xerces:
> >>"org.apache.xerces.impl.XMLNSDocumentScannerImpl.createContentDispatcher
> >>".
> >>
> >>Is someone in the middle of working on something that may be causing
> >>this?
> >>
> >>Thanks for any help.
> >>
> >>regards Jeremy
> >>
> >>
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, email: [EMAIL PROTECTED]
> >
> >
> >
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
Title: XMLForm - Cocoon Feedback Wizard




[Donald] [Duck] [[EMAIL PROTECTED]] [5] [true] [1] [http://] [false] [] [p4] [512] [Tomcat] [1.3]

Confirm Input

Professional roles
Personal hobbies
[gym]
[swim]
[soccer]
[ski]
Favorite web sites
[http://xml.apache.org/cocoon]
[http://jakarta.apache.org]
[http://www.google.com]


Visits Count : [14]
Title: XMLForm - Cocoon Feedback Wizard




Confirm Input

First Name

[Donald]

Last Name

[Duck]

Email

[[EMAIL PROTECTED]]

Age

[5]
Professional roles
Personal hobbies

[gym]

[swim]

[soccer]

[ski]

Hidden attribute

[true]

Number of installations

[1]

Live URL

[http://]

Publish URL

[false]

OS

[]

Processor

[p4]

RAM

[512]

Servlet Engine

[Tomcat]

Java Version

[1.3]
Favorite web sites

URL:

[http://xml.apache.org/cocoon]

URL:

[http://jakarta.apache.org]

URL:

[http://www.google.com]


Visits Count : [4]
<?xml version="1.0" encoding="iso-8859-1" ?>


<!-- 

  Basic XMLForm processing stylesheet.  
  Converts XMLForm tags to HTML tags.
  
  Syntax is borrowed from the XForms standard.
  http://www.w3.org/TR/2002/WD-xforms-20020118/
  
  This stylesheet is usually applied at the end of a 
  transformation process after laying out the xmlform
  tags on the page is complete. At this stage xmlform tags 
  are rendered in device specific format.
  
  Different widgets are broken into templates 
  to allow customization in importing stylesheets

  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
  author: Simon Price <[EMAIL PROTECTED]>, September 2002
  author: Konstantin Piroumian <[EMAIL PROTECTED]>, September 2002
  author: Robert Ellis Parrott <[EMAIL PROTECTED]>, October 2002
-->

<xsl:stylesheet version="1.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
    xmlns:xf="http://xml.apache.org/cocoon/xmlform/2002";>

   <xsl:output method = "xml" omit-xml-declaration = "no"  /> 
  

   <xsl:template match="/">
     <xsl:apply-templates />
   </xsl:template>


   <xsl:template match="xf:form">
      <form>
         <xsl:copy-of select="@*"/>

         <!-- the xf:form/@view attributed is sent back to the server as a hidden field -->
         <input type="hidden" name="cocoon-xmlform-view" value="{@view}"/>
         
         <!-- render the child form controls -->
         <xsl:apply-templates />
         
      </form>
   </xsl:template>


   <xsl:template match="xf:output">
      [<xsl:value-of select="xf:value/text()"/>]
   </xsl:template>


   <xsl:template match="xf:textbox">
      <!-- the ref attribute is assigned to html:name, which is how it is linked to the model -->
      <input name="{@ref}" type="textbox" value="{xf:value/text()}">
        <!-- copy all attributes from the original markup, except for "ref" -->
        <xsl:copy-of select="@*[not(name()='ref')]"/>
        <xsl:apply-templates select="xf:hint"/>
      </input>
   </xsl:template>


   <xsl:template match="xf:textarea">
      <textarea name="{@ref}" >
        <xsl:copy-of select="@*[not(name()='ref')]"/>
        <xsl:value-of select="xf:value/text()"/>
        <xsl:apply-templates select="xf:hint"/>
      </textarea>
   </xsl:template>


   <xsl:template match="xf:password">
      <input name="{@ref}" type="password" value="{xf:value/text()}">
        <xsl:copy-of select="@*[not(name()='ref')]"/>
        <xsl:apply-templates select="xf:hint"/>
      </input>
   </xsl:template>


   <xsl:template match="xf:hidden">
      <input name="{@ref}" type="hidden" value="{xf:value/text()}">
        <xsl:copy-of select="@*[not(name()='ref')]"/>
      </input>
   </xsl:template>


   <xsl:template match="xf:selectBoolean">
      <input name="{@ref}" type="checkbox" value="true">
        <xsl:copy-of select="@*[not(name()='ref')]"/>
          <xsl:if test="xf:value/text() = 'true'">
          <xsl:attribute name="checked"/>
        </xsl:if>
        <xsl:apply-templates select="xf:hint"/>
      </input>
   </xsl:template>


   <xsl:template match="xf:selectOne | xf:selectOne[@selectUIType='listbox']">
     <select name="{@ref}">
     <xsl:copy-of select="@*[not(name()='ref')]"/>
     <!-- all currently selected nodes are listed as value elements -->
       <xsl:variable name="selected" select="xf:value"/>
       <xsl:for-each select="xf:item">
         <option value="{xf:value}">
           <!-- If the current item value matches one of the selected values -->
           <!-- mark it as selected in the listbox -->
           <xsl:if test="$selected = xf:value">
             <xsl:attribute name="selected"/>
           </xsl:if>
           <xsl:value-of select="xf:caption"/>
         </option>
       </xsl:for-each>
     </select>
   </xsl:template>

   
   <xsl:template match="xf:selectOne[@selectUIType='radio']">
        <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}">
                <xsl:copy-of select="@*[not(name()='ref')]"/>
                <xsl:if test="xf:value = $selected">
                    <xsl:attribute name="checked"/>
                </xsl:if>
            </input>
            <xsl:value-of select="xf:caption"/>
            <br/>
        </xsl:for-each>
   </xsl:template>

   
   <xsl:template match="xf:selectMany | xf:selectMany[@selectUIType='listbox']">
     <xsl:variable name="selected" select="xf:value"/>
     <select name="{@ref}">
       <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">
             <xsl:attribute name="selected"/>
           </xsl:if>
           <xsl:value-of select="xf:caption"/>
         </option>
       </xsl:for-each>
     </select>  
   </xsl:template>

   
   <xsl:template match="xf:selectMany[@selectUIType='checkbox']">
        <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}">
                <xsl:copy-of select="@*[not(name()='ref')]"/>
                <xsl:if test="xf:value = $selected">
                  <xsl:attribute name="checked"/>
                </xsl:if>
            </input>
            <xsl:value-of select="xf:caption"/>
            <br/>
        </xsl:for-each>
   </xsl:template>

   
   
   <xsl:template match="xf:submit">
       <!-- the id attribute of the submit control is sent to the server -->
       <!-- as a conventional Cocoon Action parameter of the form cocoon-action-* -->
      <input name="cocoon-action-{@id}" type="submit" value="{xf:caption/text()}">
        <xsl:copy-of select="@*[not(name()='id')]"/>
        <xsl:apply-templates select="xf:hint"/>
      </input>
   </xsl:template>
   
   <xsl:template match="xf:hint">
          <xsl:attribute name="title"><xsl:value-of select="."/></xsl:attribute>
   </xsl:template>


   <!-- copy all the rest of the markup which is not recognized above -->
   <xsl:template match="*">
      <xsl:copy><xsl:copy-of select="@*" /><xsl:apply-templates /></xsl:copy>
   </xsl:template>

   <xsl:template match="text()">
      <xsl:value-of select="." />
   </xsl:template>

</xsl:stylesheet>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to