OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: [relax-ng-comment] How To ??



I want to construct a relax pattern for defining database triggers.  A trigger
can be fired on any or all of  insert,update and delete events - but it must
apply to at least one of these events.

I initially had:

            <optional>
                <attribute name="INSERT">
                    <ref name="YESNO"/>
                </attribute>
            </optional>
            <optional>
                <attribute name="UPDATE">
                    <ref name="YESNO"/>
                </attribute>
            </optional>
            <optional>
                <attribute name="DELETE">
                    <ref name="YESNO"/>
                </attribute>
            </optional>

but this fails to enforce the requirement that the trigger must apply to at
least one of the three events. Changing it to:

    <oneOrMore>
           <choice>
                <attribute name="INSERT">
                    <ref name="YESNO"/>
                </attribute>
                <attribute name="UPDATE">
                    <ref name="YESNO"/>
                </attribute>
                <attribute name="DELETE">
                    <ref name="YESNO"/>
                </attribute>
           </choice>
    </oneOrMore>

works OK for attributes, given the requirement for unique attribute names.
But it would not work were elements to be used instead of attributes, as it
would allow duplicates - when the requirement is for zero or one of each event
type.

So how would one define a suitable pattern for the case of using elements
instead of attributes?  I keep thinking that interleave should be able to do
it, but I haven't been able to figure out how (yet).

many tias,

gary






[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC