Deletion of namespaces with getXMLNSPrefixMap() [message #1419167] |
Mon, 08 September 2014 07:37 |
Peter Gernold Messages: 11 Registered: January 2014 |
Junior Member |
|
|
We have implemented a logic to identify obsolete namespaces in our BPMN2 document and trigger the deletion of the namespaces by calling method getXMLNSPrefixMap().remove(...) on documentRoot at save time.
Example: A dataInput refers to a itemDefinition, which refers by structureRef to a namespace. If the dataInput is deleted, we check, if the itemDefinition is referred by another element and in case not the deletion of the itemDefinition, the import and the namespace is triggered.
We have executed several manual tests and one is reproducable failing. The tests are:
1.) Delete dataInput in modeler, save your change, close the modeler, open the modeler, delete another dataInput and save your changes.
Result (is OK): Both dataInputs, the itemDefinitions, the imports and namespaces are deleted
2.) Delete dataInput in modeler, delete another dataInput and save your changes.
Result (is OK): Both dataInputs, the itemDefinitions, the imports and namespaces are deleted
3.) Delete dataInput in modeler, save your change, delete another dataInput and save your changes.
Result (is NOT OK): Both dataInputs, the itemDefinitions and the imports are deleted. Only the namespace of the first dataInput is deleted, but not the ones of the second dataInput.
Remark to 3.): Via debugger we have verified that the deletion of the namespace for the second dataInput is triggered by calling getXMLNSPrefixMap().remove(...) and the namespace is really removed from the map, but the resulting BPMN2 file contains still the namespace.
Any idea how to solve this issue. Thanks
Peter
|
|
|
Re: Deletion of namespaces with getXMLNSPrefixMap() [message #1427019 is a reply to message #1419167] |
Fri, 19 September 2014 15:21 |
|
Hi Peter,
It all depends on WHEN you are calling remove() at save time. This is some very intense code and I had a hard time figuring this stuff out myself. I'd suggest you try to step through the EMF serializer to find out where those namespaces are being added to the NS map after you remove them.
Bob
|
|
|
|
Powered by
FUDForum. Page generated in 0.02875 seconds