Print

Print


Hi Julie,

If you did want to go the XSLT route for this, here is another template similar to Stuart's one from yesterday. This will match the text nodes and then do nothing. So, your transform will strip these out.

<xsl:template match="marc:datafield[@tag='710'][ contains(., 'Faux College') and contains(., 'Special Collections')]
"/>

Best,

Chris


Christine Schwartz
Metadata Librarian and XML Database Administrator
Princeton Theological Seminary
Library
P.O. Box 821
Princeton, NJ 08542
[log in to unmask]




-----Original Message-----
From: Code for Libraries [mailto:[log in to unmask]] On Behalf Of Julie Swierczek
Sent: Tuesday, January 10, 2017 4:14 PM
To: [log in to unmask]
Subject: [CODE4LIB] MARCXML help again

Thanks to all who responded to my earlier plea for help.  I now have a new problem.  I'm not sure if I can do this with find and replace in Oxygen, or if this requires XSLT, or what. 

I have a project of MARCXML records like this:

<?xml version="1.0" encoding="UTF-8" ?>
<marc:collection xmlns:marc="http://www.loc.gov/MARC21/slim"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd">
  <marc:record>
<!--Lots of other datafields here -->
    <marc:datafield tag="710" ind1="2" ind2=" ">
            <marc:subfield code="a">Faux College</marc:subfield>
            <marc:subfield code="b">Special Collections</marc:subfield>
        </marc:datafield>
  </marc:record>
</marc:collection>

I want to strip out all instances of:
    <marc:datafield tag="710" ind1="2" ind2=" ">
            <marc:subfield code="a">Faux College</marc:subfield>
            <marc:subfield code="b">Special Collections</marc:subfield>
        </marc:datafield>
but I want to leave other <marc:datafield tag="710" ind1="2" ind2=" "> instances intact.  I only want to delete ones with both the Faux College and Special Collections text in the subfields.

Where would I go from here? I thought of doing an xsl:template match in an XSL stylesheet, and then not providing any instructions for replacing the match, but I don't know how to select for that specific text. My attempts to figure that out have not worked. You can only read so much W3C documentation and Stack Overflow before you need to just sit quietly and stare at a wall for a while.

Thanks in advance --

Julie