Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
Cpp-M2
-
None
-
None
-
Patch Available
Description
When defining XSD and XML data as attached, the resulting XML is wrong if loaded and saved.
For datatype properties with imported NS, the NS is lost if that NS is not used with at least one object property.
Example (prop3):
In:
==========
<?xml version="1.0" encoding="UTF-8"?>
<ns1:class1 xmlns:ns1="http://ns1" xmlns:ns2="http://ns2">
<ns1:prop1>bla</ns1:prop1>
<ns1:prop2>
<ns2:prop3>blub</ns2:prop3>
</ns1:prop2>
</ns1:class1>
==========
Out:
==========
<?xml version="1.0" encoding="UTF-8"?>
<class1 xsi:type="tns2:class1" xmlns:tns2="http://ns1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tns2:prop1>bla</tns2:prop1>
<tns2:prop2>
<prop3>blub</prop3>
</tns2:prop2>
</class1>
==========
Reason is, that the XMLWriter at the beginning collects all referenced NS by traversing through the entire SDO, but it skips
datatype props.
The fix has some performance (must compare also the NS of all datatype props) impact but I could not see a better way ...