From stefanML at collocations.de Wed Jul 1 11:52:11 2026 From: stefanML at collocations.de (Stephanie Evert) Date: Wed, 1 Jul 2026 11:52:11 +0200 Subject: [CWB] xml searches... In-Reply-To: <8c93469d-12cd-4358-a77e-75855d0fa428@univ-avignon.fr> References: <8c93469d-12cd-4358-a77e-75855d0fa428@univ-avignon.fr> Message-ID: > Is there any way I can search for xml tags inside other xml tags? Something like > n: []+ :: n.div2_n="1"; You need to set the label on some token within the region, typically the first one: n:[] []* :: n.div2_n="1"; Or you could use the implicitly defined match or matchend anchors as long as the region of interest is at the start or end of the query: []+ :: match.div2_n="1"; Another ? faster ? option is to do the check inline, but I generally prefer the global constraint for readability: [ _.div2_n="1" ] []* :: Best, Stephanie > (which doesn't work, as it is gross improvisation!). > Many thanks in advance for any help! > Best, > Graham. > _______________________________________________ > CWB mailing list > CWB at sslmit.unibo.it > http://liste.sslmit.unibo.it/mailman/listinfo/cwb From graham.ranger at univ-avignon.fr Wed Jul 1 15:55:08 2026 From: graham.ranger at univ-avignon.fr (Graham Ranger) Date: Wed, 1 Jul 2026 15:55:08 +0200 Subject: [CWB] xml searches... In-Reply-To: References: <8c93469d-12cd-4358-a77e-75855d0fa428@univ-avignon.fr> Message-ID: Many thanks for this Stephanie. It works brilliantly. Best, Graham. Le 01/07/2026 ? 11:52, Stephanie Evert a ?crit?: > >> Is there any way I can search for xml tags inside other xml tags? Something like >> n: []+ :: n.div2_n="1"; > You need to set the label on some token within the region, typically the first one: > > n:[] []* :: n.div2_n="1"; > > Or you could use the implicitly defined match or matchend anchors as long as the region of interest is at the start or end of the query: > > []+ :: match.div2_n="1"; > > Another ? faster ? option is to do the check inline, but I generally prefer the global constraint for readability: > > [ _.div2_n="1" ] []* :: > > Best, > Stephanie > >> (which doesn't work, as it is gross improvisation!). >> Many thanks in advance for any help! >> Best, >> Graham. >> _______________________________________________ >> CWB mailing list >> CWB at sslmit.unibo.it >> http://liste.sslmit.unibo.it/mailman/listinfo/cwb > > > >