You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2015/07/09 03:52:05 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=14619731#comment-14619731 ] 

Paul King commented on GROOVY-3905:
-----------------------------------

It still currently leaves out the {{xs}} namespace. So each of the Groovy components is acting in a technically correct manor. It's more a case of whether we would like to support round-tripping between our various tools in a way that preserves information over and above XML canonical form. E.g. we could preserve comments, indenting information and technically unused namespaces. In any case, perhaps this use case has gone away.

> 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
>             Fix For: 2.5.0-beta-1
>
>         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)