Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
abdulsathar-m opened this issue Feb 27, 2020 · 0 comments
Open

Comments

@abdulsathar-m
Copy link

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,
<Well xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.namespace1.com"> <Aliases xmlns="http://www.defaultnamespace.com"> <Description>Identifier is created from the uid of the input scheme</Description> </Aliases> <ReferencePoint> <Location xsi:type="ProjectedWellLocation"> <Description>Location of well surface point in projected system.</Description> <Coordinate1>coordinate</Coordinate1> </Location> </ReferencePoint> </Well>

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()

abdulsathar-m added a commit to abdulsathar-m/jsonix that referenced this issue Feb 28, 2020
Seems the issue highsource#239 is fixed after making this change. Please review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant