Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sapphire-dev] how to model an OR DTD element

You have several options…

 

1. Expose both as separate properties and use validation to ensure that user is aware that only one should be specified.

 

2. Add a before/after enum property with a custom binding and a filter name property. In effect, you would be assigning the name of the element as value of one property and the content of the element as value of another property. You will need to write a custom binding for both of the properties to achieve this effect.

 

3. Use a heterogeneous element property to map after-filter/before-filter to different child model element definitions. This options makes the most sense in situations where OR’ed elements are fairly complex internally.

 

Thanks,

 

- Konstantin

 

 

From: sapphire-dev-bounces@xxxxxxxxxxx [mailto:sapphire-dev-bounces@xxxxxxxxxxx] On Behalf Of Greg Amerson
Sent: Tuesday, November 08, 2011 11:22 PM
To: Sapphire project
Subject: [sapphire-dev] how to model an OR DTD element

 

So in the DTD that I'm trying to model I have this:

 

<!ELEMENT servlet-filter-mapping (servlet-filter-name, (after-filter | before-filter)?, url-pattern+, dispatcher*)>

 

I'm wondering how to model the (after-filter | before-filter)? part.  So either you have a <after-filter> element or a <before-filter> element, or neither, but not both.  I looked through the samples gallery but didn't see anything on my first pass through.  

 

--

Greg Amerson

Liferay, Inc.


Back to the top