Community
Participate
Working Groups
This bug is for inclusion in WTP 3.2.2 patches +++ This bug was initially created as a clone of Bug #190876 +++ We have a schema that allows for the following three options: (no tag) - means that the setting is null <tag/> - means that the setting has default value (I believe this should be the equivalent to <tag></tag>, but is the preferred method of specifying this default behavior) <tag>value</tag> - means that the setting has the non-default value "value" So we utilize a translator. We can't use the type setting EMPTY_TAG, because that means that there should never be text content (or at least we get exceptions when there is content) And the setting EMPTY_CONTENT_IS_SIGNIFICANT doesn't seem to have any effect. The only setting we use is END_TAG_NO_INDENT. Our problem occurs when trying to set the model value to "value" and the XML is in the form "<tag/>". Nothing happens to the XML. The problem is in EMF2DOMAdapterImpl#findOrCreateTextNode(Node, Translator, String). We have overridden convertValueToString(Object, EOwner) in our code, so we do have a String value to insert into the XML, but this method simply determines that the XML element is an empty element, and doesn't create a text node for it. It's a no-op. I'm not sure exactly what the correct behavior is, but my guess is that if we are trying to set a non-null value into an empty tag, the adapter should check the translator to see if that's allowed, and should create a closing tag and a text node. Otherwise, we just can't use translators to solve this problem. (Additionally, we can't get the translators to create an empty tag by default over the form "<tag></tag>", but since the forms should be equivalent, that's not a huge problem)
Created attachment 179393 [details] Same patch
Committed to R3_2_2_patches