[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Request of Clarification: include and combine
Followings are my current understanding. Is there any false statement? * The combine attribute is allowed for <define>s under a <grammar>, but not allowed for <define>s under a grammar-level <include>. * Nothing but "choice" and "interleave" are allowed as values of the combine attribute. * It is an error to have <define name="foo"> under an <include>, if "foo" is not defined in the included file. (?) In other words, the following grammar is an error. A.rng <grammar> <define name="foo"> ... </define> <include href="B.rng"> <define name="foo"> ... </define> </include> </grammar> B.rng <grammar/> I guess this is hard to implement ... * It is an error to declare the same pattern twice in the same file, regardless of the use of the combine attribute. (?) In other words, the following grammar is an error. <grammar> <define name="foo"> ... </define> <define name="foo" combine="choice"> ... </define> </grammar> Why is this an error? * It is an error to declare the same pattern with different combine methods. In other words, the following grammar has an error. A.rng: <grammar> <define name="foo"> ... </define> <?grammar> B.rng <grammar> <include href="A.rng"/> <define name="foo" combine="choice"> ... </define> </grammar> C.rng <grammar> <include href="B.rng"/> <define name="foo" combine="interleave"> ... </define> </grammar> * However, it is *NOT* an error to use a different combine method, once it is redefined. In other words, the following grammar is OK: A.rng: <grammar> <define name="foo"> ... </define> <?grammar> B.rng <grammar> <include href="A.rng"/> <define name="foo" combine="choice"> ... </define> </grammar> C.rng <grammar> <include href="B.rng"> <define name="foo"> ... </define> </include> </grammar> D.rng <grammar> <include href="C.rng"/> <define name="foo" combine="interleave"> ... </define> </grammar> * It is an error to have two <define>s, both without @combine, and share the same name. In other words, the following is an error. A.rng: <grammar> <define name="foo"> ... </define> <?grammar> B.rng <grammar> <include href="A.rng"/> <define name="foo"> ... </define> </grammar> * It is *NOT* an error for all <define>s with the same name to have @combine. A.rng: <grammar> <define name="foo" combine="choice"> ... </define> <?grammar> B.rng <grammar> <include href="A.rng"/> <define name="foo" combine="choice"> ... </define> </grammar> -- Kohsuke KAWAGUCHI +1 650 786 0721 Sun Microsystems kohsuke.kawaguchi@eng.sun.com
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC