Re: Catching node at undetermined depth in key

Guillaume Rousse <rousse@ccr.jussieu.fr> writes:

> > 1) Are there many <foos> or only one in a given document?
> Only one.
> 
> > 2) If many, are they separate identity scopes, or one, i.e. is the
> > following meant to be good or bad?
> Not relevant here.
> 
> > 3) Can <foo id='a'> appear anywhere other than inside <foos>?
> With an id attribute, yes. Without, no

Sorry, I phrased this badly so I'm not sure I understand your answer.
Try again:  3) Does <foo> appear, with or without 'id', outside a <foos>?

It appears that the answer is "yes, but only without an ID"

> > Only if the answers are 'many';'bad';'yes' do you have a problem.
> >
> > Otherwise just use
> >
> >  <key name="fooKey">
> >    <selector xpath=".//foo"/>
> >    <field xpath="@id"/>
> >  </key>
> >
> > within the root element declaration if the answer to (2) is 'bad', or
> > within the <foos> element declaration if the answer to (2) is 'good'.
> So i guess i must either declare the key in root element with an additional 
> [@id] assertion, or in the <foos> element declaration.

I think if I understand correctly that's right, either will work.

Was my initial  supposition it would make fooKey local to this element wrong ?

Not sure I understand what you mean.  Yes, fooKey is local to <foos>.
But you've said <foo id=''> only occurs inside <foos>, so what does
that matter?  Note that 'local to <foos>' does not mean 'catches only
immediated children of <foos>' -- the pattern './/foo' will find all
<foo > at any depth.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Saturday, 1 September 2001 11:00:11 UTC