cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject Re: FileWritingTransformer update
Date Sat, 23 Feb 2002 10:27:00 GMT
Jeremy Quinn wrote:
> Dear All,
> I am almost ready to commit a new version of FileWritingTransformer.
> There is a new experimental/demo file-editor called <slash-edit/>.

upload upload upload :)

> I updated the transformer to try and stop it overwriting files when there
> is an error. I now write into a temp file (which blocks) and rename it when
> done.

Yes, that's the good approach.

Question, do you handle collisions? I mean: what if two people write two
temp files at the same time? did you add timestamping to the temp-name?
> This does not stop the problem of catching invalid XML submitted in forms
> however.
> I am using the StreamGenerator to capture the edited XML from a whole file.
> When it's Parser finds non well formed XML, it throws a ProcessingException
> and the FileWritingTransformer does not get to know anything about it.
> Valid XML still gets happily written to disk, but missing everything after
> the faulty tag.
> The StreamGenerator could be modified, but I prefer the solution of writing
> a RequestParsingGenerator, that can selectively parse any number of form
> fields and won't throw ProcessorExceptions but encapsulate defective XML
> fields as  character data, with an error message in the Stream.
> Does this make sense?

Yes, it does.

Also, I've been experimenting with XML creation on the client side using
javascript and even if it's not difficult at all (XML can be very easy
stuff sometimes!), I think it's better not to expect things from the
client but do them on the server as much as possible.

> What I cannot work out is, would defective XML markup, passed down the
> stream as  character data, then transformed into a form to re-edit and fix,
> be real tags or would they be Entities by then?

Gosh, Jeremy, why do you always ask these difficult questions that I
can't find answers myself :-D

No, seriously, I think you've crashed into another big wall: XML

This is a *big* issue.

For example, what if the client editor was not form-based? we need some
more abstraction on this concept, I guess... but anyway, for now, just
something that works is ok, we'll proceed incrementally.
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<>                             Friedrich Nietzsche

To unsubscribe, e-mail:
For additional commands, email:

View raw message