Re: [xsl] Question about isolating records

Subject: Re: [xsl] Question about isolating records
From: "Alan Painter alan.painter@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 2 Sep 2015 15:06:38 -0000
In case you were looking for more than one child that includes Crawford
(which would exclude cases where a single child field included Crawford
more than once),  then you might want:

        <xsl:sequence
select="//Record[count(./descendant-or-self::*/text()[matches(.,
'Crawford')]) gt 1]" />



On Wed, Sep 2, 2015 at 3:01 PM, Heiko Niemann kontakt@xxxxxxxxxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> And with XPath 1.0 this should work:
>
> contains(substring-after((//Record),'Crawford'), 'Crawford')
>
>
> Heiko
>
> > I have an XML file with approximately 8,000 records in it (see XML at
> > bottom of page). All contain at least one occurrence of the word
> > 'Crawford', but a few hundred of these records contain more than one
> > occurrence of the word 'Crawford'. I need to isolate those records with
> > more than one occurrence but everything I have tried fails. Can someone
> > help with this?
> > Thanks,
> > Mark
> >
> > <List>
> >     <Record>
> >        <Field>
> >           <Tag>110</Tag>
> >           <Data>Catholic Church.$bCongregatio Sacrorum Rituum.</Data>
> >        </Field>
> >        <Field>
> >           <Tag>245</Tag>
> >           <Data>Officium S. Margaritae Scotorum Reginae semiduplex. A
> > Sac. Rit. Congreg.
> >              recognitum, &amp; approbatum. De mandato D.N. Innocentij
> > Papae XI. in Breuiario Romano
> >              apponen$bEt ab omnibus vtriusque sexus Christifidelibus,
> > qui ad horas canonicas
> >              tenentur, ad libitum recitandum die octaua Iulij.</Data>
> >        </Field>
> >        <Field>
> >           <Tag>260</Tag>
> >           <Data>Romae :$bEx Typographia R. Cam. Apost,$c1679.</Data>
> >        </Field>
> >        <Field>
> >           <Tag>300</Tag>
> >           <Data>[8] p. ;$c20 cm. (4to)</Data>
> >        </Field>
> >        <Field>
> >           <Tag>500</Tag>
> >           <Data>'Die 21. Ianuarij [21 January] 1679.'.</Data>
> >        </Field>
> >        <Field>
> >           <Tag>500</Tag>
> >           <Data>Signed by 'Caesar Card. Fachenettus', i.e. Cesare
> > Facchinetti, Prefect of the
> >              Congregation.</Data>
> >        </Field>
> >        <Field>
> >           <Tag>500</Tag>
> >           <Data>Woodcut coat of arms of Innocent XI.</Data>
> >        </Field>
> >        <Field>
> >           <Tag>500</Tag>
> >           <Data>The text of the office is followed by the Congregatio
> > Sacrorum Rituum's
> >              decree of consent.</Data>
> >        </Field>
> >        <Field>
> >           <Tag>700</Tag>
> >           <Data>Facchinetti, Cesare,$d1608-1683.</Data>
> >        </Field>
> >        <Field>
> >           <Tag>852</Tag>
> >           <Data>Crawford.B.96(9)$nxxk</Data>
> >        </Field>
> >     </Record>
> > </List>

Current Thread