When we were implementing unordered sequences, this raised some questions around evaluating relative paths in expressions, for elements in a choice or unordered sequence :

DFDL spec: (gwdrp-dfdl-v1.0.4 section 15)
"When processing a choice group the parser validates

any contained path expressions. If a path
expression contained inside a choice branch refers
to any other branch of the choice, then it is a
schema definition error."

1.        I'm not clear what benefit this restriction on path expressions gives.
It seems redundant since in any single instance of a choice group, if the branch  being processed exists, then by definition none of it's sibling branches exist. Any expression path referring to a non-existent branch  would correctly return <empty sequence>


If the choice group is inside a repeating structure, then expressions referring to choice branches within other instances of the choice could be useful.
Should an expression referring to branches in other instances of a choice cause a schemadef error?

Example
expression on el_b could be
{ fn:count(../../el_choice/el_a) }

- parent
 [sequence]
   - el_choice [minOccurs=5 maxOccurs=5]
     [choice]
       - el_a
       - el_b
 

2.        Should an expression that potentially refers to branches in the choice cause a schemadef error?

Example
identically named elements in and out of a choice
expression on el_c could be
{ fn:count(../el_a) }

- parent
 [sequence]
   - el_a
   - el_b
   - [embedded choice group]
      - el_a
      - el_c






Regards,
Mark Frost
_____________________________________
MP 211, IBM Hursley, Winchester, SO21 2JN
Phone: (01962) 817009 or x247009
Email: frostmar@uk.ibm.com
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU