You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Carsten Ziegeler <cz...@s-und-n.de> on 2004/08/11 10:03:12 UTC

[BUG] JXTG/JXTT eats backslashes

I just found another "nice feature" of the JXTG/JXTT. It eats
backslashed out of your text! For example, if you read this XML
by the JXTG:

<txt>\ha\llo</txt>

The resulting XML is:

<txt>hallo</txt>

This feature is very nice if you use forms with fields that can
contain backslashed and you're running the JXTG after the
forms transformer!

Anyways, the TextEvent subclass has a special handling for backslashes:
if (c == '\\') {
    ch = in.read();
    if (ch == -1) {
        buf.append('\\');
    } else {
        buf.append((char)ch);
    }
}

I don't see any real sense in this (note that backslashes at the end
are not removed).

If noone objects, I will remove this special handling.

Carsten 

Carsten Ziegeler 
Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.net/weblogs/rael/


RE: [BUG] JXTG/JXTT eats backslashes

Posted by Antonio Gallardo <ag...@agssa.net>.
OK. So lets try to "fix" it and we will see what happened. I cannot
remember why it is there. If a problem will be raised we can fix it later.

Best Regards,

Antonio Gallardo

Carsten Ziegeler dijo:
>
> Antonio Gallardo wrote:
>>
>> Hi Carsten:
>>
>> I am not sure why we escape the chars in this way. I think it
>> is part of the jexl convention, but don't believe me.
>>
> Hmm, what do you exactly mean? The chars are not escaped, but
> the backslash is simply removed.
> Or do you mean that e.g. jexl would fail if a backslash
> is in an expression?
>
> Carsten
>
>>
>> Carsten Ziegeler dijo:
>> > I just found another "nice feature" of the JXTG/JXTT. It eats
>> > backslashed out of your text! For example, if you read this
>> XML by the
>> > JXTG:
>> >
>> > <txt>\ha\llo</txt>
>> >
>> > The resulting XML is:
>> >
>> > <txt>hallo</txt>
>> >
>> > This feature is very nice if you use forms with fields that can
>> > contain backslashed and you're running the JXTG after the forms
>> > transformer!
>> >
>> > Anyways, the TextEvent subclass has a special handling for
>> backslashes:
>> > if (c == '\\') {
>> >     ch = in.read();
>> >     if (ch == -1) {
>> >         buf.append('\\');
>> >     } else {
>> >         buf.append((char)ch);
>> >     }
>> > }
>> >
>> > I don't see any real sense in this (note that backslashes
>> at the end
>> > are not removed).
>> >
>> > If noone objects, I will remove this special handling.
>> >
>> > Carsten
>> >
>> > Carsten Ziegeler
>> > Open Source Group, S&N AG
>> > http://www.s-und-n.de
>> > http://www.osoco.net/weblogs/rael/
>> >
>>
>


RE: [BUG] JXTG/JXTT eats backslashes

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
 
Antonio Gallardo wrote:
> 
> Hi Carsten:
> 
> I am not sure why we escape the chars in this way. I think it 
> is part of the jexl convention, but don't believe me.
> 
Hmm, what do you exactly mean? The chars are not escaped, but
the backslash is simply removed.
Or do you mean that e.g. jexl would fail if a backslash
is in an expression?

Carsten

> 
> Carsten Ziegeler dijo:
> > I just found another "nice feature" of the JXTG/JXTT. It eats 
> > backslashed out of your text! For example, if you read this 
> XML by the 
> > JXTG:
> >
> > <txt>\ha\llo</txt>
> >
> > The resulting XML is:
> >
> > <txt>hallo</txt>
> >
> > This feature is very nice if you use forms with fields that can 
> > contain backslashed and you're running the JXTG after the forms 
> > transformer!
> >
> > Anyways, the TextEvent subclass has a special handling for 
> backslashes:
> > if (c == '\\') {
> >     ch = in.read();
> >     if (ch == -1) {
> >         buf.append('\\');
> >     } else {
> >         buf.append((char)ch);
> >     }
> > }
> >
> > I don't see any real sense in this (note that backslashes 
> at the end 
> > are not removed).
> >
> > If noone objects, I will remove this special handling.
> >
> > Carsten
> >
> > Carsten Ziegeler
> > Open Source Group, S&N AG
> > http://www.s-und-n.de
> > http://www.osoco.net/weblogs/rael/
> >
> 


Re: [BUG] JXTG/JXTT eats backslashes

Posted by Antonio Gallardo <ag...@agssa.net>.
Hi Carsten:

I am not sure why we escape the chars in this way. I think it is part of
the jexl convention, but don't believe me.

Best Regards,

Antonio Gallardo

Carsten Ziegeler dijo:
> I just found another "nice feature" of the JXTG/JXTT. It eats
> backslashed out of your text! For example, if you read this XML
> by the JXTG:
>
> <txt>\ha\llo</txt>
>
> The resulting XML is:
>
> <txt>hallo</txt>
>
> This feature is very nice if you use forms with fields that can
> contain backslashed and you're running the JXTG after the
> forms transformer!
>
> Anyways, the TextEvent subclass has a special handling for backslashes:
> if (c == '\\') {
>     ch = in.read();
>     if (ch == -1) {
>         buf.append('\\');
>     } else {
>         buf.append((char)ch);
>     }
> }
>
> I don't see any real sense in this (note that backslashes at the end
> are not removed).
>
> If noone objects, I will remove this special handling.
>
> Carsten
>
> Carsten Ziegeler
> Open Source Group, S&N AG
> http://www.s-und-n.de
> http://www.osoco.net/weblogs/rael/
>


RE: [BUG] JXTG/JXTT eats backslashes

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Antonio Gallardo wrote: 
> 
> Carsten Ziegeler dijo:
> > Ignore this. This is a bug of 2.1.5.1; it's already fixed 
> in trunk and 
> > branch... :(
> 
> Here is the link:
> 
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27133
> 
> I wonder why so much changes are not on the 2.1.5.1 branch.
> 
It is in the 2.1.x branch, but not in the 2.1.5.1 release.

Carsten


RE: [BUG] JXTG/JXTT eats backslashes

Posted by Antonio Gallardo <ag...@agssa.net>.
Carsten Ziegeler dijo:
> Ignore this. This is a bug of 2.1.5.1; it's already fixed in trunk and
> branch... :(

Here is the link:

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27133

I wonder why so much changes are not on the 2.1.5.1 branch.

Best Regards,

Antonio Gallardo


RE: [BUG] JXTG/JXTT eats backslashes

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Sorry, haven't noticed :(

Carsten 

> -----Original Message-----
> From: Antonio Gallardo [mailto:agallardo@agssa.net] 
> Sent: Wednesday, August 11, 2004 5:10 PM
> To: dev@cocoon.apache.org
> Subject: RE: [BUG] JXTG/JXTT eats backslashes
> 
> Carsten Ziegeler dijo:
> > Ignore this. This is a bug of 2.1.5.1; it's already fixed 
> in trunk and 
> > branch... :(
> 
> I told you. I remember I fixed this. In fact there was a 
> bugzilla report.....
> 
> Best Regards,
> 
> Antonio Gallardo
> >
> > Carsten
> >
> >> -----Original Message-----
> >> From: Carsten Ziegeler [mailto:cziegeler@s-und-n.de]
> >> Sent: Wednesday, August 11, 2004 10:03 AM
> >> To: Cocoon-Dev
> >> Subject: [BUG] JXTG/JXTT eats backslashes
> >>
> >> I just found another "nice feature" of the JXTG/JXTT. It eats 
> >> backslashed out of your text! For example, if you read this XML by 
> >> the JXTG:
> >>
> >> <txt>\ha\llo</txt>
> >>
> >> The resulting XML is:
> >>
> >> <txt>hallo</txt>
> >>
> >> This feature is very nice if you use forms with fields that can 
> >> contain backslashed and you're running the JXTG after the forms 
> >> transformer!
> >>
> >> Anyways, the TextEvent subclass has a special handling for
> >> backslashes:
> >> if (c == '\\') {
> >>     ch = in.read();
> >>     if (ch == -1) {
> >>         buf.append('\\');
> >>     } else {
> >>         buf.append((char)ch);
> >>     }
> >> }
> >>
> >> I don't see any real sense in this (note that backslashes 
> at the end 
> >> are not removed).
> >>
> >> If noone objects, I will remove this special handling.
> >>
> >> Carsten
> >>
> >> Carsten Ziegeler
> >> Open Source Group, S&N AG
> >> http://www.s-und-n.de
> >> http://www.osoco.net/weblogs/rael/
> >>
> >
> 


RE: [BUG] JXTG/JXTT eats backslashes

Posted by Antonio Gallardo <ag...@agssa.net>.
Carsten Ziegeler dijo:
> Ignore this. This is a bug of 2.1.5.1; it's already fixed in trunk and
> branch... :(

I told you. I remember I fixed this. In fact there was a bugzilla report.....

Best Regards,

Antonio Gallardo
>
> Carsten
>
>> -----Original Message-----
>> From: Carsten Ziegeler [mailto:cziegeler@s-und-n.de]
>> Sent: Wednesday, August 11, 2004 10:03 AM
>> To: Cocoon-Dev
>> Subject: [BUG] JXTG/JXTT eats backslashes
>>
>> I just found another "nice feature" of the JXTG/JXTT. It eats
>> backslashed out of your text! For example, if you read this
>> XML by the JXTG:
>>
>> <txt>\ha\llo</txt>
>>
>> The resulting XML is:
>>
>> <txt>hallo</txt>
>>
>> This feature is very nice if you use forms with fields that
>> can contain backslashed and you're running the JXTG after the
>> forms transformer!
>>
>> Anyways, the TextEvent subclass has a special handling for
>> backslashes:
>> if (c == '\\') {
>>     ch = in.read();
>>     if (ch == -1) {
>>         buf.append('\\');
>>     } else {
>>         buf.append((char)ch);
>>     }
>> }
>>
>> I don't see any real sense in this (note that backslashes at
>> the end are not removed).
>>
>> If noone objects, I will remove this special handling.
>>
>> Carsten
>>
>> Carsten Ziegeler
>> Open Source Group, S&N AG
>> http://www.s-und-n.de
>> http://www.osoco.net/weblogs/rael/
>>
>


RE: [BUG] JXTG/JXTT eats backslashes

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Ignore this. This is a bug of 2.1.5.1; it's already fixed in trunk and
branch... :(

Carsten 

> -----Original Message-----
> From: Carsten Ziegeler [mailto:cziegeler@s-und-n.de] 
> Sent: Wednesday, August 11, 2004 10:03 AM
> To: Cocoon-Dev
> Subject: [BUG] JXTG/JXTT eats backslashes
> 
> I just found another "nice feature" of the JXTG/JXTT. It eats 
> backslashed out of your text! For example, if you read this 
> XML by the JXTG:
> 
> <txt>\ha\llo</txt>
> 
> The resulting XML is:
> 
> <txt>hallo</txt>
> 
> This feature is very nice if you use forms with fields that 
> can contain backslashed and you're running the JXTG after the 
> forms transformer!
> 
> Anyways, the TextEvent subclass has a special handling for 
> backslashes:
> if (c == '\\') {
>     ch = in.read();
>     if (ch == -1) {
>         buf.append('\\');
>     } else {
>         buf.append((char)ch);
>     }
> }
> 
> I don't see any real sense in this (note that backslashes at 
> the end are not removed).
> 
> If noone objects, I will remove this special handling.
> 
> Carsten 
> 
> Carsten Ziegeler
> Open Source Group, S&N AG
> http://www.s-und-n.de
> http://www.osoco.net/weblogs/rael/
>