You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Bruno Dumon <br...@outerthought.org> on 2004/03/17 19:11:04 UTC

Re: DO NOT REPLY [Bug 27600] - syntax for unique rows in repeater binding

On Mon, 2004-03-15 at 20:51, Joerg Heinicke wrote:
> On 15.03.2004 17:57, bugzilla@apache.org wrote:
> 
> > http://issues.apache.org/bugzilla/show_bug.cgi?id=27600
> > 
> > syntax for unique rows in repeater binding
> > 
> > ------- Additional Comments From tek@leonid.de  2004-03-15 16:57 -------
> > More and more I doubt that this might be the way to go, chasing any kind of
> > xml-file though the XSLT processor  to update some minor syntax changes in
> > repeater binding. I bet there only few users need do update only a few files. I
> > think it's not worth the risk. I'm quite sure there are still more uncoverd
> > issues in connection to the XSLT processing of unpredictable user files. While
> > we don't have a solution, I think we should disable the automatic update feature.
> 
> Ok, asking the list: in which way shall we handle the update in the 
> repeater syntax? The problem is that through an XSLT process the DOCTYPE 
> must get lost, no chance to save it. I don't find it that problematic as 
> no Woody file does have a DTD, but of course users can have added their 
> own ones.
> 
> a) Ignore the problems (removal of DOCTYPE).
> 
> b) Point out the possible problem before asking the user for the 
> src.dir. The user will probably have to start the update process 
> multiple times for specifying deeper directory hierarchies to avoid 
> touching unrelated files (or we provide a loop).
> 
> c) Let him specify a binding.dir or patternset explicitely (binding 
> files are the only files that must be processed by an XSLT at the moment).
> 
> d) Do not handle the syntax change automatically at all.

e) Use a text-based search and replace. This preserves the layout of the
XML (which I consider to be rather important since these files are
mostly hand-edited).

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Re: DO NOT REPLY [Bug 27600] - syntax for unique rows in repeater binding

Posted by leo leonid <te...@leonid.de>.
On Mar 17, 2004, at 7:11 PM, Bruno Dumon wrote:

> On Mon, 2004-03-15 at 20:51, Joerg Heinicke wrote:
>> On 15.03.2004 17:57, bugzilla@apache.org wrote:
>>
>>> http://issues.apache.org/bugzilla/show_bug.cgi?id=27600
>>>
>>> syntax for unique rows in repeater binding
>>>
>>> ------- Additional Comments From tek@leonid.de  2004-03-15 16:57 
>>> -------
>>> More and more I doubt that this might be the way to go, chasing any 
>>> kind of
>>> xml-file though the XSLT processor  to update some minor syntax 
>>> changes in
>>> repeater binding. I bet there only few users need do update only a 
>>> few files. I
>>> think it's not worth the risk. I'm quite sure there are still more 
>>> uncoverd
>>> issues in connection to the XSLT processing of unpredictable user 
>>> files. While
>>> we don't have a solution, I think we should disable the automatic 
>>> update feature.
>>
>> Ok, asking the list: in which way shall we handle the update in the
>> repeater syntax? The problem is that through an XSLT process the 
>> DOCTYPE
>> must get lost, no chance to save it. I don't find it that problematic 
>> as
>> no Woody file does have a DTD, but of course users can have added 
>> their
>> own ones.
>>
>> a) Ignore the problems (removal of DOCTYPE).
>>
>> b) Point out the possible problem before asking the user for the
>> src.dir. The user will probably have to start the update process
>> multiple times for specifying deeper directory hierarchies to avoid
>> touching unrelated files (or we provide a loop).
>>
>> c) Let him specify a binding.dir or patternset explicitely (binding
>> files are the only files that must be processed by an XSLT at the 
>> moment).
>>
>> d) Do not handle the syntax change automatically at all.
>
> e) Use a text-based search and replace. This preserves the layout of 
> the
> XML (which I consider to be rather important since these files are
> mostly hand-edited).

+1 for e) With this approach whitespace can be preserved, too. (<tag/> 
!= <tag />)


Re: DO NOT REPLY [Bug 27600] - syntax for unique rows in repeater binding

Posted by Joerg Heinicke <jo...@gmx.de>.
On 17.03.2004 22:53, Bruno Dumon wrote:

>>The layout of the XML is also preserved by the stylesheet as everything 
>>in the source is copied to the output. Xalan only removes whitespaces 
>>outside of the root element.
> 
> I would be suprised if Xalan keeps the order of attributes, let alone
> the whitespace between them.

That's true of course as they make no difference in XML.

> But no XML parsing solution I know of keeps
> that information, so the users will just have to live with it. Either
> they choose for the automated conversion with the annoyance that some
> things might be rearranged, or they do the conversion manually.

I will change the target appropriately.

Joerg

Re: DO NOT REPLY [Bug 27600] - syntax for unique rows in repeater binding

Posted by Bruno Dumon <br...@outerthought.org>.
On Wed, 2004-03-17 at 20:54, Joerg Heinicke wrote:
> On 17.03.2004 19:11, Bruno Dumon wrote:
> 
> >>Ok, asking the list: in which way shall we handle the update in the 
> >>repeater syntax?
> 
> > e) Use a text-based search and replace. This preserves the layout of the
> > XML (which I consider to be rather important since these files are
> > mostly hand-edited).
> 
> I saw how easy this was for replacing the namespaces, but how shall this 
> work for replacing attributes with child elements? Have a look at the 
> stylesheet tools/src/cforms-repeater-syntax.xsl for the logic I use at 
> the moment. Even if you remove the handling of the short time 
> intermediate wb:unique-row: is this really doable through search and 
> replace?

Didn't know about that, that won't work indeed.

> 
> The layout of the XML is also preserved by the stylesheet as everything 
> in the source is copied to the output. Xalan only removes whitespaces 
> outside of the root element.

I would be suprised if Xalan keeps the order of attributes, let alone
the whitespace between them. But no XML parsing solution I know of keeps
that information, so the users will just have to live with it. Either
they choose for the automated conversion with the annoyance that some
things might be rearranged, or they do the conversion manually.

> 
> Try it yourself by just hitting 'Enter' on all questions, the replacing 
> is tested on the Woody block sources and copied to 
> build/woody2cforms_timestamp.
> 
> Joerg
-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Re: DO NOT REPLY [Bug 27600] - syntax for unique rows in repeater binding

Posted by Joerg Heinicke <jo...@gmx.de>.
On 17.03.2004 19:11, Bruno Dumon wrote:

>>Ok, asking the list: in which way shall we handle the update in the 
>>repeater syntax?

> e) Use a text-based search and replace. This preserves the layout of the
> XML (which I consider to be rather important since these files are
> mostly hand-edited).

I saw how easy this was for replacing the namespaces, but how shall this 
work for replacing attributes with child elements? Have a look at the 
stylesheet tools/src/cforms-repeater-syntax.xsl for the logic I use at 
the moment. Even if you remove the handling of the short time 
intermediate wb:unique-row: is this really doable through search and 
replace?

The layout of the XML is also preserved by the stylesheet as everything 
in the source is copied to the output. Xalan only removes whitespaces 
outside of the root element.

Try it yourself by just hitting 'Enter' on all questions, the replacing 
is tested on the Woody block sources and copied to 
build/woody2cforms_timestamp.

Joerg