Indeed, that's what I thought, it is FIXED...  I fixed it a while ago, if you 
looked at sxml.tcl svn log... the regexp changes the < > 
into { and } in order to make it into a list, what remains is the starting and 
ending { } which is why we do a foreach on "{$xml}" 
if you do it, your xml :
<test> blabla </test>
becomes :
test} {} {{#text blabla} 
so "{$xml}" becomes
{test} {} {{#text blabla}}
but [list $xml] becomes :
test\} \{\} \{\{#text blabla\}

the reason the bug existed and you still have it in your test app below, is 
because you used ONE regexp, while there are TWO regexps.. you 
need to first trim the string from all \r\t\n, etc... without it, the regexp 
creates a malformed list.. which caused the bug..
the original code (taken from trimmed all \t\n but they forgot \r 
.. and the xml we receive had a \r in it, which caused the 
bug... I fixed that a while ago..
this is why we shouldn't touch that code, it's really tricky...


On Mon, Sep 04, 2006 at 11:02:25PM +0200, Jonne Zutt wrote:
> Hi Youness,
> Here's the xml I obtained from a bug report.
> Did not want to mail it to devel because there are IP addresses in there.
> If you cannot fix it quickly, then perhaps let me have another look at it.
> I found more bugs in sxml.tcl already, no support for single quotes if i 
> remember correctly, and even more I believe. That's why I used a better 
> xml parser for that google calendar plugin. We could go that way as well 
> for amsn2, or use a nice python lib for it, guess we need that anyways. 
> Cannot wait before some decisions are made there ;)
> I'll check the bug now, because it had 32 wild reports, but I must have 
> changed
> something. I've seen it before that suddenly all linked bugs disappear, 
> don't know why, perhaps connection problems with sf? I noticed your code 
> with the statistics also failed, but didn't have time to figure it out 
> (connection problems too I guess).
> JeeBee.
> ---/tmp/foo.tcl---
> set input 
> set xml [string map {> "\} \{#text \{" < "\}\} \{"}  $input]
> puts "Input = $input"
> puts "XML = $xml"
> foreach item [list $xml] {
>  puts "Item: $item"
> }
> # foreach item "{$xml}" {
> #   puts "Item: $item"
> # }
> Youness Alaoui wrote:
> >Hey, sorry, I have to go now, I'll answer you when I get back... but don't 
> >modify any of that code... you'll find it on
> >also, your bug report has 0 reports linked to it... is it normal ? and can 
> >you give me an example of a failing XML ?
> >Thanks
> >
> >On Mon, Sep 04, 2006 at 03:33:20PM +0200, Jonne Zutt wrote:
> >  
> >>Oh ... found out it isn't necessary to reproduce because the failing xml
> >>code can be found in the status log of the bug reports.
> >>(where it says GOT XML: ....)
> >>
> >>On Mon, 2006-09-04 at 13:43 +0200, Jonne Zutt wrote:
> >>    
> >>>You are probably right. But I wouldn't know how to reproduce
> >>>the bug, so it's difficult to try out.
> >>>      

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
Amsn-devel mailing list

Reply via email to