[
https://issues.apache.org/jira/browse/TUSCANY-3597?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Thomas Gentsch updated TUSCANY-3597:
------------------------------------
Attachment: test.xml
testprog.cpp
> XMLwriter drops namespace for datatype properties
> -------------------------------------------------
>
> Key: TUSCANY-3597
> URL: https://issues.apache.org/jira/browse/TUSCANY-3597
> Project: Tuscany
> Issue Type: Bug
> Components: C++ SDO
> Affects Versions: Cpp-M2
> Reporter: Thomas Gentsch
> Attachments: schema1.xsd, schema2.xsd, SDOXMLWriter.cpp-PATCH,
> test.xml, testprog.cpp
>
>
> 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 ...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.