XML Parser bug ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

XML Parser bug ?

BrunoBB
Hi,

While migrating from GS 3.29 to GS 3.3 i have a couple of test that are failing on 3.3.

GS 3.29 - xml parser monty.330
GS 3.3 - xml parser monty.354

These XML parser answer a different result for the same operations and this is causing my tests to fail.

For example:
(XMLDOMParser parse:
'<imageAnnotation xmlns:xh="http://www.w3.org/1999/xhtml" 
xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ev="http://www.w3.org/2001/xml-events" 
xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
 xmlns:xxf="http://orbeon.org/oxf/xml/xforms" xmlns:exf="http://www.exforms.org/exf/1-0" 
xmlns:fr="http://orbeon.org/oxf/xml/form-runner" xmlns:saxon="http://saxon.sf.net/" 
xmlns:sql="http://orbeon.org/oxf/xml/sql" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:fb="http://orbeon.org/oxf/xml/form-builder">
<image filename="" mediatype="" size="" />
<annotation />
</imageAnnotation>') stringNodes.

In both cases is an empty collection but:
((XMLDOMParser parse:
'<imageAnnotation xmlns:xh="http://www.w3.org/1999/xhtml" 
xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ev="http://www.w3.org/2001/xml-events" 
xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
 xmlns:xxf="http://orbeon.org/oxf/xml/xforms" xmlns:exf="http://www.exforms.org/exf/1-0" 
xmlns:fr="http://orbeon.org/oxf/xml/form-runner" xmlns:saxon="http://saxon.sf.net/" 
xmlns:sql="http://orbeon.org/oxf/xml/sql" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:fb="http://orbeon.org/oxf/xml/form-builder">
<image filename="" mediatype="" size="" />
<annotation />
</imageAnnotation>')
xPath: 'imageAnnotation') collection last stringNodes

In GS 3.29 (monty.330) answer an empty XMLNodeList.
In GS 3.3 (monty.354) answer a XMLNodeList with 3 elements. (this causing my test to fail)

Any idea what is going on ? (i'm still investigating this issue)

regards,
bruno

Reply | Threaded
Open this post in threaded view
|

Re: XML Parser bug ?

GLASS mailing list


On 07/15/2016 09:53 AM, BrunoBB via Glass wrote:

> Hi,
>
> While migrating from GS 3.29 to GS 3.3 i have a couple of test that are
> failing on 3.3.
>
> GS 3.29 - xml parser monty.330
> GS 3.3 - xml parser monty.354
>
> These XML parser answer a different result for the same operations and this
> is causing my tests to fail.
>
> For example:
> (XMLDOMParser parse:
> '<imageAnnotation xmlns:xh="http://www.w3.org/1999/xhtml"
> xmlns:xf="http://www.w3.org/2002/xforms"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ev="http://www.w3.org/2001/xml-events"
> xmlns:xi="http://www.w3.org/2001/XInclude"
> xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
>   xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
> xmlns:exf="http://www.exforms.org/exf/1-0"
> xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
> xmlns:saxon="http://saxon.sf.net/"
> xmlns:sql="http://orbeon.org/oxf/xml/sql"
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:fb="http://orbeon.org/oxf/xml/form-builder">
> <image filename="" mediatype="" size="" />
> <annotation />
> </imageAnnotation>') stringNodes.
>
> In both cases is an empty collection but:
> ((XMLDOMParser parse:
> '<imageAnnotation xmlns:xh="http://www.w3.org/1999/xhtml"
> xmlns:xf="http://www.w3.org/2002/xforms"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ev="http://www.w3.org/2001/xml-events"
> xmlns:xi="http://www.w3.org/2001/XInclude"
> xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
>   xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
> xmlns:exf="http://www.exforms.org/exf/1-0"
> xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
> xmlns:saxon="http://saxon.sf.net/"
> xmlns:sql="http://orbeon.org/oxf/xml/sql"
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:fb="http://orbeon.org/oxf/xml/form-builder">
> <image filename="" mediatype="" size="" />
> <annotation />
> </imageAnnotation>')
> xPath: 'imageAnnotation') collection last stringNodes
>
> In GS 3.29 (monty.330) answer an empty XMLNodeList.
> In GS 3.3 (monty.354) answer a XMLNodeList with 3 elements. (this causing my
> test to fail)
>
Bruno,

It looks like you are using a different version of the XMLParser code.
If you are using tODE I would ask for the results of 'Window > print
window' for the project list and I could see at a glance what versions
of the different projects you are using ... without tODE it is painful
to describe ...

somewhere you have a dependency on the XMLParser code and for some
reason you are loading a different version of that project ... I haven't
worked with the XMLParser for years, so I don't even remember the name
of project or any of the details ....

Dale

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: XML Parser bug ?

GLASS mailing list


On 07/15/2016 11:19 AM, Dale Henrichs wrote:

>
>
> On 07/15/2016 09:53 AM, BrunoBB via Glass wrote:
>> Hi,
>>
>> While migrating from GS 3.29 to GS 3.3 i have a couple of test that are
>> failing on 3.3.
>>
>> GS 3.29 - xml parser monty.330
>> GS 3.3 - xml parser monty.354
>>
>> These XML parser answer a different result for the same operations
>> and this
>> is causing my tests to fail.
>>
>> For example:
>> (XMLDOMParser parse:
>> '<imageAnnotation xmlns:xh="http://www.w3.org/1999/xhtml"
>> xmlns:xf="http://www.w3.org/2002/xforms"
>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:ev="http://www.w3.org/2001/xml-events"
>> xmlns:xi="http://www.w3.org/2001/XInclude"
>> xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
>>   xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
>> xmlns:exf="http://www.exforms.org/exf/1-0"
>> xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
>> xmlns:saxon="http://saxon.sf.net/"
>> xmlns:sql="http://orbeon.org/oxf/xml/sql"
>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>> xmlns:fb="http://orbeon.org/oxf/xml/form-builder">
>> <image filename="" mediatype="" size="" />
>> <annotation />
>> </imageAnnotation>') stringNodes.
>>
>> In both cases is an empty collection but:
>> ((XMLDOMParser parse:
>> '<imageAnnotation xmlns:xh="http://www.w3.org/1999/xhtml"
>> xmlns:xf="http://www.w3.org/2002/xforms"
>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:ev="http://www.w3.org/2001/xml-events"
>> xmlns:xi="http://www.w3.org/2001/XInclude"
>> xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
>>   xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
>> xmlns:exf="http://www.exforms.org/exf/1-0"
>> xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
>> xmlns:saxon="http://saxon.sf.net/"
>> xmlns:sql="http://orbeon.org/oxf/xml/sql"
>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>> xmlns:fb="http://orbeon.org/oxf/xml/form-builder">
>> <image filename="" mediatype="" size="" />
>> <annotation />
>> </imageAnnotation>')
>> xPath: 'imageAnnotation') collection last stringNodes
>>
>> In GS 3.29 (monty.330) answer an empty XMLNodeList.
>> In GS 3.3 (monty.354) answer a XMLNodeList with 3 elements. (this
>> causing my
>> test to fail)
>>
> Bruno,
>
> It looks like you are using a different version of the XMLParser code.
> If you are using tODE I would ask for the results of 'Window > print
> window' for the project list and I could see at a glance what versions
> of the different projects you are using ... without tODE it is painful
> to describe ...
if you don't have tODE the Transcript of your load would be useful in
figuring out what you have loaded and it is probably not in your
Transcript window, but the Transcript is written to the object log ...
you'd have to write code to filter and print the object log (if you had
tOE there's some support for this built-in but if you have tODE I want
to see the project list to see what the difference between the two images

Dale
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: XML Parser bug ?

BrunoBB
In reply to this post by BrunoBB
Dale,

The problem is with the newer version of XMLParser.
((XMLDOMParser parse: '<imageAnnotation>
<image filename="" mediatype="" size=""/>
<annotation/>
</imageAnnotation>')
xPath: 'imageAnnotation')
collection last stringNodes.

((XMLDOMParser parse: '<imageAnnotation><image filename="" mediatype="" size=""/><annotation/></imageAnnotation>')
xPath: 'imageAnnotation')
collection last stringNodes

The xml string is the same in both cases but the result is different --> somehow the line delimiter is causing problems.

Here is the result (print window):
* AbstractApplicationObjects  510f80e [master]       github://brunobuzzi/AbstractApplicationObjects:master/repository
* Orbeon                      1.292 [release]        http://ss3.gemstone.com/ss/OrbeonBridge
* OrbeonBPM                   0.193 [release]        http://ss3.gemtalksystems.com/ss/OrbeonBPM
* OrbeonBpmWeb                0.171 [release]        http://ss3.gemtalksystems.com/ss/OrbeonBPM
* OrbeonPersistenceLayer      973e469 [master]       github://brunobuzzi/OrbeonPersistenceLayer:master/repository
* OrderPreservingDictionary   1.3.5 [release]        http://smalltalkhub.com/mc/PharoExtras/OrderPreservingDictionary/main
* Sewaf                       5f9b2dd [master]       github://brunobuzzi/SEWAF:master/repository
* XMLParser                   2.7.6 [release]        http://www.smalltalkhub.com/mc/PharoExtras/XMLParser/main
BpmFlow                       d136aad [master]       github://brunobuzzi/BpmFlow:master/repository
GsDevKit_home                 03d8efe [master]       $GS_HOME
BitmapCharacterSet            1.2.2 [release]        http://www.smalltalkhub.com/mc/PharoExtras/BitmapCharacterSet/main
FastCGI Project               0.237 [release]        http://seaside.gemtalksystems.com/ss/MetacelloRepository
|FileTree|                    263ef78 [gemstone2.4]  filetree:///home/gemstone/GsDevKit_home/shared/repos/filetree/repository
Gettext-Project               1.6.1 [baseline]       http://www.smalltalkhub.com/mc/PharoExtras/Gettext/main
|GLASS1|                      f72b9e6 [master]       filetree:///home/gemstone/GsDevKit_home/shared/repos/glass/repository
Gofer                         1.0.5.4 [release]      http://seaside.gemtalksystems.com/ss/metacello
|Grease|                      d9c9daa [master]       filetree:///home/gemstone/GsDevKit_home/shared/repos/Grease/repository
GsApplicationTools            898232b [master]       github://GsDevKit/gsApplicationTools:master/repository
|Metacello|                   b1678db [master]       filetree:///home/gemstone/GsDevKit_home/shared/repos/metacello-work/repository
OrbeonBizagiReader2           0-074                  http://ss3.gemtalksystems.com/ss/OrbeonBridge
OrbeonBPMXpdl                 0-045                  http://ss3.gemtalksystems.com/ss/OrbeonBPM
OrbeonLDAP                    0-016                  http://ss3.gemtalksystems.com/ss/OrbeonBridge
OrbeonPersistenceAPI          0-023                  http://ss3.gemstone.com/ss/OrbeonBridge
OrbeonPersistenceAPIProcess   0-027                  http://ss3.gemtalksystems.com/ss/OrbeonBridge
OrbeonWeb                     1-054                  http://ss3.gemtalksystems.com/ss/OrbeonBridge
|RB|                          953d5ff [dev]          filetree:///home/gemstone/GsDevKit_home/shared/repos/rb/repository
Seaside3                      2984ce1 [gs_master]    github://GsDevKit/Seaside31:gs_master/repository
|Ston|                        25aace1 [gemstone]     filetree:///home/gemstone/GsDevKit_home/shared/repos/ston/repository
Swazoo2                       2.2.0.7 [release]      http://smalltalkhub.com/mc/Swazoo/Swazoo/main
|Tode|                        810ad3f [master]       filetree:///home/gemstone/GsDevKit_home/shared/repos/tode/repository
XMLWriter                     2.7.0 [release]        http://www.smalltalkhub.com/mc/PharoExtras/XMLWriter/main
XPath                         1.6.8 [release]        http://www.smalltalkhub.com/mc/PharoExtras/XPath/main
|ZincHTTPComponents|          811da98 [gs_master]    filetree:///home/gemstone/GsDevKit_home/shared/repos/zinc/repository
|Zodiac|                      9657392 [gs_master]    github://GsDevKit/zodiac:gs_master/repository
|PharoCompatibility|                                 filetree:///home/gemstone/GsDevKit_home/shared/repos/PharoCompatibility/repository
|SmalltalkCI|                                        filetree:///home/gemstone/GsDevKit_home/shared/repos/smalltalkCI/repository
Reply | Threaded
Open this post in threaded view
|

Re: XML Parser bug ?

BrunoBB
Dale,

Here is a small test that i think it show the bug:
| str1 str2 |

str1 := '<imageAnnotation>
<image filename="" mediatype="" size=""/>
<annotation/>
</imageAnnotation>'.
str2 := str1 copyWithoutAll: String lf.

((XMLDOMParser parse: str1) xPath: 'imageAnnotation')
collection last stringNodes. "answer a XMLNodeList with 3 elements"

((XMLDOMParser parse: str2) xPath: 'imageAnnotation')
collection last stringNodes. "answer an empty XMLNodeList (not LF in this string)"

regards,
bruno
Reply | Threaded
Open this post in threaded view
|

Re: XML Parser bug ?

GLASS mailing list
Bruno,

I guess the question that I have is:

   Does the old version of XMLParser show the same bug in 3.3 or is this
a bug/feature of the new version of the XMLParser?

Another way of saying this is:

   Have you tried loading the old version XMLParser?

Do the XMLParser tests pass? Do the XMLParser tests cover this
particular case?

I am not an XMLParser person and I don't even know what version of
XMLParser you are using.

Dale

On 07/15/2016 11:04 AM, BrunoBB via Glass wrote:

> Dale,
>
> Here is a small test that i think it show the bug:
> | str1 str2 |
>
> str1 := '<imageAnnotation>
> <image filename="" mediatype="" size=""/>
> <annotation/>
> </imageAnnotation>'.
> str2 := str1 copyWithoutAll: String lf.
>
> ((XMLDOMParser parse: str1) xPath: 'imageAnnotation')
> collection last stringNodes. "answer a XMLNodeList with 3 elements"
>
> ((XMLDOMParser parse: str2) xPath: 'imageAnnotation')
> collection last stringNodes. "answer an empty XMLNodeList (not LF in this
> string)"
>
> regards,
> bruno
>
>
>
> --
> View this message in context: http://forum.world.st/XML-Parser-bug-tp4906721p4906735.html
> Sent from the GLASS mailing list archive at Nabble.com.
> _______________________________________________
> Glass mailing list
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/glass

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: XML Parser bug ?

BrunoBB
Dale,

Does the old version of XMLParser show the same bug in 3.3 or is this
a bug/feature of the new version of the XMLParser?
No, the older version work correctly !.

Have you tried loading the old version XMLParser?
No, i have 2 different VMs. One with GS 3.29 and the older version of XML Parser. (no xml bug)
The other with GS 3.3 and the newer version of XML Parser. (with xml bug)

I loaded the "stable" version of XML project.

Actually i have 284 Tests of my various applications. I have 3 tests in yellow.

If i found anything else i let you know...

regards,
bruno
Reply | Threaded
Open this post in threaded view
|

Re: XML Parser bug ?

GLASS mailing list


On 07/15/2016 12:28 PM, BrunoBB via Glass wrote:
> I loaded the "stable" version of XML project.
For a production app, I would not recommend using #stable versions
because each project is free to make up their own definition of what
#stable means and the #stable version is almost guaranteed to change
over time. For a production app the changes can come at inopportune
times ....

Of course if it is convenient for you to switch versions right now, then
perhaps this is the cost of using the new version?

At this point in time I really don't even know if the behavior you are
seeing is a feature or bug in the new implementation and I think that is
worth figuring out some point in time...

You are also switching GemStone versions and that introduces an
additional variable ... for example it would be interesting to know if
your app runs correctly on 3.2.9 when using the new version of the xml
parser ...

Dale

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: XML Parser bug ?

Paul DeBruicker
In reply to this post by BrunoBB
Hi Bruno,

I think you're running into the same issue discussed in this thread:

http://forum.world.st/XMLParser-changes-tp4891840p4891944.html


Its not a bug per se, the old behavior didn't obey the spec so they changed the parser to obey the spec.  Whitespace is significant in XML





BrunoBB wrote
Dale,

Does the old version of XMLParser show the same bug in 3.3 or is this
a bug/feature of the new version of the XMLParser?
No, the older version work correctly !.

Have you tried loading the old version XMLParser?
No, i have 2 different VMs. One with GS 3.29 and the older version of XML Parser. (no xml bug)
The other with GS 3.3 and the newer version of XML Parser. (with xml bug)

I loaded the "stable" version of XML project.

Actually i have 284 Tests of my various applications. I have 3 tests in yellow.

If i found anything else i let you know...

regards,
bruno
Reply | Threaded
Open this post in threaded view
|

Re: XML Parser bug ?

BrunoBB
Paul,

Thanks for the info very useful.
It is a feature of the new version to comply the standart.

My workaround to extract the string inside a node (now all tests are green):

getValueFrom: node ifNone: aBlock
        node stringNodes isEmpty ifTrue: [^aBlock value].
        ^node stringNodes last string

Change for:
getValueFrom: node ifNone: aBlock
        node stringNodes isEmpty ifTrue: [^aBlock value].
        (node stringNodes reject: [:e | e string = String lf]) ifEmpty: [^aBlock value]. "*"
        (node stringNodes allSatisfy: [:e | e string trimBlanks isEmpty]) ifTrue: [^aBlock value]. "*"
        ^node stringNodes last string

Regards,
Bruno