Closed AzeemMuzammil closed 3 months ago
I think the deserialization behavior is correct, as per the discussion here, https://github.com/ballerina-platform/ballerina-spec/issues/1268. both xml values are not ==. Based on this we design the data.xmldata annotations. Maybe we can have the less restrictive version which can be enabled via an option.
Since this is one of the common use cases, we can relax strict equality, and make the semantic equality work for the common case by default. To enable strict equality we can provide an option. @prakanth97 WDYT?
Since this is one of the common use cases, we can relax strict equality, and make the semantic equality work for the common case by default. To enable strict equality we can provide an option. @prakanth97 WDYT?
Agree. Seems like better option.
Description:
The
xmldata
module in Ballerina fails to correctly deserialize XMLs to records when only the namespace prefixes are changed, despite the XMLs being semantically equivalent. This issue occurs when deserializing an XML with a different namespace prefix than what was used during serialization, even though the namespace URIs are the same.Consider the following XML and record:
Initial XML
Corresponding Record:
Serialization:
If I change the resulting XML to:
Deserialization:
Actual Result: Deserialization fails with the error
Expected Behavior: When the XML documents are semantically equivalent (identical URIs, differing only in prefix), the xmldata module should successfully serialize and deserialize the XML without errors.
Steps to reproduce:
xmldata:parseAsType()
.Affected Versions:
OS, DB, other environment details and versions:
Related Issues (optional):
Suggested Labels (optional):
Suggested Assignees (optional):