You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Steve Schwarz <sa...@hotmail.com> on 2003/08/09 18:50:52 UTC
SimpleFormTransformer - invalid XML generated?
Hi
I'm using SimpleFormTransformer to process the results of
FormValidatorAction and I am getting invalid xml generated after applying
the transformation. It looks like when <error> elements are removed from
within surrounding <td> elements I end up with an empty element <td/>
followed by a closing element </td>.
My input file:
...
form name="contact" method="post" enctype="multipart/form-data"
action="contact-add">
<h2 align="center">Enter New Contact Information</h2>
<table align="center">
<tr><td title="Mr, Mrs, Miss, Mme">Honorific:</td><td><input type="text"
cols="32" name="contact.honorific"/></td><td><error name="honorific"
when="error">An <strong>error</strong> occurred.</error></td></tr>
...
When I submit the form with valid input for the "contact.honorific" input
the "raw" output taken after the simpleform transformation:
...
<form name="contact" method="post" enctype="multipart/form-data"
action="contact-add">
<h2 align="center">Enter New Contact Information</h2>
<table align="center">
<tr><td title="Mr, Mrs, Miss, Mme">Honorific:</td><td><input type="text"
cols="32" name="contact.honorific"/></td><td/></td></tr>
...
If all the fields fail validation the form is generated correctly (?):
...
<form name="contact" method="post" enctype="multipart/form-data"
action="contact-add">
<h2 align="center">Enter New Contact Information</h2>
<table align="center"><tr><td title="Mr, Mrs, Miss,
Mme">Honorific:</td><td><input type="text" cols="32"
name="contact.honorific"></td><td><error name="honorific" when-ge="error">An
<strong>error</strong> occurred.</error></td></tr>
...
I'm using 2.0.4 but I diffed the SimpleFormTransformer source against 2.1
and didn't see any obvious differences related to this..(??) Do I need to
specify some config/pipeline parameters to resolve this?
I also have a dumb question:
What is the difference between using: <error when-ge="error" ...> and <error
when="error" ...> ?
Any help would be greatly appreciated!
Thanks
Steve
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: SimpleFormTransformer - invalid XML generated?
Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 09.Aug.2003 -- 04:50 PM, Steve Schwarz wrote:
> Hi
> I'm using SimpleFormTransformer to process the results of
> FormValidatorAction and I am getting invalid xml generated after applying
> the transformation. It looks like when <error> elements are removed from
> within surrounding <td> elements I end up with an empty element <td/>
> followed by a closing element </td>.
In 2.0.x there are a number of issues with this transformer. I believe
all are solved in 2.1. Please upgrade and report back.
(I believe the fixes are not in 2.0.5)
> I'm using 2.0.4 but I diffed the SimpleFormTransformer source against 2.1
> and didn't see any obvious differences related to this..(??) Do I need to
> specify some config/pipeline parameters to resolve this?
see above.
> I also have a dumb question:
> What is the difference between using: <error when-ge="error" ...> and
> <error when="error" ...> ?
The former is displayed when the result is "error" or worse (when-ge translates
to "when greater or equal") while the latter is displayed _only_ in case of
"error" e.g. not when it is "too_small".
Chris.
--
C h r i s t i a n H a u l
haul@informatik.tu-darmstadt.de
fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org