Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 31 lines (30 sloc) 0.916 kB
60c3b0c Fix bug #16642 - MARCXML files return field tags/subfield codes as ke…
Dan Scott authored
1 --TEST--
2 marc_xml_16642: Fix bug 16642: ensure tag and subfield values are returned as strings
d44164b Add a SKIPIF section to skip tests when Structures_LinkedList is not …
Dan Scott authored
3 --SKIPIF--
4 <?php include('skipif.inc'); ?>
60c3b0c Fix bug #16642 - MARCXML files return field tags/subfield codes as ke…
Dan Scott authored
5 --FILE--
6 <?php
7 $dir = dirname(__FILE__);
8 require 'File/MARCXML.php';
9 // Retrieve a set of MARC records from a file
10 $marc_file = new File_MARCXML($dir . '/' . 'onerecord.xml');
11 // Iterate through the retrieved records
12 while ($record = $marc_file->next()) {
13 foreach ($record->getFields() as $tag => $subfields) {
14 // Skip everything except for 650 fields
15 if ($tag == '650') {
16 print "Subject:";
17 foreach ($subfields->getSubfields() as $code => $value) {
18 print " $value";
19 }
20 print "\n";
21 }
22 }
23 }
24 ?>
25 --EXPECT--
26 Subject: [a]: Arithmetic [x]: Juvenile poetry.
27 Subject: [a]: Children's poetry, American.
28 Subject: [a]: Arithmetic [x]: Poetry.
29 Subject: [a]: American poetry.
30 Subject: [a]: Visual perception.
Something went wrong with that request. Please try again.