You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Joerg Heinicke <jo...@gmx.de> on 2003/08/07 05:31:47 UTC

changes2document.xsl - handling multiple bugs in @fixes-bug

Sometimes we don't want to add an <action/>s for each bug fixed, so that
it would be cool to add more than one bug in @fixes-bug (e.g. comma
separated).

2 possibilities:
1. http://nagoya.apache.org/bugzilla/buglist.cgi?bug_id=111,222,333
2. one linke for each bug

Is there any interest?

The first and simple one I have applied as patch. I can implement the 
other one (using a recursive template) if that's prefered.

Regards,

Joerg

Re: changes2document.xsl - handling multiple bugs in @fixes-bug

Posted by Juan Jose Pablos <ch...@che-che.com>.
Jeff,

Jeff Turner wrote:
> 
> We can have a super-strict format, but then we need we need a
> super-strict format definition, ie. an XML schema that tells the user "no
> spaces allowed here".
> 
> Anyone feeling keen on RelaxNG? :)  Otherwise I'd suggest just zapping
> the spaces.

That is not even on the todo list.


Re: changes2document.xsl - handling multiple bugs in @fixes-bug

Posted by Jeff Turner <je...@apache.org>.
On Thu, Aug 07, 2003 at 02:22:40PM +0200, Juan Jose Pablos wrote:
> Joerg,
> 
> Joerg Heinicke wrote:
> >{translate(normalize-space(@fixes-bug), ' ', '')}
> >
> >So all whitespace characters (and so line breaks) are trimmed to spaces 
> >and these are removed afterwards.
> >
> 
> That was more or less the changed that I wanted, but I thought that the 
> root problem is actually in the source, so if think breaks the content 
> owner can fix it very easy just removing the spaces.
> 
> so should we fix that by allowing incorrect source format? (spaces on 
> the attrb.)

We can have a super-strict format, but then we need we need a
super-strict format definition, ie. an XML schema that tells the user "no
spaces allowed here".

Anyone feeling keen on RelaxNG? :)  Otherwise I'd suggest just zapping
the spaces.


--Jeff


> 
> Cheers,
> Cheche
> 

Re: changes2document.xsl - handling multiple bugs in @fixes-bug

Posted by Juan Jose Pablos <ch...@che-che.com>.
Joerg,

Joerg Heinicke wrote:
> {translate(normalize-space(@fixes-bug), ' ', '')}
> 
> So all whitespace characters (and so line breaks) are trimmed to spaces 
> and these are removed afterwards.
> 

That was more or less the changed that I wanted, but I thought that the 
root problem is actually in the source, so if think breaks the content 
owner can fix it very easy just removing the spaces.

so should we fix that by allowing incorrect source format? (spaces on 
the attrb.)

Cheers,
Cheche


Re: changes2document.xsl - handling multiple bugs in @fixes-bug

Posted by Joerg Heinicke <jo...@gmx.de>.
Furthermore I would leave the text for the link as it is (not removing 
the spaces, but normalizing is ok.

<link href="{$buglist}{translate(normalize-space(@fixes-bug), ' ', '')}">
   <xsl:text>bugs </xsl:text><xsl:value-of 
select="normalize-space(@fixes-bug)"/>
</link>

Joerg


Re: changes2document.xsl - handling multiple bugs in @fixes-bug

Posted by Joerg Heinicke <jo...@gmx.de>.
Juan Jose Pablos wrote:

> Joerg,
> 
>>
>> Ok, then let's stop it here :-) I only thought providing one option 
>> (',') and making this is error-save as possible is the best option.
>>
> 
> So if you do not think that using the bugzilla dependency is a option, 
> then we better get the normalize-space stuff in.

Of course it could be an option, but it is sometimes it bit too much I 
guess. Imagine, there are 3 bugs/patches for one Cocoon component you 
want to fix at once. Then it's simply easier to add these bugs to 
@fixes-bug instead of creating a new bug in bugzilla etc. And for a 
reader of the changes it's simpler to follow the links from the bug list 
instead of the dependencies of the created bug. Isn't it?

Thanks for your patience and discussion-willingness about such a minor 
issue. ;-)

Joerg


Re: changes2document.xsl - handling multiple bugs in @fixes-bug

Posted by Juan Jose Pablos <ch...@che-che.com>.
Joerg,

> 
> Ok, then let's stop it here :-) I only thought providing one option 
> (',') and making this is error-save as possible is the best option.
> 

So if you do not think that using the bugzilla dependency is a option, 
then we better get the normalize-space stuff in.

Cheers,
CheChe



Re: changes2document.xsl - handling multiple bugs in @fixes-bug

Posted by Joerg Heinicke <jo...@gmx.de>.
Juan Jose Pablos wrote:

> Joerg,
> 
> Joerg Heinicke wrote:
> 
>> Someone could have
>>
>> <action fixes-bug="1234, 2345,
>> 3456, 4567"/>
> 
> 
> I knew you would come with this!!!!, this I think that is very unlikely, 
>  as well you can have:
> 
> <action fixes-bug="1234;2345;3456;4567"/>
> 
> and it will fail as well.
> 
> They came by the fact that we want to allow multiple bugs in the 
> attribute instead of using multiple actions. Which makes me thing that 
> if would be easier to point just to a bug that has other bugs on its 
> dependencies.
> 
> Cheers,
> Cheche

Ok, then let's stop it here :-) I only thought providing one option 
(',') and making this is error-save as possible is the best option.

Joerg


Re: changes2document.xsl - handling multiple bugs in @fixes-bug

Posted by Juan Jose Pablos <ch...@che-che.com>.
Joerg,

Joerg Heinicke wrote:
> Someone could have
> 
> <action fixes-bug="1234, 2345,
> 3456, 4567"/>

I knew you would come with this!!!!, this I think that is very unlikely, 
  as well you can have:

<action fixes-bug="1234;2345;3456;4567"/>

and it will fail as well.

They came by the fact that we want to allow multiple bugs in the 
attribute instead of using multiple actions. Which makes me thing that 
if would be easier to point just to a bug that has other bugs on its 
dependencies.

Cheers,
Cheche

> 
> Line breaks and other whitespace characters than simple spaces are not 
> removed by translate. Trimming them to a space is the simplest solution.
> 
> Joerg
> 
> Juan Jose Pablos wrote:
> 
>> Joerg,
>>
>> Done it, but without the normalize-spcae funtion, Why do you want to 
>> normalize something that is going to be removed?
>>
>> Cheers,
>> Cheche
>>
>>
>> Joerg Heinicke wrote:
>>
>>> Ah, bugzilla is the problem. At least it works with the spaces. But 
>>> of course you can change
>>>
>>> {@fixes-bug}
>>>
>>> to
>>>
>>> {translate(normalize-space(@fixes-bug), ' ', '')}
>>>
>>> So all whitespace characters (and so line breaks) are trimmed to 
>>> spaces and these are removed afterwards.
>>>
>>> Joerg



Re: changes2document.xsl - handling multiple bugs in @fixes-bug

Posted by Joerg Heinicke <jo...@gmx.de>.
Someone could have

<action fixes-bug="1234, 2345,
3456, 4567"/>

Line breaks and other whitespace characters than simple spaces are not 
removed by translate. Trimming them to a space is the simplest solution.

Joerg

Juan Jose Pablos wrote:

> Joerg,
> 
> Done it, but without the normalize-spcae funtion, Why do you want to 
> normalize something that is going to be removed?
> 
> Cheers,
> Cheche
> 
> 
> Joerg Heinicke wrote:
> 
>> Ah, bugzilla is the problem. At least it works with the spaces. But of 
>> course you can change
>>
>> {@fixes-bug}
>>
>> to
>>
>> {translate(normalize-space(@fixes-bug), ' ', '')}
>>
>> So all whitespace characters (and so line breaks) are trimmed to 
>> spaces and these are removed afterwards.
>>
>> Joerg


Re: changes2document.xsl - handling multiple bugs in @fixes-bug

Posted by Juan Jose Pablos <ch...@che-che.com>.
Joerg,

Done it, but without the normalize-spcae funtion, Why do you want to 
normalize something that is going to be removed?

Cheers,
Cheche


Joerg Heinicke wrote:
> Ah, bugzilla is the problem. At least it works with the spaces. But of 
> course you can change
> 
> {@fixes-bug}
> 
> to
> 
> {translate(normalize-space(@fixes-bug), ' ', '')}
> 
> So all whitespace characters (and so line breaks) are trimmed to spaces 
> and these are removed afterwards.
> 
> Joerg
> 
> Juan Jose Pablos wrote:
> 
>> Joerg,
>>
>> Even if the serializer handle the space, bugzilla expected to get a 
>> list without spaces right?
>>
>> OK, it does not matter much because the problem is on the data, it 
>> should not have spaces in the first place.
>>
>> Cheers,
>> Cheche
>>
>> Joerg Heinicke wrote:
>>
>>> Thanks. But shouldn't the serializer handle the spaces and transform 
>>> them to %20 in a URL? And for the Cocoon 2.1 changes.html I created 
>>> with latest stable Forrest the code looks like:
>>>
>>> <a 
>>> href="http://nagoya.apache.org/bugzilla/buglist.cgi?bug_id=21931,%2022173">bugs 
>>> 21931, 22173</a>
>>>
>>> So everything ok I guess :-)
>>>
>>> Joerg
> 
> 
> 



Re: changes2document.xsl - handling multiple bugs in @fixes-bug

Posted by Joerg Heinicke <jo...@gmx.de>.
Ah, bugzilla is the problem. At least it works with the spaces. But of 
course you can change

{@fixes-bug}

to

{translate(normalize-space(@fixes-bug), ' ', '')}

So all whitespace characters (and so line breaks) are trimmed to spaces 
and these are removed afterwards.

Joerg

Juan Jose Pablos wrote:

> Joerg,
> 
> Even if the serializer handle the space, bugzilla expected to get a list 
> without spaces right?
> 
> OK, it does not matter much because the problem is on the data, it 
> should not have spaces in the first place.
> 
> Cheers,
> Cheche
> 
> Joerg Heinicke wrote:
> 
>> Thanks. But shouldn't the serializer handle the spaces and transform 
>> them to %20 in a URL? And for the Cocoon 2.1 changes.html I created 
>> with latest stable Forrest the code looks like:
>>
>> <a 
>> href="http://nagoya.apache.org/bugzilla/buglist.cgi?bug_id=21931,%2022173">bugs 
>> 21931, 22173</a>
>>
>> So everything ok I guess :-)
>>
>> Joerg


Re: changes2document.xsl - handling multiple bugs in @fixes-bug

Posted by Juan Jose Pablos <ch...@che-che.com>.
Joerg,

Even if the serializer handle the space, bugzilla expected to get a list 
without spaces right?

OK, it does not matter much because the problem is on the data, it 
should not have spaces in the first place.

Cheers,
Cheche

Joerg Heinicke wrote:
> Thanks. But shouldn't the serializer handle the spaces and transform 
> them to %20 in a URL? And for the Cocoon 2.1 changes.html I created with 
> latest stable Forrest the code looks like:
> 
> <a 
> href="http://nagoya.apache.org/bugzilla/buglist.cgi?bug_id=21931,%2022173">bugs 
> 21931, 22173</a>
> 
> So everything ok I guess :-)
> 
> Joerg
> 
> Juan Jose Pablos wrote:
> 
>> Joerg,
>>
>> Added to CVS, But spaces on bug fixes produce a wrong url.
>>
>> I can fix that, But I think that is the users responsability to add 
>> content properly.
>>
>> Cheers,
>> Cheche
>>
>> Joerg Heinicke wrote:
>>
>>> Sometimes we don't want to add an <action/>s for each bug fixed, so that
>>> it would be cool to add more than one bug in @fixes-bug (e.g. comma
>>> separated).
>>>
>>> 2 possibilities:
>>> 1. http://nagoya.apache.org/bugzilla/buglist.cgi?bug_id=111,222,333
>>> 2. one linke for each bug
>>>
>>> Is there any interest?
>>>
>>> The first and simple one I have applied as patch. I can implement the 
>>> other one (using a recursive template) if that's prefered.
>>>
>>> Regards,
>>>
>>> Joerg



Re: changes2document.xsl - handling multiple bugs in @fixes-bug

Posted by Joerg Heinicke <jo...@gmx.de>.
Thanks. But shouldn't the serializer handle the spaces and transform 
them to %20 in a URL? And for the Cocoon 2.1 changes.html I created with 
latest stable Forrest the code looks like:

<a 
href="http://nagoya.apache.org/bugzilla/buglist.cgi?bug_id=21931,%2022173">bugs 
21931, 22173</a>

So everything ok I guess :-)

Joerg

Juan Jose Pablos wrote:

> Joerg,
> 
> Added to CVS, But spaces on bug fixes produce a wrong url.
> 
> I can fix that, But I think that is the users responsability to add 
> content properly.
> 
> Cheers,
> Cheche
> 
> Joerg Heinicke wrote:
> 
>> Sometimes we don't want to add an <action/>s for each bug fixed, so that
>> it would be cool to add more than one bug in @fixes-bug (e.g. comma
>> separated).
>>
>> 2 possibilities:
>> 1. http://nagoya.apache.org/bugzilla/buglist.cgi?bug_id=111,222,333
>> 2. one linke for each bug
>>
>> Is there any interest?
>>
>> The first and simple one I have applied as patch. I can implement the 
>> other one (using a recursive template) if that's prefered.
>>
>> Regards,
>>
>> Joerg


Re: changes2document.xsl - handling multiple bugs in @fixes-bug

Posted by Juan Jose Pablos <ch...@che-che.com>.
Joerg,

Added to CVS, But spaces on bug fixes produce a wrong url.

I can fix that, But I think that is the users responsability to add 
content properly.

Cheers,
Cheche

Joerg Heinicke wrote:
> Sometimes we don't want to add an <action/>s for each bug fixed, so that
> it would be cool to add more than one bug in @fixes-bug (e.g. comma
> separated).
> 
> 2 possibilities:
> 1. http://nagoya.apache.org/bugzilla/buglist.cgi?bug_id=111,222,333
> 2. one linke for each bug
> 
> Is there any interest?
> 
> The first and simple one I have applied as patch. I can implement the 
> other one (using a recursive template) if that's prefered.
> 
> Regards,
> 
> Joerg
> 
> 
> ------------------------------------------------------------------------
> 
> cvs -z3 -q diff -u changes2document.xsl (in directory D:\xml-forrest\src\resources\stylesheets\)
> Index: changes2document.xsl
> ===================================================================
> RCS file: /home/cvs/xml-forrest/src/resources/stylesheets/changes2document.xsl,v
> retrieving revision 1.12
> diff -u -r1.12 changes2document.xsl
> --- changes2document.xsl	12 Feb 2003 04:58:14 -0000	1.12
> +++ changes2document.xsl	7 Aug 2003 03:16:52 -0000
> @@ -6,7 +6,9 @@
> 
>   <xsl:import href="copyover.xsl"/>
> 
> - <xsl:variable name="bugzilla">http://nagoya.apache.org/bugzilla/show_bug.cgi?id=</xsl:variable>
> + <xsl:variable name="bugzilla" select="'http://nagoya.apache.org/bugzilla/'"/>
> + <xsl:variable name="singleBug" select="concat($bugzilla, 'show_bug.cgi?id=')"/>
> + <xsl:variable name="buglist" select="concat($bugzilla, 'buglist.cgi?bug_id=')"/>
> 
>   <xsl:template match="/">
>    <xsl:apply-templates select="//changes"/>
> @@ -56,9 +58,18 @@
> 
>     <xsl:if test="@fixes-bug">
>      <xsl:text> Fixes </xsl:text>
> -    <link href="{$bugzilla}{@fixes-bug}">
> -     <xsl:text>bug </xsl:text><xsl:value-of select="@fixes-bug"/>
> -    </link>
> +    <xsl:choose>
> +     <xsl:when test="contains(@fixes-bug, ',')">
> +      <link href="{$buglist}{@fixes-bug}">
> +       <xsl:text>bugs </xsl:text><xsl:value-of select="@fixes-bug"/>
> +      </link>
> +     </xsl:when>
> +     <xsl:otherwise>
> +      <link href="{$singleBug}{@fixes-bug}">
> +       <xsl:text>bug </xsl:text><xsl:value-of select="@fixes-bug"/>
> +      </link>
> +     </xsl:otherwise>
> +    </xsl:choose>
>      <xsl:text>.</xsl:text>
>     </xsl:if>
>    </li>