xsd2php
xsd2php copied to clipboard
xml_list: inline:true, picking wrong namespace
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.
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?)
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.