highsource / jsonix

Powerful XML<->JSON JavaScript mapping library.
BSD 2-Clause "Simplified" License
356 stars 75 forks source link

xsi:type support is not working when multiple name spaces exist #239

Open abdulsathar-m opened 4 years ago

abdulsathar-m commented 4 years ago

When Unmarsalling from XML to JSON it's not converting to the xsi:type, You can see the sample code here This is the XML I have tried, `

Identifier is created from the uid of the input scheme Location of well surface point in projected system. coordinate

`

Here Location is marked with xsi:type="ProjectedWellLocation", but the JSON output its converted as its base type "AbstractWellLocation". If I removed the "Aliases" section then it's working correctly. so the issue is happening when there is defaultElementNamespace referenced.

After debugging the issue found that here failing to get the xsiTypeInfo, because of namespaceContext.getNamespaceURI(prefix) giving wrong namespace from Jsonix.Schema.XSD.QName.INSTANCE.parse()