You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Pascal Schumacher (JIRA)" <ji...@apache.org> on 2015/07/12 19:27:04 UTC

[jira] [Reopened] (GROOVY-3905) XMLNodePrinter doesn't keep namespace required for attribute value

     [ https://issues.apache.org/jira/browse/GROOVY-3905?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pascal Schumacher reopened GROOVY-3905:
---------------------------------------

So I guess I misunderstood the issue. The reporter was taking about a UnmarshallingException because of a unbound namespace, so I thought the xml was not valid.

> XMLNodePrinter doesn't keep namespace required for attribute value
> ------------------------------------------------------------------
>
>                 Key: GROOVY-3905
>                 URL: https://issues.apache.org/jira/browse/GROOVY-3905
>             Project: Groovy
>          Issue Type: Bug
>          Components: XML Processing
>    Affects Versions: 1.6.5
>         Environment: Groovy 1.6.5 / Linux
>            Reporter: Nicolas Nobelis
>         Attachments: NameSpaceTest.groovy, TableReportSimpleRequest.xml
>
>
> I have a SOAP request containing the following stanza :
> <filterValue *xmlns:xs="http://www.w3.org/2001/XMLSchema"* xsi:type="xs:string">gaucho</filterValue>
> However, XMLNodePrinter outputs :
> <filterValue xsi:type="xs:string">gaucho</filterValue>
> I looked in the source of XMLNodePrinter, and it seems that, since an element/attribute with the prefix 'xs' is never encountered, the corresponding call to _printNamespace_ is never done.
> The processed xml give me an Unmarshalling Exception from the web service because the namespace 'xs' is then not bound. I understand that usually, namespaces that are not used in the XML don't have to be outputted, but still I do not feel comfortable with XMLNodePrinter removing some of my declarations.
> You will find in attachment the raw SOAP request and a sample Groovy script to test it (this is not a unit test).
> Thanks in advance
> N.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)