Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 338173

Summary: Support folding XML binding
Product: z_Archived Reporter: Konstantin Komissarchik <konstantin>
Component: SapphireAssignee: Konstantin Komissarchik <konstantin>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: ling.hao
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Konstantin Komissarchik CLA 2011-02-24 21:37:48 EST
In certain cases, while a given XML element can have a number of child elements, one of the child elements occurs by itself with high frequency. In these cases, it useful to reduce the verbosity of XML by folding the child element into the parent.

Consider the following schema:

root
  a (required)
  b (optional)
  c (optional)

If you know that the following usage occurs with high frequency:

<root>
  <a>xyz</a>
</root>

It is useful to fold that syntax into a less verbose form:

<root>xyz</root>

While retaining ability to the more verbose form for case where other child elements are present:

<root>
  <a>xyz</a>
  <b>123</b>
</root>

Sapphire XML binding should support this scenario.
Comment 1 Konstantin Komissarchik CLA 2011-02-25 19:18:26 EST
Feature implement. Use it like this...

@CustomXmlValueBinding( impl = FoldingXmlValueBindingImpl.class, params = "a" )
Comment 2 Ling Hao CLA 2011-06-08 15:47:21 EDT
Verify with Sapphire UI definition editor -> <property-editor>