[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Question about isolating records

Subject: Re: [xsl] Question about isolating records
From: "Mark Wilson pubs@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 5 Sep 2015 11:10:20 -0000

I have two XML files, File 1 and File 2. They contain the XML shown below.

<Tag>852</Tag> in File 1 has a @crawford-number. If in File 2 there is an <Item> with a <Shelfmark> equal to the value of @crawford-number, I want to add an @pdf-number attribute to the <Tag>852</Tag> in File 1 containing the value of <PDF> in File 2 like so:
<Tag crawford-number="Crawford 2411." @pdf-number="016678286">852</Tag>

File 1 always contains a <Tag @crawford>852</Tag> and File 2 always contains a <Shelfmark>, but there may or may not be a match.

I have not a clue as to how to get started. Happy to answer any questions.

<Data>General-Anzeiger fC<r Philatelie.$bInternationales Insertions- Organ.</Data>
<Tag crawford-number="Crawford 2411.">852</Tag>
<Data>No.1-800. 10 Apr. 1883-15 Jan. 1913$aBritish Library$b5$cDPB$jCrawford

File 2:
        <Shelfmark>Crawford 2411.</Shelfmark>
        <Title>General-Anzeiger fC<r Philatelie.</Title>

Current Thread