You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Joost Horward (Jira)" <ji...@apache.org> on 2020/12/26 17:11:00 UTC

[jira] [Commented] (GROOVY-8850) StreamingMarkupBuilder adds namespace on elements not expected

    [ https://issues.apache.org/jira/browse/GROOVY-8850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17255069#comment-17255069 ] 

Joost Horward commented on GROOVY-8850:
---------------------------------------

In groovy 2.5 the behaviour of ArrayLists has changed ( ! ) and now this line:

[https://github.com/apache/groovy/blob/5bd5af6913d1f66a31d0deed0ee6ddaa920704a5/subprojects/groovy-xml/src/main/groovy/groovy/xml/StreamingMarkupBuilder.groovy#L174]

and this line:

[https://github.com/apache/groovy/blob/5bd5af6913d1f66a31d0deed0ee6ddaa920704a5/subprojects/groovy-xml/src/main/groovy/groovy/xml/StreamingMarkupBuilder.groovy#L190]

operate on different ends of the pendingNamespaces list.

And that makes a mess of the namespace stack.

If you change the first one to read:

{{ pendingStack.push pendingNamespaces.clone()}}

it works again.

 

 

 

 

 

> StreamingMarkupBuilder adds namespace on elements not expected
> --------------------------------------------------------------
>
>                 Key: GROOVY-8850
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8850
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-jdk
>    Affects Versions: 2.5.3
>            Reporter: Sigmund Lundgren
>            Priority: Major
>         Attachments: bad.xml, good.xml
>
>
> weird groovy markupbuilder behavior when upgrading to 2.5.3, it adds namespaces to an element, did not happen in earlier versions and messes up parsing later… Element SUBJUPDRQ should not have namespace
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> <GSRL xmlns="http://www.dnb.com/GSRL/Vers7/Rls24" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>   <GSRLMSGSRQV1>
>     <SUBJUPDTRNRQ>
>       <TRNUID>GSRL7BNRSE_20181018110156</TRNUID>
>       <SUBJUPDRQ xmlns="http://www.dnb.com/GSRL/Vers7/Rls24" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> ...
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)