[XML4Lib] elegant select statement

Eric Lease Morgan emorgan at nd.edu
Thu May 3 10:21:04 EDT 2007


Given the following XML snippet, what is an elegant select statement  
I can use to extract the value of 245 subfield a:

<?xml version="1.0" encoding="utf-8"?>
<present>
<record>
   <record_header>
    <set_entry>000000001</set_entry>
   </record_header>
   <doc_number>2013156</doc_number>
   <metadata>
    <oai_marc>
     <varfield id="100" i1="1" i2="">
      <subfield label="a">Allen, Christopher,</subfield>
      <subfield label="d">1953-</subfield>
     </varfield>
     <varfield id="245" i1="1" i2="0">
      <subfield label="a">French painting in the Golden Age /</subfield>
      <subfield label="c">Christopher Allen.</subfield>
     </varfield>
    </oai_marc>
   </metadata>
</record>
</present>

To what degree do I have to create bunches o' loops testing the value  
of id in varfield and repeating the process by testing the value of  
subfields and labels. There has to be an easier way!

-- 
Eric Lease Morgan
University Libraries of Notre Dame

(574) 631-8604




More information about the XML4Lib mailing list