xsd2php icon indicating copy to clipboard operation
xsd2php copied to clipboard

xml_list: inline:true, picking wrong namespace

Open pakomp opened this issue 6 years ago • 2 comments

Hi, We encountered an issue where the yml file created for a entry that is an inline xml_list was giving the namespace of the parent element it was in instead of the elements own namespace.

Attached some example files. arbetsgivardeklaration.zip

The problem happens in the Skatteverket element of the "http://xmls.skatteverket.se/se/skatteverket/da/instans/schema/1.1" namespace, with the blankett element that belongs to the "http://xmls.skatteverket.se/se/skatteverket/da/komponent/schema/1.1" namespace.

The yml written is

         blankett:
            xml_list:
                inline: true
                entry_name: Blankett
                namespace: 'http://xmls.skatteverket.se/se/skatteverket/da/instans/schema/1.1'
but for deserialization to work it needs to be
         blankett:
            xml_list:
                inline: true
                entry_name: Blankett
                namespace: 'http://xmls.skatteverket.se/se/skatteverket/da/komponent/schema/1.1'

In the supplied patch.diff, I change the namespace code to follow the inline:false case instead and that seems to create the right yml for us.

pakomp avatar Sep 27 '18 07:09 pakomp

Hi, thanks for submitting this issue.

I saw that the zip file already contains the patch file (with a fix??). Can you submit a PR? ( adding a test maybe?)

goetas avatar Sep 27 '18 07:09 goetas

Feels like I would need to read up on the JMS yaml definition before saying that patch.diff would be the correct fix. All I know is, that changed helped me in this specific case.

pakomp avatar Sep 27 '18 11:09 pakomp