groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sigmund Lundgren (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8850) StreamingMarkupBuilder adds namespace on elements not expected
Date Thu, 18 Oct 2018 10:43:00 GMT

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

Sigmund Lundgren commented on GROOVY-8850:
------------------------------------------

the output differs with 2.5.3 we get 
 <SUBJUPDRQ xmlns="http://www.dnb.com/GSRL/Vers7/Rls24" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 Earlier versions just <SUBJUPDRQ>

Should be valid even with namespace added but we have legacy code that fails hard..

{{Code snippet:}}
{{ def xml = markupBuilder.bind { builder ->}}
{{ mkp.xmlDeclaration()}}
{{ mkp.declareNamespace('': 'http://www.dnb.com/GSRL/Vers7/Rls24',}}
{{ 'xsi': 'http://www.w3.org/2001/XMLSchema-instance')}}{{GSRL {}}
{{ GSRLMSGSRQV1 {}}
{{ SUBJUPDTRNRQ {}}
{{ addTrnUID(builder)}}
{{ SUBJUPDRQ {}}
{{ topics.each}}{{{ topic -> mkp.yieldUnescaped topic }}}{{}}}
{{ }}}
{{ }}}
{{ }}}
{{ }}}{{return XmlUtil.serialize(xml.toString())}}

> 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
>
> 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
(v7.6.3#76005)

Mime
View raw message