ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- PK]tests/marc_xml_005.phptnu[--TEST-- marc_xml_005: Round-trip a MARCXML record with a root element of "record" to MARC21 --SKIPIF-- --FILE-- next()) { print $marc_record->toRaw(); } ?> --EXPECT-- 01142cam 2200301 a 4500001001300000003000400013005001700017008004100034010001700075020002500092040001800117042000900135050002600144082001600170100003200186245008600218250001200304260005200316300004900368500004000417520022800457650003300685650003300718650002400751650002100775650002300796700002100819 92005291 DLC19930521155141.9920219s1993 caua j 000 0 eng  a 92005291  a0152038655 :c$15.95 aDLCcDLCdDLC alcac00aPS3537.A618bA88 199300a811/.522201 aSandburg, Carl,d1878-1967.10aArithmetic /cCarl Sandburg ; illustrated as an anamorphic adventure by Ted Rand. a1st ed. aSan Diego :bHarcourt Brace Jovanovich,cc1993. a1 v. (unpaged) :bill. (some col.) ;c26 cm. aOne Mylar sheet included in pocket. aA poem about numbers and their characteristics. Features anamorphic, or distorted, drawings which can be restored to normal by viewing from a particular angle or by viewing the image's reflection in the provided Mylar cone. 0aArithmeticxJuvenile poetry. 0aChildren's poetry, American. 1aArithmeticxPoetry. 1aAmerican poetry. 1aVisual perception.1 aRand, Ted,eill. PK]#" ) )tests/marc_022.phptnu[--TEST-- marc_022: Insert fields --SKIPIF-- --FILE-- next()) { print "\nNext record:\n"; // Create the new field $subfields = null; $subfields[] = new File_MARC_Subfield('a', 'Scott, Daniel.'); $new_field = new File_MARC_Data_Field('100', $subfields, 0, null); // Retrieve the target field for our insertion point $subject = $record->getFields('650'); // Insert the new field if (is_array($subject)) { $record->insertField($new_field, $subject[0], true); } elseif ($subject) { $record->insertField($new_field, $subject, true); } print $record; } $record = null; $marc_file = new File_MARC($dir . '/' . 'music.mrc'); print "\nInsert a new 100 field after the first 650\n"; while ($record = $marc_file->next()) { print "\nNext record:\n"; // Create the new field $subfields = null; $subfields[] = new File_MARC_Subfield('a', 'Scott, Daniel.'); $new_field = new File_MARC_Data_Field('100', $subfields, 0, null); // Retrieve the target field for our insertion point $subject = $record->getFields('650'); // Insert the new field if (is_array($subject)) { $record->insertField($new_field, $subject[0]); } elseif ($subject) { $record->insertField($new_field, $subject); } print $record; } ?> --EXPECT-- Insert a new 100 field before the first 650 Next record: LDR 01145ncm 2200277 i 4500 001 000073594 004 AAJ5802 005 20030415102100.0 008 801107s1977 nyujza 010 _a 77771106 035 _a(CaOTUIC)15460184 035 9 _aAAJ5802 040 _aLC 050 00 _aM1366 _b.M62 _dM1527.2 245 04 _aThe Modern Jazz Quartet : _bThe legendary profile. -- 260 _aNew York : _bM.J.Q. Music, _cc1977. 300 _ascore (72 p.) ; _c31 cm. 500 _aFor piano, vibraphone, drums, and double bass. 505 0 _aLewis, J. Django.--Lewis, J. Plastic dreams (music from the film Kemek).--Lewis, J. Dancing (music from the film Kemek).--Lewis, J. Blues in A minor.--Lewis, J. Blues in B♭.--Lewis, J. Precious joy.--Jackson, M. The martyr.--Jackson, M. The legendary profile. 100 _aScott, Daniel. 650 0 _aJazz. 650 0 _aMotion picture music _vExcerpts _vScores. 700 12 _aLewis, John, _d1920- _tSelections. _f1977. 700 12 _aJackson, Milt. _tMartyrs. _f1977. 700 12 _aJackson, Milt. _tLegendary profile. _f1977. 740 4 _aThe legendary profile. 852 00 _bMUSIC _cMAIN _kfolio _hM1366 _iM62 _91 _4Marvin Duchow Music _5 Next record: LDR 01293cjm 2200289 a 4500 001 001878039 005 20050110174900.0 007 sd fungnn|||e| 008 940202r19931981nyujzn i d 024 1 _a7464573372 028 02 _aJK 57337 _bRed Baron 035 _a(OCoLC)29737267 040 _aSVP _cSVP _dLGG 100 1 _aDesmond, Paul, _d1924- 245 10 _aPaul Desmond & the Modern Jazz Quartet _h[sound recording] 260 _aNew York, N.Y. : _bRed Baron : _bManufactured by Sony Music Entertainment, _cp1993. 300 _a1 sound disc (39 min.) : _bdigital ; _c4 3/4 in. 511 0 _aPaul Desmond, alto saxophone; Modern Jazz Quartet: John Lewis, piano; Milt Jackson, vibraphone; Percy Heath, bass; Connie Kay, drums. 500 _aAll arrangements by John Lewis. 518 _aRecorded live on December 25, 1971 at Town Hall, NYC. 500 _aOriginally released in 1981 by Finesse as LP FW 27487. 500 _aProgram notes by Irving Townsend, June 1981, on container insert. 505 0 _aGreensleeves -- You go to my head -- Blue dove -- Jesus Christ Superstar -- Here's that rainy day -- East of the sun -- Bags' new groove. 100 _aScott, Daniel. 650 0 _aJazz _y1971-1980. 700 1 _aLewis, John, _d1920- 710 2 _aModern Jazz Quartet. 740 0 _aPaul Desmond and the Modern Jazz Quartet. Next record: LDR 01829cjm 2200385 a 4500 001 001964482 005 20060626132700.0 007 sd fzngnn|m|e| 008 871211p19871957nyujzn d 024 1 _a4228332902 028 01 _a833 290-2 _bVerve 033 0 _a19571027 _b6299 _cD56 033 0 _a196112-- _b3804 _cN4 033 0 _a19571019 _b4104 _cC6 033 0 _a197107-- _b6299 _cV7 035 _a(OCoLC)17222092 040 _aCPL _cCPL _dOCL _dLGG 048 _apz01 _aka01 _asd01 _apd01 110 2 _aModern Jazz Quartet. _4prf 245 14 _aThe Modern Jazz Quartet plus _h[sound recording]. 260 _a[New York] : _bVerve, _cp1987. 300 _a1 sound disc : _bdigital ; _c4 3/4 in. 440 0 _aCompact jazz 511 0 _aModern Jazz Quartet (principally) ; Milt Jackson, vibraphone (2nd and 8th works) ; Oscar Peterson, piano (2nd and 8th works) ; Ray Brown, bass (2nd and 8th works) ; Ed Thigpen (2nd work), Louis Hayes (8th work), drums. 518 _aRecorded live, Oct. 27, 1957, at the Donaueschingen Jazz Festival (1st, 5th, 7th, and 10th works); Dec. 1961, in New York (2nd work); live, Oct. 19, 1957, at the Opera House, Chicago (3rd, 4th, 6th, and 9th works); July 1971, in Villingen, Germany (8th work). 500 _aCompact disc. 500 _aAnalog recording. 505 0 _aThe golden striker (4:08) -- On Green Dolphin Street (7:28) -- D & E (4:55) -- I'll remember April (4:51) -- Cortège (7:15) -- Now's the time (4:43) -- J.B. blues (5:09) -- Reunion blues (6:35) -- 'Round midnight (3:56) -- Three windows (7:20). 100 _aScott, Daniel. 650 0 _aJazz. 700 1 _aJackson, Milt. _4prf 700 1 _aPeterson, Oscar, _d1925- _4prf 700 1 _aBrown, Ray, _d1926-2002. _4prf 700 1 _aThigpen, Ed. _4prf 700 1 _aHayes, Louis, _d1937- _4prf 852 80 _bMUSIC _cAV _hCD 1131 _4Marvin Duchow Music _5Audio-Visual Insert a new 100 field after the first 650 Next record: LDR 01145ncm 2200277 i 4500 001 000073594 004 AAJ5802 005 20030415102100.0 008 801107s1977 nyujza 010 _a 77771106 035 _a(CaOTUIC)15460184 035 9 _aAAJ5802 040 _aLC 050 00 _aM1366 _b.M62 _dM1527.2 245 04 _aThe Modern Jazz Quartet : _bThe legendary profile. -- 260 _aNew York : _bM.J.Q. Music, _cc1977. 300 _ascore (72 p.) ; _c31 cm. 500 _aFor piano, vibraphone, drums, and double bass. 505 0 _aLewis, J. Django.--Lewis, J. Plastic dreams (music from the film Kemek).--Lewis, J. Dancing (music from the film Kemek).--Lewis, J. Blues in A minor.--Lewis, J. Blues in B♭.--Lewis, J. Precious joy.--Jackson, M. The martyr.--Jackson, M. The legendary profile. 650 0 _aJazz. 100 _aScott, Daniel. 650 0 _aMotion picture music _vExcerpts _vScores. 700 12 _aLewis, John, _d1920- _tSelections. _f1977. 700 12 _aJackson, Milt. _tMartyrs. _f1977. 700 12 _aJackson, Milt. _tLegendary profile. _f1977. 740 4 _aThe legendary profile. 852 00 _bMUSIC _cMAIN _kfolio _hM1366 _iM62 _91 _4Marvin Duchow Music _5 Next record: LDR 01293cjm 2200289 a 4500 001 001878039 005 20050110174900.0 007 sd fungnn|||e| 008 940202r19931981nyujzn i d 024 1 _a7464573372 028 02 _aJK 57337 _bRed Baron 035 _a(OCoLC)29737267 040 _aSVP _cSVP _dLGG 100 1 _aDesmond, Paul, _d1924- 245 10 _aPaul Desmond & the Modern Jazz Quartet _h[sound recording] 260 _aNew York, N.Y. : _bRed Baron : _bManufactured by Sony Music Entertainment, _cp1993. 300 _a1 sound disc (39 min.) : _bdigital ; _c4 3/4 in. 511 0 _aPaul Desmond, alto saxophone; Modern Jazz Quartet: John Lewis, piano; Milt Jackson, vibraphone; Percy Heath, bass; Connie Kay, drums. 500 _aAll arrangements by John Lewis. 518 _aRecorded live on December 25, 1971 at Town Hall, NYC. 500 _aOriginally released in 1981 by Finesse as LP FW 27487. 500 _aProgram notes by Irving Townsend, June 1981, on container insert. 505 0 _aGreensleeves -- You go to my head -- Blue dove -- Jesus Christ Superstar -- Here's that rainy day -- East of the sun -- Bags' new groove. 650 0 _aJazz _y1971-1980. 100 _aScott, Daniel. 700 1 _aLewis, John, _d1920- 710 2 _aModern Jazz Quartet. 740 0 _aPaul Desmond and the Modern Jazz Quartet. Next record: LDR 01829cjm 2200385 a 4500 001 001964482 005 20060626132700.0 007 sd fzngnn|m|e| 008 871211p19871957nyujzn d 024 1 _a4228332902 028 01 _a833 290-2 _bVerve 033 0 _a19571027 _b6299 _cD56 033 0 _a196112-- _b3804 _cN4 033 0 _a19571019 _b4104 _cC6 033 0 _a197107-- _b6299 _cV7 035 _a(OCoLC)17222092 040 _aCPL _cCPL _dOCL _dLGG 048 _apz01 _aka01 _asd01 _apd01 110 2 _aModern Jazz Quartet. _4prf 245 14 _aThe Modern Jazz Quartet plus _h[sound recording]. 260 _a[New York] : _bVerve, _cp1987. 300 _a1 sound disc : _bdigital ; _c4 3/4 in. 440 0 _aCompact jazz 511 0 _aModern Jazz Quartet (principally) ; Milt Jackson, vibraphone (2nd and 8th works) ; Oscar Peterson, piano (2nd and 8th works) ; Ray Brown, bass (2nd and 8th works) ; Ed Thigpen (2nd work), Louis Hayes (8th work), drums. 518 _aRecorded live, Oct. 27, 1957, at the Donaueschingen Jazz Festival (1st, 5th, 7th, and 10th works); Dec. 1961, in New York (2nd work); live, Oct. 19, 1957, at the Opera House, Chicago (3rd, 4th, 6th, and 9th works); July 1971, in Villingen, Germany (8th work). 500 _aCompact disc. 500 _aAnalog recording. 505 0 _aThe golden striker (4:08) -- On Green Dolphin Street (7:28) -- D & E (4:55) -- I'll remember April (4:51) -- Cortège (7:15) -- Now's the time (4:43) -- J.B. blues (5:09) -- Reunion blues (6:35) -- 'Round midnight (3:56) -- Three windows (7:20). 650 0 _aJazz. 100 _aScott, Daniel. 700 1 _aJackson, Milt. _4prf 700 1 _aPeterson, Oscar, _d1925- _4prf 700 1 _aBrown, Ray, _d1926-2002. _4prf 700 1 _aThigpen, Ed. _4prf 700 1 _aHayes, Louis, _d1937- _4prf 852 80 _bMUSIC _cAV _hCD 1131 _4Marvin Duchow Music _5Audio-Visual PK]\.ivvtests/sandburg.mrcnu[01142cam 2200301 a 4500001001300000003000400013005001700017008004100034010001700075020002500092040001800117042000900135050002600144082001600170100003200186245008600218250001200304260005200316300004900368500004000417520022800457650003300685650003300718650002400751650002100775650002300796700002100819 92005291 DLC19930521155141.9920219s1993 caua j 000 0 eng  a 92005291  a0152038655 :c$15.95 aDLCcDLCdDLC alcac00aPS3537.A618bA88 199300a811/.522201 aSandburg, Carl,d1878-1967.10aArithmetic /cCarl Sandburg ; illustrated as an anamorphic adventure by Ted Rand. a1st ed. aSan Diego :bHarcourt Brace Jovanovich,cc1993. a1 v. (unpaged) :bill. (some col.) ;c26 cm. aOne Mylar sheet included in pocket. aA poem about numbers and their characteristics. Features anamorphic, or distorted, drawings which can be restored to normal by viewing from a particular angle or by viewing the image's reflection in the provided Mylar cone. 0aArithmeticxJuvenile poetry. 0aChildren's poetry, American. 1aArithmeticxPoetry. 1aAmerican poetry. 1aVisual perception.1 aRand, Ted,eill.PK]E4kL tests/marc_001.phptnu[--TEST-- marc_001: iterate and pretty print a MARC record --SKIPIF-- --FILE-- next()) { print $marc_record; print "\n"; } ?> --EXPECT-- LDR 01850 2200517 4500 001 0000000044 003 EMILDA 008 980120s1998 fi j 000 0 swe 020 _a9515008808 _cFIM 72:00 035 _99515008808 040 _aNB 042 _9NB _9SEE 084 _aHcd,u _2kssb/6 084 _5NB _auHc _2kssb 084 _5SEE _aHcf _2kssb/6 084 _5Q _aHcd,uf _2kssb/6 100 1 _aJansson, Tove, _d1914-2001 245 04 _aDet osynliga barnet och andra berttelser / _cTove Jansson 250 _a7. uppl. 260 _aHelsingfors : _bSchildt, _c1998 ; _e(Falun : _fScandbook) 300 _a166, [4] s. : _bill. ; _c21 cm 440 0 _aMumin-biblioteket, _x99-0698931-9 500 _aOriginaluppl. 1962 599 _aLi: S 740 4 _aDet osynliga barnet 775 1 _z951-50-0385-7 _w9515003857 _907 841 _5Li _axa _b0201080u 0 4000uu |000000 _e1 841 _5SEE _axa _b0201080u 0 4000uu |000000 _e1 841 _5L _axa _b0201080u 0 4000uu |000000 _e1 841 _5NB _axa _b0201080u 0 4000uu |000000 _e1 841 _5Q _axa _b0201080u 0 4000uu |000000 _e1 841 _5S _axa _b0201080u 0 4000uu |000000 _e1 852 _5NB _bNB _cNB98:12 _hplikt _jR, 980520 852 _5Li _bLi _cCNB _hh,u 852 _5SEE _bSEE 852 _5Q _bQ _j98947 852 _5L _bL _c0100 _h98/ _j3043 H 852 _5S _bS _hSv97 _j7235 900 1s _aYanson, Tobe, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJanssonov, Tove, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJansone, Tuve, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJanson, Tuve, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJansson, Tuve, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJanssonova, Tove, _d1914-2001 _uJansson, Tove, _d1914-2001 976 2 _aHcd,u _bSknlitteratur 005 20050204111518.0 PK]#c tests/onerecord.xmlnu[ 01142cam 2200301 a 4500 92005291 DLC 19930521155141.9 920219s1993 caua j 000 0 eng 92005291 0152038655 : $15.95 DLC DLC DLC lcac PS3537.A618 A88 1993 811/.52 20 Sandburg, Carl, 1878-1967. Arithmetic / Carl Sandburg ; illustrated as an anamorphic adventure by Ted Rand. 1st ed. San Diego : Harcourt Brace Jovanovich, c1993. 1 v. (unpaged) : ill. (some col.) ; 26 cm. One Mylar sheet included in pocket. A poem about numbers and their characteristics. Features anamorphic, or distorted, drawings which can be restored to normal by viewing from a particular angle or by viewing the image's reflection in the provided Mylar cone. Arithmetic Juvenile poetry. Children's poetry, American. Arithmetic Poetry. American poetry. Visual perception. Rand, Ted, ill. PK]F-//tests/marc_field_002.phptnu[--TEST-- marc_field_002: Create fields with invalid indicators --SKIPIF-- --FILE-- getMessage()}\n"; } --EXPECT-- Error: Illegal indicator "$@" in field "100" forced to blank PK]rP  tests/marc_xml_004.phptnu[--TEST-- marc_xml_004: test conversion to XML of subfields that need to be escaped --SKIPIF-- --FILE-- next()) { print $marc_record->toXML(); print "\n"; } ?> --EXPECT-- 00727nam 2200205 a 4500 03-0016458 19971103184734.0 970701s1997 oru u000 0 eng u (Sirsi) a351664 ML270.2 .A6 1997 Anthony, James R. French baroque music from Beaujoyeulx to Rameau Rev. and expanded ed. Portland, OR : Amadeus Press, 1997. 586 p. : music Music France 16th century History and criticism. Music France 17th century History and criticism. Music France 18th century History and criticism. ML 270.2 A6 1997 LC 30007006841505 Y BOOKS HUNT-CIRC HUNTINGTON 1 PK]0Stests/marc_subfield_001.phptnu[--TEST-- marc_subfield_001: Exercise basic methods for File_MARC_Subfield class --SKIPIF-- --FILE-- getCode() . "\n"; print "Data: " . $subfield->getData() . "\n"; // test __toString implementation print $subfield; print "\n"; // test raw output implementation print $subfield->toRaw() . "\n"; // test isEmpty() if ($subfield->isEmpty()) { print "Subfield is empty\n"; } else { print "Subfield is not empty\n"; } ?> --EXPECT-- Code: a Data: wasssup [a]: wasssup awasssup Subfield is not empty PK].%``tests/marc_010.phptnu[--TEST-- marc_010: iterate and pretty print MARC records from a stream --SKIPIF-- --FILE-- next()) { print $marc_record; print "\n"; } ?> --EXPECT-- LDR 01145ncm 2200277 i 4500 001 000073594 004 AAJ5802 005 20030415102100.0 008 801107s1977 nyujza 010 _a 77771106 035 _a(CaOTUIC)15460184 035 9 _aAAJ5802 040 _aLC 050 00 _aM1366 _b.M62 _dM1527.2 245 04 _aThe Modern Jazz Quartet : _bThe legendary profile. -- 260 _aNew York : _bM.J.Q. Music, _cc1977. 300 _ascore (72 p.) ; _c31 cm. 500 _aFor piano, vibraphone, drums, and double bass. 505 0 _aLewis, J. Django.--Lewis, J. Plastic dreams (music from the film Kemek).--Lewis, J. Dancing (music from the film Kemek).--Lewis, J. Blues in A minor.--Lewis, J. Blues in B♭.--Lewis, J. Precious joy.--Jackson, M. The martyr.--Jackson, M. The legendary profile. 650 0 _aJazz. 650 0 _aMotion picture music _vExcerpts _vScores. 700 12 _aLewis, John, _d1920- _tSelections. _f1977. 700 12 _aJackson, Milt. _tMartyrs. _f1977. 700 12 _aJackson, Milt. _tLegendary profile. _f1977. 740 4 _aThe legendary profile. 852 00 _bMUSIC _cMAIN _kfolio _hM1366 _iM62 _91 _4Marvin Duchow Music _5 LDR 01293cjm 2200289 a 4500 001 001878039 005 20050110174900.0 007 sd fungnn|||e| 008 940202r19931981nyujzn i d 024 1 _a7464573372 028 02 _aJK 57337 _bRed Baron 035 _a(OCoLC)29737267 040 _aSVP _cSVP _dLGG 100 1 _aDesmond, Paul, _d1924- 245 10 _aPaul Desmond & the Modern Jazz Quartet _h[sound recording] 260 _aNew York, N.Y. : _bRed Baron : _bManufactured by Sony Music Entertainment, _cp1993. 300 _a1 sound disc (39 min.) : _bdigital ; _c4 3/4 in. 511 0 _aPaul Desmond, alto saxophone; Modern Jazz Quartet: John Lewis, piano; Milt Jackson, vibraphone; Percy Heath, bass; Connie Kay, drums. 500 _aAll arrangements by John Lewis. 518 _aRecorded live on December 25, 1971 at Town Hall, NYC. 500 _aOriginally released in 1981 by Finesse as LP FW 27487. 500 _aProgram notes by Irving Townsend, June 1981, on container insert. 505 0 _aGreensleeves -- You go to my head -- Blue dove -- Jesus Christ Superstar -- Here's that rainy day -- East of the sun -- Bags' new groove. 650 0 _aJazz _y1971-1980. 700 1 _aLewis, John, _d1920- 710 2 _aModern Jazz Quartet. 740 0 _aPaul Desmond and the Modern Jazz Quartet. LDR 01829cjm 2200385 a 4500 001 001964482 005 20060626132700.0 007 sd fzngnn|m|e| 008 871211p19871957nyujzn d 024 1 _a4228332902 028 01 _a833 290-2 _bVerve 033 0 _a19571027 _b6299 _cD56 033 0 _a196112-- _b3804 _cN4 033 0 _a19571019 _b4104 _cC6 033 0 _a197107-- _b6299 _cV7 035 _a(OCoLC)17222092 040 _aCPL _cCPL _dOCL _dLGG 048 _apz01 _aka01 _asd01 _apd01 110 2 _aModern Jazz Quartet. _4prf 245 14 _aThe Modern Jazz Quartet plus _h[sound recording]. 260 _a[New York] : _bVerve, _cp1987. 300 _a1 sound disc : _bdigital ; _c4 3/4 in. 440 0 _aCompact jazz 511 0 _aModern Jazz Quartet (principally) ; Milt Jackson, vibraphone (2nd and 8th works) ; Oscar Peterson, piano (2nd and 8th works) ; Ray Brown, bass (2nd and 8th works) ; Ed Thigpen (2nd work), Louis Hayes (8th work), drums. 518 _aRecorded live, Oct. 27, 1957, at the Donaueschingen Jazz Festival (1st, 5th, 7th, and 10th works); Dec. 1961, in New York (2nd work); live, Oct. 19, 1957, at the Opera House, Chicago (3rd, 4th, 6th, and 9th works); July 1971, in Villingen, Germany (8th work). 500 _aCompact disc. 500 _aAnalog recording. 505 0 _aThe golden striker (4:08) -- On Green Dolphin Street (7:28) -- D & E (4:55) -- I'll remember April (4:51) -- Cortège (7:15) -- Now's the time (4:43) -- J.B. blues (5:09) -- Reunion blues (6:35) -- 'Round midnight (3:56) -- Three windows (7:20). 650 0 _aJazz. 700 1 _aJackson, Milt. _4prf 700 1 _aPeterson, Oscar, _d1925- _4prf 700 1 _aBrown, Ray, _d1926-2002. _4prf 700 1 _aThigpen, Ed. _4prf 700 1 _aHayes, Louis, _d1937- _4prf 852 80 _bMUSIC _cAV _hCD 1131 _4Marvin Duchow Music _5Audio-Visual PK]_Xtests/marc_field_004.phptnu[--TEST-- marc_field_004: Add subfields to an existing field (corner case) --SKIPIF-- --FILE-- getSubfields('a'); // we might get an array back; in this case, we want the first subfield if (is_array($sf)) { $field->insertSubfield($subfield1, $sf[0], true); } else { $field->insertSubfield($subfield1, $sf, true); } // let's see the results print $field; print "\n"; ?> --EXPECT-- 100 0 _ga little _anothing _zeverything PK]2.i i tests/marc_018.phptnu[--TEST-- marc_018: iterate and print a MARC record to JSON MARC-HASH format --SKIPIF-- --FILE-- next()) { print $marc_record->toJSONHash(); print "\n"; } ?> --EXPECT-- {"type":"marc-hash","version":[1,0],"leader":"01850 2200517 4500","fields":[["001","0000000044"],["003","EMILDA"],["008","980120s1998 fi j 000 0 swe"],["020"," "," ",[["a","9515008808"],["c","FIM 72:00"]]],["035"," "," ",[["9","9515008808"]]],["040"," "," ",[["a","NB"]]],["042"," "," ",[["9","NB"],["9","SEE"]]],["084"," "," ",[["a","Hcd,u"],["2","kssb\/6"]]],["084"," "," ",[["5","NB"],["a","uHc"],["2","kssb"]]],["084"," "," ",[["5","SEE"],["a","Hcf"],["2","kssb\/6"]]],["084"," "," ",[["5","Q"],["a","Hcd,uf"],["2","kssb\/6"]]],["100","1"," ",[["a","Jansson, Tove,"],["d","1914-2001"]]],["245","0","4",[["a","Det osynliga barnet och andra ber\u00e4ttelser \/"],["c","Tove Jansson"]]],["250"," "," ",[["a","7. uppl."]]],["260"," "," ",[["a","Helsingfors :"],["b","Schildt,"],["c","1998 ;"],["e","(Falun :"],["f","Scandbook)"]]],["300"," "," ",[["a","166, [4] s. :"],["b","ill. ;"],["c","21 cm"]]],["440"," ","0",[["a","Mumin-biblioteket,"],["x","99-0698931-9"]]],["500"," "," ",[["a","Originaluppl. 1962"]]],["599"," "," ",[["a","Li: S"]]],["740","4"," ",[["a","Det osynliga barnet"]]],["775","1"," ",[["z","951-50-0385-7"],["w","9515003857"],["9","07"]]],["841"," "," ",[["5","Li"],["a","xa"],["b","0201080u 0 4000uu |000000"],["e","1"]]],["841"," "," ",[["5","SEE"],["a","xa"],["b","0201080u 0 4000uu |000000"],["e","1"]]],["841"," "," ",[["5","L"],["a","xa"],["b","0201080u 0 4000uu |000000"],["e","1"]]],["841"," "," ",[["5","NB"],["a","xa"],["b","0201080u 0 4000uu |000000"],["e","1"]]],["841"," "," ",[["5","Q"],["a","xa"],["b","0201080u 0 4000uu |000000"],["e","1"]]],["841"," "," ",[["5","S"],["a","xa"],["b","0201080u 0 4000uu |000000"],["e","1"]]],["852"," "," ",[["5","NB"],["b","NB"],["c","NB98:12"],["h","plikt"],["j","R, 980520"]]],["852"," "," ",[["5","Li"],["b","Li"],["c","CNB"],["h","h,u"]]],["852"," "," ",[["5","SEE"],["b","SEE"]]],["852"," "," ",[["5","Q"],["b","Q"],["j","98947"]]],["852"," "," ",[["5","L"],["b","L"],["c","0100"],["h","98\/"],["j","3043 H"]]],["852"," "," ",[["5","S"],["b","S"],["h","Sv97"],["j","7235"]]],["900","1","s",[["a","Yanson, Tobe,"],["d","1914-2001"],["u","Jansson, Tove,"],["d","1914-2001"]]],["900","1","s",[["a","Janssonov\u00e1, Tove,"],["d","1914-2001"],["u","Jansson, Tove,"],["d","1914-2001"]]],["900","1","s",[["a","Jansone, Tuve,"],["d","1914-2001"],["u","Jansson, Tove,"],["d","1914-2001"]]],["900","1","s",[["a","Janson, Tuve,"],["d","1914-2001"],["u","Jansson, Tove,"],["d","1914-2001"]]],["900","1","s",[["a","Jansson, Tuve,"],["d","1914-2001"],["u","Jansson, Tove,"],["d","1914-2001"]]],["900","1","s",[["a","Janssonova, Tove,"],["d","1914-2001"],["u","Jansson, Tove,"],["d","1914-2001"]]],["976"," ","2",[["a","Hcd,u"],["b","Sk\u00f6nlitteratur"]]],["005","20050204111518.0"]]} PK]!Ņ\tests/marc_xml_001.phptnu[--TEST-- marc_xml_001: iterate and pretty print a MARC record --SKIPIF-- --FILE-- next()) { /* Note that this adds characters to the leader to satisfy MARCXML schema */ print $marc_record->toXML(); print "\n"; } ?> --EXPECT-- 01850na 2200517 4500 0000000044 EMILDA 980120s1998 fi j 000 0 swe 9515008808 FIM 72:00 9515008808 NB NB SEE Hcd,u kssb/6 NB uHc kssb SEE Hcf kssb/6 Q Hcd,uf kssb/6 Jansson, Tove, 1914-2001 Det osynliga barnet och andra berttelser / Tove Jansson 7. uppl. Helsingfors : Schildt, 1998 ; (Falun : Scandbook) 166, [4] s. : ill. ; 21 cm Mumin-biblioteket, 99-0698931-9 Originaluppl. 1962 Li: S Det osynliga barnet 951-50-0385-7 9515003857 07 Li xa 0201080u 0 4000uu |000000 1 SEE xa 0201080u 0 4000uu |000000 1 L xa 0201080u 0 4000uu |000000 1 NB xa 0201080u 0 4000uu |000000 1 Q xa 0201080u 0 4000uu |000000 1 S xa 0201080u 0 4000uu |000000 1 NB NB NB98:12 plikt R, 980520 Li Li CNB h,u SEE SEE Q Q 98947 L L 0100 98/ 3043 H S S Sv97 7235 Yanson, Tobe, 1914-2001 Jansson, Tove, 1914-2001 Janssonov, Tove, 1914-2001 Jansson, Tove, 1914-2001 Jansone, Tuve, 1914-2001 Jansson, Tove, 1914-2001 Janson, Tuve, 1914-2001 Jansson, Tove, 1914-2001 Jansson, Tuve, 1914-2001 Jansson, Tove, 1914-2001 Janssonova, Tove, 1914-2001 Jansson, Tove, 1914-2001 Hcd,u Sknlitteratur 20050204111518.0 PK]<--tests/marc_subfield_002.phptnu[--TEST-- marc_subfield_002: Exercise setter and isEmpty() methods for File_MARC_Subfield class --SKIPIF-- --FILE-- isEmpty()) { print "empty.\n"; } else { print "not empty.\n"; } } $subfield = new File_MARC_Subfield('a', 'wasssup'); // test isEmpty() scenarios testEmpty($subfield); $subfield->setData(null); testEmpty($subfield); $subfield->setData('just hangin'); testEmpty($subfield); // test setCode() scenarios print "\nSet code to 'z'..."; if ($subfield->setCode('z')) { print "\n"; print $subfield; } print "\nSet code to ''..."; if ($subfield->setCode('')) { print "\n"; print $subfield; } print "\nSet code to null..."; if ($subfield->setCode(null)) { print "\n"; print $subfield; } ?> --EXPECT-- Subfield is not empty. Subfield is empty. Subfield is not empty. Set code to 'z'... [z]: just hangin Set code to ''... Set code to null... PK]_|6 6 tests/marc_lint_002.phptnu[--TEST-- marc_lint_002: Tests check041() and check043() called separately --SKIPIF-- --FILE-- check041($field); $field = new File_MARC_Data_Field( '041', array( new File_MARC_Subfield('a', 'endorviwo'), // invalid new File_MARC_Subfield('a', 'spanowpalasba') // too long and invalid ), "1", "" ); $marc_lint->check041($field); $field = new File_MARC_Data_Field( '043', array( new File_MARC_Subfield('a', 'n-----'), // 6 chars vs. 7 new File_MARC_Subfield('a', 'n-us----'), // 8 chars vs. 7 new File_MARC_Subfield('a', 'n-ma-us'), // invalid code new File_MARC_Subfield('a', 'e-ur-ai') // obsolete code ), "", "" ); $marc_lint->check043($field); ?> --EXPECT-- 041: Subfield _a, end (end), is not valid. 041: Subfield _a must be evenly divisible by 3 or exactly three characters if ind2 is not 7, (span). 041: Subfield _h, far, may be obsolete. 041: Subfield _a, endorviwo (end), is not valid. 041: Subfield _a, endorviwo (orv), is not valid. 041: Subfield _a, endorviwo (iwo), is not valid. 041: Subfield _a must be evenly divisible by 3 or exactly three characters if ind2 is not 7, (spanowpalasba). 043: Subfield _a must be exactly 7 characters, n----- 043: Subfield _a must be exactly 7 characters, n-us---- 043: Subfield _a, n-ma-us, is not valid. 043: Subfield _a, e-ur-ai, may be obsolete. PK]y tests/marc_lint_003.phptnu[--TEST-- marc_lint_003: Tests for field 880 and for subfield 6 --SKIPIF-- --FILE-- setLeader("00000nam 22002538a 4500"); $rec->appendField( new File_MARC_Control_Field( '001', 'ttt07000001 ' ) ); $rec->appendField( new File_MARC_Control_Field( '003', 'TEST ' ) ); $rec->appendField( new File_MARC_Control_Field( '008', '070520s2007 ilu 000 0 eng d' ) ); $rec->appendField( new File_MARC_Data_Field( '040', array( new File_MARC_Subfield('a', 'TEST'), new File_MARC_Subfield('c', 'TEST') ), "", "" ) ); $rec->appendField( new File_MARC_Data_Field( '050', array( new File_MARC_Subfield('a', 'RZ999'), new File_MARC_Subfield('b', '.J66 2007') ), "", "4" ) ); $rec->appendField( new File_MARC_Data_Field( '082', array( new File_MARC_Subfield('a', '615.8/9'), new File_MARC_Subfield('2', '22') ), "0", "4" ) ); $rec->appendField( new File_MARC_Data_Field( '100', array( new File_MARC_Subfield('a', 'Jones, John') ), "1", "" ) ); $rec->appendField( new File_MARC_Data_Field( '245', array( new File_MARC_Subfield('6', '880-02'), new File_MARC_Subfield('a', 'Test 880.') ), "1", "0" ) ); $rec->appendField( new File_MARC_Data_Field( '260', array( new File_MARC_Subfield('a', 'Mount Morris, Ill. :'), new File_MARC_Subfield('b', "B. Baldus,"), new File_MARC_Subfield('c', '2007.') ), "", "" ) ); $rec->appendField( new File_MARC_Data_Field( '300', array( new File_MARC_Subfield('a', '1 v. ;'), new File_MARC_Subfield('c', '23 cm.') ), "", "" ) ); $rec->appendField( new File_MARC_Data_Field( '880', array( new File_MARC_Subfield('6', '245-02/$1'), new File_MARC_Subfield('a', '.') ), "1", "0" ) ); $rec->appendField( new File_MARC_Data_Field( '880', array( new File_MARC_Subfield('6', '245-02/$1'), new File_MARC_Subfield('a', 'Illegal duplicate field.') ), "1", "0" ) ); $warnings = $marc_lint->checkRecord($rec); foreach ($warnings as $warning) { print $warning . "\n"; } ?> --EXPECT-- 245: Field is not repeatable. PK�����](Y������tests/xmlescape.mrcnu�[��������00727nam 2200205 a 450000100110000000500170001100800410002803500200006905000220008910000220011124500520013325000260018526000420021130000200025365000560027365000560032965000560038594900740044159600060051503-001645819971103184734.0970701s1997 oru u000 0 eng u a(Sirsi) a35166400aML270.2b.A6 19971 aAnthony, James R.00aFrench baroque music from Beaujoyeulx to Rameau aRev. and expanded ed. aPortland, OR :bAmadeus Press,c1997. a586 p. :bmusic 0aMusic<Francey16th centuryxHistory and criticism. 0aMusiczFrancey17th centuryxHistory and criticism. 0aMusiczFrancey18th centuryxHistory and criticism. aML 270.2 A6 1997wLCi30007006841505rYtBOOKSlHUNT-CIRCmHUNTINGTON a1 PK�����]~N0:��:����tests/example.mrcnu�[��������01850 2200517 45000010011000000030007000110080039000180200026000570350015000830400007000980420012001050840018001170840018001350840021001530840022001741000030001962450062002262500013002882600058003013000033003594400037003925000023004295990010004527400024004627750034004868410048005208410049005688410047006178410048006648410047007128410047007598520038008068520021008448520013008658520016008788520028008948520021009229000056009439000060009999000057010599000056011169000057011729000060012299760026012890050017013150000000044EMILDA980120s1998 fi j 000 0 swe a9515008808cFIM 72:00 99515008808 aNB 9NB9SEE aHcd,u2kssb/6 5NBauHc2kssb 5SEEaHcf2kssb/6 5QaHcd,uf2kssb/61 aJansson, Tove,d1914-200104aDet osynliga barnet och andra berttelser /cTove Jansson a7. uppl. aHelsingfors :bSchildt,c1998 ;e(Falun :fScandbook) a166, [4] s. :bill. ;c21 cm 0aMumin-biblioteket,x99-0698931-9 aOriginaluppl. 1962 aLi: S4 aDet osynliga barnet1 z951-50-0385-7w9515003857907 5Liaxab0201080u 0 4000uu |000000e1 5SEEaxab0201080u 0 4000uu |000000e1 5Laxab0201080u 0 4000uu |000000e1 5NBaxab0201080u 0 4000uu |000000e1 5Qaxab0201080u 0 4000uu |000000e1 5Saxab0201080u 0 4000uu |000000e1 5NBbNBcNB98:12hpliktjR, 980520 5LibLicCNBhh,u 5SEEbSEE 5QbQj98947 5LbLc0100h98/j3043 H 5SbShSv97j72351saYanson, Tobe,d1914-2001uJansson, Tove,d1914-20011saJanssonov, Tove,d1914-2001uJansson, Tove,d1914-20011saJansone, Tuve,d1914-2001uJansson, Tove,d1914-20011saJanson, Tuve,d1914-2001uJansson, Tove,d1914-20011saJansson, Tuve,d1914-2001uJansson, Tove,d1914-20011saJanssonova, Tove,d1914-2001uJansson, Tove,d1914-2001 2aHcd,ubSknlitteratur20050204111518.0PK�����]泮������tests/music.mrcnu�[��������01145ncm 2200277 i 4500001001000000004000800010005001700018008004100035010001700076035002200093035001200115040000700127050002500134245005700159260003800216300002800254500005100282505026600333650001000599650004400609700004400653700003600697700004600733740002700779852006100806000073594AAJ580220030415102100.0801107s1977 nyujza  a 77771106  a(CaOTUIC)154601849 aAAJ5802 aLC00aM1366b.M62dM1527.204aThe Modern Jazz Quartet :bThe legendary profile. -- aNew York :bM.J.Q. Music,cc1977. ascore (72 p.) ;c31 cm. aFor piano, vibraphone, drums, and double bass.0 aLewis, J. Django.--Lewis, J. Plastic dreams (music from the film Kemek).--Lewis, J. Dancing (music from the film Kemek).--Lewis, J. Blues in A minor.--Lewis, J. Blues in B♭.--Lewis, J. Precious joy.--Jackson, M. The martyr.--Jackson, M. The legendary profile. 0aJazz. 0aMotion picture musicvExcerptsvScores.12aLewis, John,d1920-tSelections.f1977.12aJackson, Milt.tMartyrs.f1977.12aJackson, Milt.tLegendary profile.f1977.4 aThe legendary profile.00bMUSICcMAINkfoliohM1366iM62914Marvin Duchow Music5 01293cjm 2200289 a 450000100100000000500170001000700150002700800410004202400150008302800240009803500200012204000180014210000260016024500620018626000850024830000510033351101380038450000360052251800580055850000590061650000700067550501420074565000210088770000240090871000250093274000460095700187803920050110174900.0sd fungnn|||e|940202r19931981nyujzn i d1 a746457337202aJK 57337bRed Baron a(OCoLC)29737267 aSVPcSVPdLGG1 aDesmond, Paul,d1924-10aPaul Desmond & the Modern Jazz Quarteth[sound recording] aNew York, N.Y. :bRed Baron :bManufactured by Sony Music Entertainment,cp1993. a1 sound disc (39 min.) :bdigital ;c4 3/4 in.0 aPaul Desmond, alto saxophone; Modern Jazz Quartet: John Lewis, piano; Milt Jackson, vibraphone; Percy Heath, bass; Connie Kay, drums. aAll arrangements by John Lewis. aRecorded live on December 25, 1971 at Town Hall, NYC. aOriginally released in 1981 by Finesse as LP FW 27487. aProgram notes by Irving Townsend, June 1981, on container insert.0 aGreensleeves -- You go to my head -- Blue dove -- Jesus Christ Superstar -- Here's that rainy day -- East of the sun -- Bags' new groove. 0aJazzy1971-1980.1 aLewis, John,d1920-2 aModern Jazz Quartet.0 aPaul Desmond and the Modern Jazz Quartet. 01829cjm 2200385 a 450000100100000000500170001000700150002700800410004202400150008302800210009803300240011903300230014303300230016603300230018903500200021204000230023204800270025511000300028224500530031226000330036530000410039844000170043951102230045651802640067950000180094350000220096150502500098365000100123370000240124370000330126770000330130070000220133370000300135585200580138500196448220060626132700.0sd fzngnn|m|e|871211p19871957nyujzn d1 a422833290201a833 290-2bVerve0 a19571027b6299cD560 a196112--b3804cN40 a19571019b4104cC60 a197107--b6299cV7 a(OCoLC)17222092 aCPLcCPLdOCLdLGG apz01aka01asd01apd012 aModern Jazz Quartet.4prf14aThe Modern Jazz Quartet plush[sound recording]. a[New York] :bVerve,cp1987. a1 sound disc :bdigital ;c4 3/4 in. 0aCompact jazz0 aModern Jazz Quartet (principally) ; Milt Jackson, vibraphone (2nd and 8th works) ; Oscar Peterson, piano (2nd and 8th works) ; Ray Brown, bass (2nd and 8th works) ; Ed Thigpen (2nd work), Louis Hayes (8th work), drums. aRecorded live, Oct. 27, 1957, at the Donaueschingen Jazz Festival (1st, 5th, 7th, and 10th works); Dec. 1961, in New York (2nd work); live, Oct. 19, 1957, at the Opera House, Chicago (3rd, 4th, 6th, and 9th works); July 1971, in Villingen, Germany (8th work). aCompact disc. aAnalog recording.0 aThe golden striker (4:08) -- On Green Dolphin Street (7:28) -- D & E (4:55) -- I'll remember April (4:51) -- Cortège (7:15) -- Now's the time (4:43) -- J.B. blues (5:09) -- Reunion blues (6:35) -- 'Round midnight (3:56) -- Three windows (7:20). 0aJazz.1 aJackson, Milt.4prf1 aPeterson, Oscar,d1925-4prf1 aBrown, Ray,d1926-2002.4prf1 aThigpen, Ed.4prf1 aHayes, Louis,d1937-4prf80bMUSICcAVhCD 11314Marvin Duchow Music5Audio-Visual PK�����]jS �� ����tests/marc_015.phptnu�[��������--TEST-- marc_015: ensure that pandemonium does not occur if a record doesn't have a given field --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARC($dir . '/' . 'music.mrc'); while ($marc_record = $marc_file->next()) { // Record #2 doesn't contain an 852; getField() returns false $mfhd = $marc_record->getField('852'); if ($mfhd) { $mfhd = $mfhd->getSubfield('b'); } print $marc_record; print "\n"; } ?> --EXPECT-- LDR 01145ncm 2200277 i 4500 001 000073594 004 AAJ5802 005 20030415102100.0 008 801107s1977 nyujza 010 _a 77771106 035 _a(CaOTUIC)15460184 035 9 _aAAJ5802 040 _aLC 050 00 _aM1366 _b.M62 _dM1527.2 245 04 _aThe Modern Jazz Quartet : _bThe legendary profile. -- 260 _aNew York : _bM.J.Q. Music, _cc1977. 300 _ascore (72 p.) ; _c31 cm. 500 _aFor piano, vibraphone, drums, and double bass. 505 0 _aLewis, J. Django.--Lewis, J. Plastic dreams (music from the film Kemek).--Lewis, J. Dancing (music from the film Kemek).--Lewis, J. Blues in A minor.--Lewis, J. Blues in B♭.--Lewis, J. Precious joy.--Jackson, M. The martyr.--Jackson, M. The legendary profile. 650 0 _aJazz. 650 0 _aMotion picture music _vExcerpts _vScores. 700 12 _aLewis, John, _d1920- _tSelections. _f1977. 700 12 _aJackson, Milt. _tMartyrs. _f1977. 700 12 _aJackson, Milt. _tLegendary profile. _f1977. 740 4 _aThe legendary profile. 852 00 _bMUSIC _cMAIN _kfolio _hM1366 _iM62 _91 _4Marvin Duchow Music _5 LDR 01293cjm 2200289 a 4500 001 001878039 005 20050110174900.0 007 sd fungnn|||e| 008 940202r19931981nyujzn i d 024 1 _a7464573372 028 02 _aJK 57337 _bRed Baron 035 _a(OCoLC)29737267 040 _aSVP _cSVP _dLGG 100 1 _aDesmond, Paul, _d1924- 245 10 _aPaul Desmond & the Modern Jazz Quartet _h[sound recording] 260 _aNew York, N.Y. : _bRed Baron : _bManufactured by Sony Music Entertainment, _cp1993. 300 _a1 sound disc (39 min.) : _bdigital ; _c4 3/4 in. 511 0 _aPaul Desmond, alto saxophone; Modern Jazz Quartet: John Lewis, piano; Milt Jackson, vibraphone; Percy Heath, bass; Connie Kay, drums. 500 _aAll arrangements by John Lewis. 518 _aRecorded live on December 25, 1971 at Town Hall, NYC. 500 _aOriginally released in 1981 by Finesse as LP FW 27487. 500 _aProgram notes by Irving Townsend, June 1981, on container insert. 505 0 _aGreensleeves -- You go to my head -- Blue dove -- Jesus Christ Superstar -- Here's that rainy day -- East of the sun -- Bags' new groove. 650 0 _aJazz _y1971-1980. 700 1 _aLewis, John, _d1920- 710 2 _aModern Jazz Quartet. 740 0 _aPaul Desmond and the Modern Jazz Quartet. LDR 01829cjm 2200385 a 4500 001 001964482 005 20060626132700.0 007 sd fzngnn|m|e| 008 871211p19871957nyujzn d 024 1 _a4228332902 028 01 _a833 290-2 _bVerve 033 0 _a19571027 _b6299 _cD56 033 0 _a196112-- _b3804 _cN4 033 0 _a19571019 _b4104 _cC6 033 0 _a197107-- _b6299 _cV7 035 _a(OCoLC)17222092 040 _aCPL _cCPL _dOCL _dLGG 048 _apz01 _aka01 _asd01 _apd01 110 2 _aModern Jazz Quartet. _4prf 245 14 _aThe Modern Jazz Quartet plus _h[sound recording]. 260 _a[New York] : _bVerve, _cp1987. 300 _a1 sound disc : _bdigital ; _c4 3/4 in. 440 0 _aCompact jazz 511 0 _aModern Jazz Quartet (principally) ; Milt Jackson, vibraphone (2nd and 8th works) ; Oscar Peterson, piano (2nd and 8th works) ; Ray Brown, bass (2nd and 8th works) ; Ed Thigpen (2nd work), Louis Hayes (8th work), drums. 518 _aRecorded live, Oct. 27, 1957, at the Donaueschingen Jazz Festival (1st, 5th, 7th, and 10th works); Dec. 1961, in New York (2nd work); live, Oct. 19, 1957, at the Opera House, Chicago (3rd, 4th, 6th, and 9th works); July 1971, in Villingen, Germany (8th work). 500 _aCompact disc. 500 _aAnalog recording. 505 0 _aThe golden striker (4:08) -- On Green Dolphin Street (7:28) -- D & E (4:55) -- I'll remember April (4:51) -- Cortège (7:15) -- Now's the time (4:43) -- J.B. blues (5:09) -- Reunion blues (6:35) -- 'Round midnight (3:56) -- Three windows (7:20). 650 0 _aJazz. 700 1 _aJackson, Milt. _4prf 700 1 _aPeterson, Oscar, _d1925- _4prf 700 1 _aBrown, Ray, _d1926-2002. _4prf 700 1 _aThigpen, Ed. _4prf 700 1 _aHayes, Louis, _d1937- _4prf 852 80 _bMUSIC _cAV _hCD 1131 _4Marvin Duchow Music _5Audio-Visual PK�����]a!������tests/namespace.xmlnu�[��������<?xml version="1.0" encoding="UTF-8"?> <!-- edited with XML Spy v4.3 U (http://www.xmlspy.com) by Morgan Cundiff (Library of Congress) --> <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> <marc:leader>00925njm 22002777a 4500</marc:leader> <marc:controlfield tag="001">5637241</marc:controlfield> <marc:controlfield tag="003">DLC</marc:controlfield> <marc:controlfield tag="005">19920826084036.0</marc:controlfield> <marc:controlfield tag="007">sdubumennmplu</marc:controlfield> <marc:controlfield tag="008">910926s1957 nyuuun eng </marc:controlfield> <marc:datafield tag="010" ind1=" " ind2=" "> <marc:subfield code="a"> 91758335 </marc:subfield> </marc:datafield> <marc:datafield tag="028" ind1="0" ind2="0"> <marc:subfield code="a">1259</marc:subfield> <marc:subfield code="b">Atlantic</marc:subfield> </marc:datafield> <marc:datafield tag="040" ind1=" " ind2=" "> <marc:subfield code="a">DLC</marc:subfield> <marc:subfield code="c">DLC</marc:subfield> </marc:datafield> <marc:datafield tag="050" ind1="0" ind2="0"> <marc:subfield code="a">Atlantic 1259</marc:subfield> </marc:datafield> <marc:datafield tag="245" ind1="0" ind2="4"> <marc:subfield code="a">The Great Ray Charles</marc:subfield> <marc:subfield code="h">[sound recording].</marc:subfield> </marc:datafield> <marc:datafield tag="260" ind1=" " ind2=" "> <marc:subfield code="a">New York, N.Y. :</marc:subfield> <marc:subfield code="b">Atlantic,</marc:subfield> <marc:subfield code="c">[1957?]</marc:subfield> </marc:datafield> <marc:datafield tag="300" ind1=" " ind2=" "> <marc:subfield code="a">1 sound disc :</marc:subfield> <marc:subfield code="b">analog, 33 1/3 rpm ;</marc:subfield> <marc:subfield code="c">12 in.</marc:subfield> </marc:datafield> <marc:datafield tag="511" ind1="0" ind2=" "> <marc:subfield code="a">Ray Charles, piano & celeste.</marc:subfield> </marc:datafield> <marc:datafield tag="505" ind1="0" ind2=" "> <marc:subfield code="a">The Ray -- My melancholy baby -- Black coffee -- There's no you -- Doodlin' -- Sweet sixteen bars -- I surrender dear -- Undecided.</marc:subfield> </marc:datafield> <marc:datafield tag="500" ind1=" " ind2=" "> <marc:subfield code="a">Brief record.</marc:subfield> </marc:datafield> <marc:datafield tag="650" ind1=" " ind2="0"> <marc:subfield code="a">Jazz</marc:subfield> <marc:subfield code="y">1951-1960.</marc:subfield> </marc:datafield> <marc:datafield tag="650" ind1=" " ind2="0"> <marc:subfield code="a">Piano with jazz ensemble.</marc:subfield> </marc:datafield> <marc:datafield tag="700" ind1="1" ind2=" "> <marc:subfield code="a">Charles, Ray,</marc:subfield> <marc:subfield code="d">1930-</marc:subfield> <marc:subfield code="4">prf</marc:subfield> </marc:datafield> </marc:record> <marc:record> <marc:leader>01832cmma 2200349 a 4500</marc:leader> <marc:controlfield tag="001">12149120</marc:controlfield> <marc:controlfield tag="005">20001005175443.0</marc:controlfield> <marc:controlfield tag="007">cr |||</marc:controlfield> <marc:controlfield tag="008">000407m19949999dcu g m eng d</marc:controlfield> <marc:datafield tag="906" ind1=" " ind2=" "> <marc:subfield code="a">0</marc:subfield> <marc:subfield code="b">ibc</marc:subfield> <marc:subfield code="c">copycat</marc:subfield> <marc:subfield code="d">1</marc:subfield> <marc:subfield code="e">ncip</marc:subfield> <marc:subfield code="f">20</marc:subfield> <marc:subfield code="g">y-gencompf</marc:subfield> </marc:datafield> <marc:datafield tag="925" ind1="0" ind2=" "> <marc:subfield code="a">undetermined</marc:subfield> <marc:subfield code="x">web preservation project (wpp)</marc:subfield> </marc:datafield> <marc:datafield tag="955" ind1=" " ind2=" "> <marc:subfield code="a">vb07 (stars done) 08-19-00 to HLCD lk00; AA3s lk29 received for subject Aug 25, 2000; to DEWEY 08-25-00; aa11 08-28-00</marc:subfield> </marc:datafield> <marc:datafield tag="010" ind1=" " ind2=" "> <marc:subfield code="a"> 00530046 </marc:subfield> </marc:datafield> <marc:datafield tag="035" ind1=" " ind2=" "> <marc:subfield code="a">(OCoLC)ocm44279786</marc:subfield> </marc:datafield> <marc:datafield tag="040" ind1=" " ind2=" "> <marc:subfield code="a">IEU</marc:subfield> <marc:subfield code="c">IEU</marc:subfield> <marc:subfield code="d">N@F</marc:subfield> <marc:subfield code="d">DLC</marc:subfield> </marc:datafield> <marc:datafield tag="042" ind1=" " ind2=" "> <marc:subfield code="a">lccopycat</marc:subfield> </marc:datafield> <marc:datafield tag="043" ind1=" " ind2=" "> <marc:subfield code="a">n-us-dc</marc:subfield> <marc:subfield code="a">n-us---</marc:subfield> </marc:datafield> <marc:datafield tag="050" ind1="0" ind2="0"> <marc:subfield code="a">F204.W5</marc:subfield> </marc:datafield> <marc:datafield tag="082" ind1="1" ind2="0"> <marc:subfield code="a">975.3</marc:subfield> <marc:subfield code="2">13</marc:subfield> </marc:datafield> <marc:datafield tag="245" ind1="0" ind2="4"> <marc:subfield code="a">The White House</marc:subfield> <marc:subfield code="h">[computer file].</marc:subfield> </marc:datafield> <marc:datafield tag="256" ind1=" " ind2=" "> <marc:subfield code="a">Computer data.</marc:subfield> </marc:datafield> <marc:datafield tag="260" ind1=" " ind2=" "> <marc:subfield code="a">Washington, D.C. :</marc:subfield> <marc:subfield code="b">White House Web Team,</marc:subfield> <marc:subfield code="c">1994-</marc:subfield> </marc:datafield> <marc:datafield tag="538" ind1=" " ind2=" "> <marc:subfield code="a">Mode of access: Internet.</marc:subfield> </marc:datafield> <marc:datafield tag="500" ind1=" " ind2=" "> <marc:subfield code="a">Title from home page as viewed on Aug. 19, 2000.</marc:subfield> </marc:datafield> <marc:datafield tag="520" ind1="8" ind2=" "> <marc:subfield code="a">Features the White House. Highlights the Executive Office of the President, which includes senior policy advisors and offices responsible for the President's correspondence and communications, the Office of the Vice President, and the Office of the First Lady. Posts contact information via mailing address, telephone and fax numbers, and e-mail. Contains the Interactive Citizens' Handbook with information on health, travel and tourism, education and training, and housing. Provides a tour and the history of the White House. Links to White House for Kids.</marc:subfield> </marc:datafield> <marc:datafield tag="610" ind1="2" ind2="0"> <marc:subfield code="a">White House (Washington, D.C.)</marc:subfield> </marc:datafield> <marc:datafield tag="610" ind1="1" ind2="0"> <marc:subfield code="a">United States.</marc:subfield> <marc:subfield code="b">Executive Office of the President.</marc:subfield> </marc:datafield> <marc:datafield tag="610" ind1="1" ind2="0"> <marc:subfield code="a">United States.</marc:subfield> <marc:subfield code="b">Office of the Vice President.</marc:subfield> </marc:datafield> <marc:datafield tag="610" ind1="1" ind2="0"> <marc:subfield code="a">United States.</marc:subfield> <marc:subfield code="b">Office of the First Lady.</marc:subfield> </marc:datafield> <marc:datafield tag="710" ind1="2" ind2=" "> <marc:subfield code="a">White House Web Team.</marc:subfield> </marc:datafield> <marc:datafield tag="856" ind1="4" ind2="0"> <marc:subfield code="u">http://www.whitehouse.gov</marc:subfield> </marc:datafield> <marc:datafield tag="856" ind1="4" ind2="0"> <marc:subfield code="u">http://lcweb.loc.gov/staff/wpp/whitehouse.html</marc:subfield> <marc:subfield code="z">Web site archive</marc:subfield> </marc:datafield> </marc:record> </marc:collection>PK�����]}& G��G����tests/marc_lint_004.phptnu�[��������--TEST-- marc_lint_004: Tests check_245() called separately --SKIPIF-- <?php include('tests/skipif.inc'); ?> <?php include('tests/skipif_noispn.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; // Create test harness to allow direct calls to check methods: class File_MARC_Lint_Test_Harness extends File_MARC_Lint { public function check245($field) { return parent::check245($field); } // override warn method to echo instead of store in object: protected function warn($msg) { echo $msg . "\n"; } } $marc_lint = new File_MARC_Lint_Test_Harness(); $testData = array( array(245, '0', '0', 'a', 'Subfield a.'), array(245, '0', '0', 'b', 'no subfield a.'), array(245, '0', '0', 'a', 'No period at end'), array(245, '0', '0', 'a', 'Other punctuation not followed by period!'), array(245, '0', '0', 'a', 'Other punctuation not followed by period?'), array(245, '0', '0', 'a', 'Precedes sub c', 'c', 'not preceded by space-slash.'), array(245, '0', '0', 'a', 'Precedes sub c/', 'c', 'not preceded by space-slash.'), array(245, '0', '0', 'a', 'Precedes sub c /', 'c', 'initials in sub c B. B.'), array(245, '0', '0', 'a', 'Precedes sub c /', 'c', 'initials in sub c B.B. (no warning).'), array(245, '0', '0', 'a', 'Precedes sub b', 'b', 'not preceded by proper punctuation.'), array(245, '0', '0', 'a', 'Precedes sub b=', 'b', 'not preceded by proper punctuation.'), array(245, '0', '0', 'a', 'Precedes sub b:', 'b', 'not preceded by proper punctuation.'), array(245, '0', '0', 'a', 'Precedes sub b;', 'b', 'not preceded by proper punctuation.'), array(245, '0', '0', 'a', 'Precedes sub b =', 'b', 'preceded by proper punctuation.'), array(245, '0', '0', 'a', 'Precedes sub b :', 'b', 'preceded by proper punctuation.'), array(245, '0', '0', 'a', 'Precedes sub b ;', 'b', 'preceded by proper punctuation.'), array(245, '0', '0', 'a', 'Precedes sub h ', 'h', '[videorecording].'), array(245, '0', '0', 'a', 'Precedes sub h-- ', 'h', '[videorecording] :', 'b', 'with elipses dash before h.'), array(245, '0', '0', 'a', 'Precedes sub h-- ', 'h', 'videorecording :', 'b', 'without brackets around GMD.'), array(245, '0', '0', 'a', 'Precedes sub n.', 'n', 'Number 1.'), array(245, '0', '0', 'a', 'Precedes sub n', 'n', 'Number 2.'), array(245, '0', '0', 'a', 'Precedes sub n.', 'n', 'Number 3.', 'p', 'Sub n has period not comma.'), array(245, '0', '0', 'a', 'Precedes sub n.', 'n', 'Number 3,', 'p', 'Sub n has comma.'), array(245, '0', '0', 'a', 'Precedes sub p.', 'p', 'Sub a has period.'), array(245, '0', '0', 'a', 'Precedes sub p', 'p', 'Sub a has no period.'), array(245, '0', 'a', 'a', 'Invalid filing indicator.'), array(245, '0', '0', 'a', 'The article.'), array(245, '0', '4', 'a', 'The article.'), array(245, '0', '2', 'a', 'An article.'), array(245, '0', '0', 'a', "L'article."), array(245, '0', '2', 'a', 'A la mode.'), array(245, '0', '5', 'a', 'The "quoted article".'), array(245, '0', '5', 'a', 'The (parenthetical article).'), array(245, '0', '6', 'a', '(The) article in parentheses).'), array(245, '0', '9', 'a', "\"(The)\" 'article' in quotes and parentheses)."), array(245, '0', '5', 'a', '[The supplied title].') ); foreach ($testData as $current) { $subfields = array(); for ($i = 3; $i < count($current); $i+=2) { $subfields[] = new File_MARC_Subfield($current[$i], $current[$i+1]); } $field = new File_MARC_Data_Field( $current[0], $subfields, $current[1], $current[2] ); $marc_lint->check245($field); } ?> --EXPECT-- 245: Must have a subfield _a. 245: First subfield must be _a, but it is _b 245: Must end with . (period). 245: MARC21 allows ? or ! as final punctuation but LCRI 1.0C, Nov. 2003 (LCPS 1.7.1 for RDA records), requires period. 245: MARC21 allows ? or ! as final punctuation but LCRI 1.0C, Nov. 2003 (LCPS 1.7.1 for RDA records), requires period. 245: Subfield _c must be preceded by / 245: Subfield _c must be preceded by / 245: Subfield _c initials should not have a space. 245: Subfield _b should be preceded by space-colon, space-semicolon, or space-equals sign. 245: Subfield _b should be preceded by space-colon, space-semicolon, or space-equals sign. 245: Subfield _b should be preceded by space-colon, space-semicolon, or space-equals sign. 245: Subfield _b should be preceded by space-colon, space-semicolon, or space-equals sign. 245: Subfield _h should not be preceded by space. 245: Subfield _h must have matching square brackets, videorecording :. 245: Subfield _n must be preceded by . (period). 245: Subfield _p must be preceded by , (comma) when it follows subfield _n. 245: Subfield _p must be preceded by . (period) when it follows a subfield other than _n. 245: Non-filing indicator is non-numeric 245: First word, the, may be an article, check 2nd indicator (0). 245: First word, an, may be an article, check 2nd indicator (2). 245: First word, l, may be an article, check 2nd indicator (0). 245: First word, a, does not appear to be an article, check 2nd indicator (2). PK�����]2��������tests/skipif.incnu�[��������<?php // Stash the current error_reporting value $error_reporting = error_reporting(); // Restore the error reporting to previous value error_reporting($error_reporting); ?> PK�����]9D��D����tests/marc_017.phptnu�[��������--TEST-- marc_017: iterate and print a MARC record to JSON format --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARC($dir . '/' . 'example.mrc'); while ($marc_record = $marc_file->next()) { print $marc_record->toJSON(); print "\n"; } ?> --EXPECT-- {"leader":"01850 2200517 4500","fields":[{"001":"0000000044"},{"003":"EMILDA"},{"008":"980120s1998 fi j 000 0 swe"},{"020":{"ind1":" ","ind2":" ","subfields":[{"a":"9515008808"},{"c":"FIM 72:00"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"9":"9515008808"}]}},{"040":{"ind1":" ","ind2":" ","subfields":[{"a":"NB"}]}},{"042":{"ind1":" ","ind2":" ","subfields":[{"9":"NB"},{"9":"SEE"}]}},{"084":{"ind1":" ","ind2":" ","subfields":[{"a":"Hcd,u"},{"2":"kssb\/6"}]}},{"084":{"ind1":" ","ind2":" ","subfields":[{"5":"NB"},{"a":"uHc"},{"2":"kssb"}]}},{"084":{"ind1":" ","ind2":" ","subfields":[{"5":"SEE"},{"a":"Hcf"},{"2":"kssb\/6"}]}},{"084":{"ind1":" ","ind2":" ","subfields":[{"5":"Q"},{"a":"Hcd,uf"},{"2":"kssb\/6"}]}},{"100":{"ind1":"1","ind2":" ","subfields":[{"a":"Jansson, Tove,"},{"d":"1914-2001"}]}},{"245":{"ind1":"0","ind2":"4","subfields":[{"a":"Det osynliga barnet och andra ber\u00e4ttelser \/"},{"c":"Tove Jansson"}]}},{"250":{"ind1":" ","ind2":" ","subfields":[{"a":"7. uppl."}]}},{"260":{"ind1":" ","ind2":" ","subfields":[{"a":"Helsingfors :"},{"b":"Schildt,"},{"c":"1998 ;"},{"e":"(Falun :"},{"f":"Scandbook)"}]}},{"300":{"ind1":" ","ind2":" ","subfields":[{"a":"166, [4] s. :"},{"b":"ill. ;"},{"c":"21 cm"}]}},{"440":{"ind1":" ","ind2":"0","subfields":[{"a":"Mumin-biblioteket,"},{"x":"99-0698931-9"}]}},{"500":{"ind1":" ","ind2":" ","subfields":[{"a":"Originaluppl. 1962"}]}},{"599":{"ind1":" ","ind2":" ","subfields":[{"a":"Li: S"}]}},{"740":{"ind1":"4","ind2":" ","subfields":[{"a":"Det osynliga barnet"}]}},{"775":{"ind1":"1","ind2":" ","subfields":[{"z":"951-50-0385-7"},{"w":"9515003857"},{"9":"07"}]}},{"841":{"ind1":" ","ind2":" ","subfields":[{"5":"Li"},{"a":"xa"},{"b":"0201080u 0 4000uu |000000"},{"e":"1"}]}},{"841":{"ind1":" ","ind2":" ","subfields":[{"5":"SEE"},{"a":"xa"},{"b":"0201080u 0 4000uu |000000"},{"e":"1"}]}},{"841":{"ind1":" ","ind2":" ","subfields":[{"5":"L"},{"a":"xa"},{"b":"0201080u 0 4000uu |000000"},{"e":"1"}]}},{"841":{"ind1":" ","ind2":" ","subfields":[{"5":"NB"},{"a":"xa"},{"b":"0201080u 0 4000uu |000000"},{"e":"1"}]}},{"841":{"ind1":" ","ind2":" ","subfields":[{"5":"Q"},{"a":"xa"},{"b":"0201080u 0 4000uu |000000"},{"e":"1"}]}},{"841":{"ind1":" ","ind2":" ","subfields":[{"5":"S"},{"a":"xa"},{"b":"0201080u 0 4000uu |000000"},{"e":"1"}]}},{"852":{"ind1":" ","ind2":" ","subfields":[{"5":"NB"},{"b":"NB"},{"c":"NB98:12"},{"h":"plikt"},{"j":"R, 980520"}]}},{"852":{"ind1":" ","ind2":" ","subfields":[{"5":"Li"},{"b":"Li"},{"c":"CNB"},{"h":"h,u"}]}},{"852":{"ind1":" ","ind2":" ","subfields":[{"5":"SEE"},{"b":"SEE"}]}},{"852":{"ind1":" ","ind2":" ","subfields":[{"5":"Q"},{"b":"Q"},{"j":"98947"}]}},{"852":{"ind1":" ","ind2":" ","subfields":[{"5":"L"},{"b":"L"},{"c":"0100"},{"h":"98\/"},{"j":"3043 H"}]}},{"852":{"ind1":" ","ind2":" ","subfields":[{"5":"S"},{"b":"S"},{"h":"Sv97"},{"j":"7235"}]}},{"900":{"ind1":"1","ind2":"s","subfields":[{"a":"Yanson, Tobe,"},{"d":"1914-2001"},{"u":"Jansson, Tove,"},{"d":"1914-2001"}]}},{"900":{"ind1":"1","ind2":"s","subfields":[{"a":"Janssonov\u00e1, Tove,"},{"d":"1914-2001"},{"u":"Jansson, Tove,"},{"d":"1914-2001"}]}},{"900":{"ind1":"1","ind2":"s","subfields":[{"a":"Jansone, Tuve,"},{"d":"1914-2001"},{"u":"Jansson, Tove,"},{"d":"1914-2001"}]}},{"900":{"ind1":"1","ind2":"s","subfields":[{"a":"Janson, Tuve,"},{"d":"1914-2001"},{"u":"Jansson, Tove,"},{"d":"1914-2001"}]}},{"900":{"ind1":"1","ind2":"s","subfields":[{"a":"Jansson, Tuve,"},{"d":"1914-2001"},{"u":"Jansson, Tove,"},{"d":"1914-2001"}]}},{"900":{"ind1":"1","ind2":"s","subfields":[{"a":"Janssonova, Tove,"},{"d":"1914-2001"},{"u":"Jansson, Tove,"},{"d":"1914-2001"}]}},{"976":{"ind1":" ","ind2":"2","subfields":[{"a":"Hcd,u"},{"b":"Sk\u00f6nlitteratur"}]}},{"005":"20050204111518.0"}]} PK�����]������tests/marc_xml_namespace.phptnu�[��������--TEST-- marc_xml_namespace: iterate and pretty print a MARC record --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARCXML($dir . '/' . 'namespace.xml',File_MARC::SOURCE_FILE,"http://www.loc.gov/MARC21/slim"); while ($marc_record = $marc_file->next()) { print $marc_record->getLeader(); print "\n"; $field = $marc_record->getField('050'); print $field->getIndicator(1); print "\n"; print $field->getIndicator(2); print "\n"; $subfield = $field->getSubfield('a'); print $subfield->getData(); print "\n"; } ?> --EXPECT-- 00925njm 22002777a 4500 0 0 Atlantic 1259 01832cmma 2200349 a 4500 0 0 F204.W5 PK�����]`������tests/marc_012.phptnu�[��������--TEST-- marc_012: test isControlField() and isDataField() convenience methods --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARC($dir . '/' . 'music.mrc'); while ($marc_record = $marc_file->next()) { $fields = $marc_record->getFields(); foreach ($fields as $field) { print $field->getTag(); if ($field->isControlField()) { print "\tControl field!"; } if ($field->isDataField()) { print "\tData field!"; } print "\n"; } } ?> --EXPECT-- 001 Control field! 004 Control field! 005 Control field! 008 Control field! 010 Data field! 035 Data field! 035 Data field! 040 Data field! 050 Data field! 245 Data field! 260 Data field! 300 Data field! 500 Data field! 505 Data field! 650 Data field! 650 Data field! 700 Data field! 700 Data field! 700 Data field! 740 Data field! 852 Data field! 001 Control field! 005 Control field! 007 Control field! 008 Control field! 024 Data field! 028 Data field! 035 Data field! 040 Data field! 100 Data field! 245 Data field! 260 Data field! 300 Data field! 511 Data field! 500 Data field! 518 Data field! 500 Data field! 500 Data field! 505 Data field! 650 Data field! 700 Data field! 710 Data field! 740 Data field! 001 Control field! 005 Control field! 007 Control field! 008 Control field! 024 Data field! 028 Data field! 033 Data field! 033 Data field! 033 Data field! 033 Data field! 035 Data field! 040 Data field! 048 Data field! 110 Data field! 245 Data field! 260 Data field! 300 Data field! 440 Data field! 511 Data field! 518 Data field! 500 Data field! 500 Data field! 505 Data field! 650 Data field! 700 Data field! 700 Data field! 700 Data field! 700 Data field! 700 Data field! 852 Data field! PK�����]cܯ������tests/marc_xml_006.phptnu�[��������--TEST-- marc_xml_006: test getFields() in XML --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; // Read MARC records from a stream (a file, in this case) $marc_source = new File_MARCXML($dir . '/' . 'sandburg.xml'); // Retrieve the first MARC record from the source $marc_record = $marc_source->next(); // Retrieve a personal name field from the record $names = $marc_record->getFields('100'); foreach ($names as $name_field) { // Now print the $a subfield switch ($name_field->getIndicator(1)) { case 0: print "Forename: "; break; case 1: print "Surname: "; break; case 2: print "Family name: "; break; } $name = $name_field->getSubfields('a'); if (count($name) == 1) { print $name[0]->getData() . "\n"; } else { print "Error -- \$a subfield appears more than once in this field!"; } } // Retrieve all subject and genre fields // Series statement fields start with a 6 (PCRE) $subjects = $marc_record->getFields('^6', true); // Iterate through all of the returned subject fields foreach ($subjects as $field) { // print with File_MARC_Field_Data's magic __toString() method print "$field\n"; } ?> --EXPECT-- Surname: Sandburg, Carl, 650 0 _aArithmetic _xJuvenile poetry. 650 0 _aChildren's poetry, American. 650 1 _aArithmetic _xPoetry. 650 1 _aAmerican poetry. 650 1 _aVisual perception. PK�����]c������tests/marc_xml_16642.phptnu�[��������--TEST-- marc_xml_16642: Fix bug 16642: ensure tag and subfield values are returned as strings --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; // Retrieve a set of MARC records from a file $marc_file = new File_MARCXML($dir . '/' . 'onerecord.xml'); // Iterate through the retrieved records while ($record = $marc_file->next()) { foreach ($record->getFields() as $tag => $subfields) { // Skip everything except for 650 fields if ($tag == '650') { print "Subject:"; foreach ($subfields->getSubfields() as $code => $value) { print " $value"; } print "\n"; } } } ?> --EXPECT-- Subject: [a]: Arithmetic [x]: Juvenile poetry. Subject: [a]: Children's poetry, American. Subject: [a]: Arithmetic [x]: Poetry. Subject: [a]: American poetry. Subject: [a]: Visual perception. PK�����]{ �� ����tests/marc_xml_rsinger.phptnu�[��������--TEST-- marc_xml_rsinger2: iterate and pretty print a non-compliant MARC record (uppercase subfield codes) --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARCXML($dir . '/' . 'bad_example.xml'); while ($marc_record = $marc_file->next()) { print $marc_record; print "\n"; } ?> --EXPECT-- LDR 01850 a2200517 4500 001 0000000044 003 EMILDA 008 980120s1998 fi j 000 0 swe 005 20050204111518.0 020 _a9515008808 _cFIM 72:00 035 _99515008808 040 _aNB 042 _9NB _9SEE 084 _aHcd,u _2kssb/6 084 _5NB _auHc _2kssb 084 _5SEE _aHcf _2kssb/6 084 _5Q _aHcd,uf _2kssb/6 100 1 _aJansson, Tove, _d1914-2001 245 0 _aDet osynliga barnet och andra bert̃telser / _cTove Jansson 250 _a7. uppl. 260 _aHelsingfors : _bSchildt, _c1998 ; _e(Falun : _fScandbook) 440 0 _aMumin-biblioteket, _x99-0698931-9 500 _aOriginaluppl. 1962 599 _aLi: S 740 4 _aDet osynliga barnet 775 1 _z951-50-0385-7 _w9515003857 _907 841 _5Li _axa _b0201080u 0 4000uu |000000 _e1 841 _5SEE _axa _b0201080u 0 4000uu |000000 _e1 841 _5L _axa _b0201080u 0 4000uu |000000 _e1 841 _5NB _axa _b0201080u 0 4000uu |000000 _e1 841 _5Q _axa _b0201080u 0 4000uu |000000 _e1 841 _5S _axa _b0201080u 0 4000uu |000000 _e1 852 _5NB _bNB _cNB98:12 _hplikt _jR, 980520 852 _5Li _bLi _cCNB _hh,u 852 _5SEE _bSEE 852 _5Q _bQ _j98947 852 _5L _bL _c0100 _h98/ _j3043 H 852 _5S _bS _hSv97 _j7235 900 1s _aYanson, Tobe, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJanssonov,̀ Tove, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJansone, Tuve, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJanson, Tuve, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJansson, Tuve, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJanssonova, Tove, _d1914-2001 _uJansson, Tove, _d1914-2001 976 2 _aHcd,u _bSkn̲litteratur PK�����]F;Re%��e%����tests/marc_004.phptnu�[��������--TEST-- marc_004: Delete fields and subfields --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARC($dir . '/' . 'music.mrc'); print "\nDelete all fields with tag 650\n"; while ($marc_record = $marc_file->next()) { print "\nNext record:\n"; $fields = $marc_record->getFields('650'); foreach ($fields as $field) { $field->delete(); } print $marc_record; } $marc_file = null; $marc_file = new File_MARC($dir . '/' . 'music.mrc'); print "\nDelete all subfields with code 'a' from fields with tag 650\n"; while ($marc_record = $marc_file->next()) { print "\nNext record:\n"; $fields = $marc_record->getFields('650'); foreach ($fields as $field) { $sf = $field->getSubfields('a'); foreach ($sf as $subfield) { $field->deleteSubfield($subfield); } } print $marc_record; } ?> --EXPECT-- Delete all fields with tag 650 Next record: LDR 01145ncm 2200277 i 4500 001 000073594 004 AAJ5802 005 20030415102100.0 008 801107s1977 nyujza 010 _a 77771106 035 _a(CaOTUIC)15460184 035 9 _aAAJ5802 040 _aLC 050 00 _aM1366 _b.M62 _dM1527.2 245 04 _aThe Modern Jazz Quartet : _bThe legendary profile. -- 260 _aNew York : _bM.J.Q. Music, _cc1977. 300 _ascore (72 p.) ; _c31 cm. 500 _aFor piano, vibraphone, drums, and double bass. 505 0 _aLewis, J. Django.--Lewis, J. Plastic dreams (music from the film Kemek).--Lewis, J. Dancing (music from the film Kemek).--Lewis, J. Blues in A minor.--Lewis, J. Blues in B♭.--Lewis, J. Precious joy.--Jackson, M. The martyr.--Jackson, M. The legendary profile. 700 12 _aLewis, John, _d1920- _tSelections. _f1977. 700 12 _aJackson, Milt. _tMartyrs. _f1977. 700 12 _aJackson, Milt. _tLegendary profile. _f1977. 740 4 _aThe legendary profile. 852 00 _bMUSIC _cMAIN _kfolio _hM1366 _iM62 _91 _4Marvin Duchow Music _5 Next record: LDR 01293cjm 2200289 a 4500 001 001878039 005 20050110174900.0 007 sd fungnn|||e| 008 940202r19931981nyujzn i d 024 1 _a7464573372 028 02 _aJK 57337 _bRed Baron 035 _a(OCoLC)29737267 040 _aSVP _cSVP _dLGG 100 1 _aDesmond, Paul, _d1924- 245 10 _aPaul Desmond & the Modern Jazz Quartet _h[sound recording] 260 _aNew York, N.Y. : _bRed Baron : _bManufactured by Sony Music Entertainment, _cp1993. 300 _a1 sound disc (39 min.) : _bdigital ; _c4 3/4 in. 511 0 _aPaul Desmond, alto saxophone; Modern Jazz Quartet: John Lewis, piano; Milt Jackson, vibraphone; Percy Heath, bass; Connie Kay, drums. 500 _aAll arrangements by John Lewis. 518 _aRecorded live on December 25, 1971 at Town Hall, NYC. 500 _aOriginally released in 1981 by Finesse as LP FW 27487. 500 _aProgram notes by Irving Townsend, June 1981, on container insert. 505 0 _aGreensleeves -- You go to my head -- Blue dove -- Jesus Christ Superstar -- Here's that rainy day -- East of the sun -- Bags' new groove. 700 1 _aLewis, John, _d1920- 710 2 _aModern Jazz Quartet. 740 0 _aPaul Desmond and the Modern Jazz Quartet. Next record: LDR 01829cjm 2200385 a 4500 001 001964482 005 20060626132700.0 007 sd fzngnn|m|e| 008 871211p19871957nyujzn d 024 1 _a4228332902 028 01 _a833 290-2 _bVerve 033 0 _a19571027 _b6299 _cD56 033 0 _a196112-- _b3804 _cN4 033 0 _a19571019 _b4104 _cC6 033 0 _a197107-- _b6299 _cV7 035 _a(OCoLC)17222092 040 _aCPL _cCPL _dOCL _dLGG 048 _apz01 _aka01 _asd01 _apd01 110 2 _aModern Jazz Quartet. _4prf 245 14 _aThe Modern Jazz Quartet plus _h[sound recording]. 260 _a[New York] : _bVerve, _cp1987. 300 _a1 sound disc : _bdigital ; _c4 3/4 in. 440 0 _aCompact jazz 511 0 _aModern Jazz Quartet (principally) ; Milt Jackson, vibraphone (2nd and 8th works) ; Oscar Peterson, piano (2nd and 8th works) ; Ray Brown, bass (2nd and 8th works) ; Ed Thigpen (2nd work), Louis Hayes (8th work), drums. 518 _aRecorded live, Oct. 27, 1957, at the Donaueschingen Jazz Festival (1st, 5th, 7th, and 10th works); Dec. 1961, in New York (2nd work); live, Oct. 19, 1957, at the Opera House, Chicago (3rd, 4th, 6th, and 9th works); July 1971, in Villingen, Germany (8th work). 500 _aCompact disc. 500 _aAnalog recording. 505 0 _aThe golden striker (4:08) -- On Green Dolphin Street (7:28) -- D & E (4:55) -- I'll remember April (4:51) -- Cortège (7:15) -- Now's the time (4:43) -- J.B. blues (5:09) -- Reunion blues (6:35) -- 'Round midnight (3:56) -- Three windows (7:20). 700 1 _aJackson, Milt. _4prf 700 1 _aPeterson, Oscar, _d1925- _4prf 700 1 _aBrown, Ray, _d1926-2002. _4prf 700 1 _aThigpen, Ed. _4prf 700 1 _aHayes, Louis, _d1937- _4prf 852 80 _bMUSIC _cAV _hCD 1131 _4Marvin Duchow Music _5Audio-Visual Delete all subfields with code 'a' from fields with tag 650 Next record: LDR 01145ncm 2200277 i 4500 001 000073594 004 AAJ5802 005 20030415102100.0 008 801107s1977 nyujza 010 _a 77771106 035 _a(CaOTUIC)15460184 035 9 _aAAJ5802 040 _aLC 050 00 _aM1366 _b.M62 _dM1527.2 245 04 _aThe Modern Jazz Quartet : _bThe legendary profile. -- 260 _aNew York : _bM.J.Q. Music, _cc1977. 300 _ascore (72 p.) ; _c31 cm. 500 _aFor piano, vibraphone, drums, and double bass. 505 0 _aLewis, J. Django.--Lewis, J. Plastic dreams (music from the film Kemek).--Lewis, J. Dancing (music from the film Kemek).--Lewis, J. Blues in A minor.--Lewis, J. Blues in B♭.--Lewis, J. Precious joy.--Jackson, M. The martyr.--Jackson, M. The legendary profile. 650 0 _vExcerpts _vScores. 700 12 _aLewis, John, _d1920- _tSelections. _f1977. 700 12 _aJackson, Milt. _tMartyrs. _f1977. 700 12 _aJackson, Milt. _tLegendary profile. _f1977. 740 4 _aThe legendary profile. 852 00 _bMUSIC _cMAIN _kfolio _hM1366 _iM62 _91 _4Marvin Duchow Music _5 Next record: LDR 01293cjm 2200289 a 4500 001 001878039 005 20050110174900.0 007 sd fungnn|||e| 008 940202r19931981nyujzn i d 024 1 _a7464573372 028 02 _aJK 57337 _bRed Baron 035 _a(OCoLC)29737267 040 _aSVP _cSVP _dLGG 100 1 _aDesmond, Paul, _d1924- 245 10 _aPaul Desmond & the Modern Jazz Quartet _h[sound recording] 260 _aNew York, N.Y. : _bRed Baron : _bManufactured by Sony Music Entertainment, _cp1993. 300 _a1 sound disc (39 min.) : _bdigital ; _c4 3/4 in. 511 0 _aPaul Desmond, alto saxophone; Modern Jazz Quartet: John Lewis, piano; Milt Jackson, vibraphone; Percy Heath, bass; Connie Kay, drums. 500 _aAll arrangements by John Lewis. 518 _aRecorded live on December 25, 1971 at Town Hall, NYC. 500 _aOriginally released in 1981 by Finesse as LP FW 27487. 500 _aProgram notes by Irving Townsend, June 1981, on container insert. 505 0 _aGreensleeves -- You go to my head -- Blue dove -- Jesus Christ Superstar -- Here's that rainy day -- East of the sun -- Bags' new groove. 650 0 _y1971-1980. 700 1 _aLewis, John, _d1920- 710 2 _aModern Jazz Quartet. 740 0 _aPaul Desmond and the Modern Jazz Quartet. Next record: LDR 01829cjm 2200385 a 4500 001 001964482 005 20060626132700.0 007 sd fzngnn|m|e| 008 871211p19871957nyujzn d 024 1 _a4228332902 028 01 _a833 290-2 _bVerve 033 0 _a19571027 _b6299 _cD56 033 0 _a196112-- _b3804 _cN4 033 0 _a19571019 _b4104 _cC6 033 0 _a197107-- _b6299 _cV7 035 _a(OCoLC)17222092 040 _aCPL _cCPL _dOCL _dLGG 048 _apz01 _aka01 _asd01 _apd01 110 2 _aModern Jazz Quartet. _4prf 245 14 _aThe Modern Jazz Quartet plus _h[sound recording]. 260 _a[New York] : _bVerve, _cp1987. 300 _a1 sound disc : _bdigital ; _c4 3/4 in. 440 0 _aCompact jazz 511 0 _aModern Jazz Quartet (principally) ; Milt Jackson, vibraphone (2nd and 8th works) ; Oscar Peterson, piano (2nd and 8th works) ; Ray Brown, bass (2nd and 8th works) ; Ed Thigpen (2nd work), Louis Hayes (8th work), drums. 518 _aRecorded live, Oct. 27, 1957, at the Donaueschingen Jazz Festival (1st, 5th, 7th, and 10th works); Dec. 1961, in New York (2nd work); live, Oct. 19, 1957, at the Opera House, Chicago (3rd, 4th, 6th, and 9th works); July 1971, in Villingen, Germany (8th work). 500 _aCompact disc. 500 _aAnalog recording. 505 0 _aThe golden striker (4:08) -- On Green Dolphin Street (7:28) -- D & E (4:55) -- I'll remember April (4:51) -- Cortège (7:15) -- Now's the time (4:43) -- J.B. blues (5:09) -- Reunion blues (6:35) -- 'Round midnight (3:56) -- Three windows (7:20). 700 1 _aJackson, Milt. _4prf 700 1 _aPeterson, Oscar, _d1925- _4prf 700 1 _aBrown, Ray, _d1926-2002. _4prf 700 1 _aThigpen, Ed. _4prf 700 1 _aHayes, Louis, _d1937- _4prf 852 80 _bMUSIC _cAV _hCD 1131 _4Marvin Duchow Music _5Audio-Visual PK�����]B1 �� ����tests/marc_lint_005.phptnu�[��������--TEST-- marc_lint_005: Tests check_020() called separately --SKIPIF-- <?php include('tests/skipif.inc'); ?> <?php include('tests/skipif_noispn.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; // Create test harness to allow direct calls to check methods: class File_MARC_Lint_Test_Harness extends File_MARC_Lint { public function check020($field) { return parent::check020($field); } // override warn method to echo instead of store in object: protected function warn($msg) { echo $msg . "\n"; } } $marc_lint = new File_MARC_Lint_Test_Harness(); $testData = array( array('a' => "154879473"), //too few digits array('a' => "1548794743"), //invalid checksum array('a' => "15487947443"), //11 digits array('a' => "15487947443324"), //14 digits array('a' => "9781548794743"), //13 digit valid array('a' => "9781548794745"), //13 digit invalid array('a' => "1548794740 (10 : good checksum)"), //10 digit valid with qualifier array('a' => "1548794745 (10 : bad checksum)"), //10 digit invalid with qualifier array('a' => "1-54879-474-0 (hyphens and good checksum)"), //10 digit invalid with hyphens and qualifier array('a' => "1-54879-474-5 (hyphens and bad checksum)"), //10 digit invalid with hyphens and qualifier array('a' => "1548794740(10 : unspaced qualifier)"), //10 valid without space before qualifier array('a' => "1548794745(10 : unspaced qualifier : bad checksum)"), //10 invalid without space before qualifier array('z' => "1548794743"), //subfield z ); foreach ($testData as $current) { $subfields = array(); foreach ($current as $key => $value) { $subfields[] = new File_MARC_Subfield($key, $value); } $field = new File_MARC_Data_Field('020', $subfields, '', ''); $marc_lint->check020($field); } ?> --EXPECT-- 020: Subfield a has the wrong number of digits, 154879473. 020: Subfield a has bad checksum, 1548794743. 020: Subfield a has the wrong number of digits, 15487947443. 020: Subfield a has the wrong number of digits, 15487947443324. 020: Subfield a has bad checksum (13 digit), 9781548794745. 020: Subfield a has bad checksum, 1548794745 (10 : bad checksum). 020: Subfield a may have invalid characters. 020: Subfield a may have invalid characters. 020: Subfield a has bad checksum, 1-54879-474-5 (hyphens and bad checksum). 020: Subfield a qualifier must be preceded by space, 1548794740(10 : unspaced qualifier). 020: Subfield a qualifier must be preceded by space, 1548794745(10 : unspaced qualifier : bad checksum). 020: Subfield a has bad checksum, 1548794745(10 : unspaced qualifier : bad checksum). PK�����]s}����$��tests/marc_xml_namespace_prefix.phptnu�[��������--TEST-- marc_xml_namespace: iterate and pretty print a MARC record --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARCXML($dir . '/' . 'namespace.xml',File_MARC::SOURCE_FILE,"marc",true); while ($marc_record = $marc_file->next()) { print $marc_record->getLeader(); print "\n"; $field = $marc_record->getField('050'); print $field->getIndicator(1); print "\n"; print $field->getIndicator(2); print "\n"; $subfield = $field->getSubfield('a'); print $subfield->getData(); print "\n"; } ?> --EXPECT-- 00925njm 22002777a 4500 0 0 Atlantic 1259 01832cmma 2200349 a 4500 0 0 F204.W5 PK�����]}۶\p��p����tests/bad_example.xmlnu�[��������<collection xmlns="http://www.loc.gov/MARC21/slim"> <record> <leader>01850 a2200517 4500</leader> <controlfield tag="001">0000000044</controlfield> <controlfield tag="003">EMILDA</controlfield> <controlfield tag="008">980120s1998 fi j 000 0 swe</controlfield> <datafield tag="020" ind1=" " ind2=" "> <subfield code="a">9515008808</subfield> <subfield code="c">FIM 72:00</subfield> </datafield> <datafield tag="035" ind1=" " ind2=" "> <subfield code="9">9515008808</subfield> </datafield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">NB</subfield> </datafield> <datafield tag="042" ind1=" " ind2=" "> <subfield code="9">NB</subfield> <subfield code="9">SEE</subfield> </datafield> <datafield tag="084" ind1=" " ind2=" "> <subfield code="a">Hcd,u</subfield> <subfield code="2">kssb/6</subfield> </datafield> <datafield tag="084" ind1=" " ind2=" "> <subfield code="5">NB</subfield> <subfield code="a">uHc</subfield> <subfield code="2">kssb</subfield> </datafield> <datafield tag="084" ind1=" " ind2=" "> <subfield code="5">SEE</subfield> <subfield code="a">Hcf</subfield> <subfield code="2">kssb/6</subfield> </datafield> <datafield tag="084" ind1=" " ind2=" "> <subfield code="5">Q</subfield> <subfield code="a">Hcd,uf</subfield> <subfield code="2">kssb/6</subfield> </datafield> <datafield tag="100" ind1="1" ind2=" "> <subfield code="a">Jansson, Tove,</subfield> <subfield code="d">1914-2001</subfield> </datafield> <datafield tag="245" ind1="0"> <subfield code="a">Det osynliga barnet och andra bert̃telser /</subfield> <subfield code="c">Tove Jansson</subfield> </datafield> <datafield tag="250" ind1=" " ind2=" "> <subfield code="a">7. uppl.</subfield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <subfield code="a">Helsingfors :</subfield> <subfield code="b">Schildt,</subfield> <subfield code="c">1998 ;</subfield> <subfield code="e">(Falun :</subfield> <subfield code="f">Scandbook)</subfield> </datafield> <datafield tag="30-" ind1=" " ind2=" "> <subfield code="a">166, [4] s. :</subfield> <subfield code="b">ill. ;</subfield> <subfield code="c">21 cm</subfield> </datafield> <datafield tag="440" ind1=" " ind2="0"> <subfield code="a">Mumin-biblioteket,</subfield> <subfield code="x">99-0698931-9</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Originaluppl. 1962</subfield> </datafield> <datafield tag="599" ind1=" " ind2=" "> <subfield code="a">Li: S</subfield> </datafield> <datafield tag="740" ind1="4" ind2=" "> <subfield code="a">Det osynliga barnet</subfield> </datafield> <datafield tag="775" ind1="1" ind2=" "> <subfield code="z">951-50-0385-7</subfield> <subfield code="w">9515003857</subfield> <subfield code="9">07</subfield> </datafield> <datafield tag="841" ind1=" " ind2=" "> <subfield code="5">Li</subfield> <subfield code="a">xa</subfield> <subfield code="b">0201080u 0 4000uu |000000</subfield> <subfield code="e">1</subfield> </datafield> <datafield tag="841" ind1=" " ind2=" "> <subfield code="5">SEE</subfield> <subfield code="a">xa</subfield> <subfield code="b">0201080u 0 4000uu |000000</subfield> <subfield code="e">1</subfield> </datafield> <datafield tag="841" ind1=" " ind2=" "> <subfield code="5">L</subfield> <subfield code="a">xa</subfield> <subfield code="b">0201080u 0 4000uu |000000</subfield> <subfield code="e">1</subfield> </datafield> <datafield tag="841" ind1=" " ind2=" "> <subfield code="5">NB</subfield> <subfield code="a">xa</subfield> <subfield code="b">0201080u 0 4000uu |000000</subfield> <subfield code="e">1</subfield> </datafield> <datafield tag="841" ind1=" " ind2=" "> <subfield code="5">Q</subfield> <subfield code="a">xa</subfield> <subfield code="b">0201080u 0 4000uu |000000</subfield> <subfield code="e">1</subfield> </datafield> <datafield tag="841" ind1=" " ind2=" "> <subfield code="5">S</subfield> <subfield code="a">xa</subfield> <subfield code="b">0201080u 0 4000uu |000000</subfield> <subfield code="e">1</subfield> </datafield> <datafield tag="852" ind1=" " ind2=" "> <subfield code="5">NB</subfield> <subfield code="b">NB</subfield> <subfield code="c">NB98:12</subfield> <subfield code="h">plikt</subfield> <subfield code="j">R, 980520</subfield> </datafield> <datafield tag="852" ind1=" " ind2=" "> <subfield code="5">Li</subfield> <subfield code="b">Li</subfield> <subfield code="c">CNB</subfield> <subfield code="h">h,u</subfield> </datafield> <datafield tag="852" ind1=" " ind2=" "> <subfield code="5">SEE</subfield> <subfield code="b">SEE</subfield> </datafield> <datafield tag="852" ind1=" " ind2=" "> <subfield code="5">Q</subfield> <subfield code="b">Q</subfield> <subfield code="j">98947</subfield> </datafield> <datafield tag="852" ind1=" " ind2=" "> <subfield code="5">L</subfield> <subfield code="b">L</subfield> <subfield code="c">0100</subfield> <subfield code="h">98/</subfield> <subfield code="j">3043 H</subfield> </datafield> <datafield tag="852" ind1=" " ind2=" "> <subfield code="5">S</subfield> <subfield code="b">S</subfield> <subfield code="h">Sv97</subfield> <subfield code="j">7235</subfield> </datafield> <datafield tag="900" ind1="1" ind2="s"> <subfield code="a">Yanson, Tobe,</subfield> <subfield code="d">1914-2001</subfield> <subfield code="u">Jansson, Tove,</subfield> <subfield code="d">1914-2001</subfield> </datafield> <datafield tag="900" ind1="1" ind2="s"> <subfield code="a">Janssonov,̀ Tove,</subfield> <subfield code="d">1914-2001</subfield> <subfield code="u">Jansson, Tove,</subfield> <subfield code="d">1914-2001</subfield> </datafield> <datafield tag="900" ind1="1" ind2="s"> <subfield code="a">Jansone, Tuve,</subfield> <subfield code="d">1914-2001</subfield> <subfield code="u">Jansson, Tove,</subfield> <subfield code="d">1914-2001</subfield> </datafield> <datafield tag="900" ind1="1" ind2="s"> <subfield code="a">Janson, Tuve,</subfield> <subfield code="d">1914-2001</subfield> <subfield code="u">Jansson, Tove,</subfield> <subfield code="d">1914-2001</subfield> </datafield> <datafield tag="900" ind1="1" ind2="s"> <subfield code="a">Jansson, Tuve,</subfield> <subfield code="d">1914-2001</subfield> <subfield code="u">Jansson, Tove,</subfield> <subfield code="d">1914-2001</subfield> </datafield> <datafield tag="900" ind1="1" ind2="s"> <subfield code="a">Janssonova, Tove,</subfield> <subfield code="d">1914-2001</subfield> <subfield code="u">Jansson, Tove,</subfield> <subfield code="d">1914-2001</subfield> </datafield> <datafield tag="976" ind1=" " ind2="2"> <subfield code="a">Hcd,u</subfield> <subfield code="b">Skn̲litteratur</subfield> </datafield> <controlfield tag="005">20050204111518.0</controlfield> </record> </collection> PK�����] ������tests/marc_field_005.phptnu�[��������--TEST-- marc_field_005: Test method getContents --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; // create some subfields $subfields[] = new File_MARC_Subfield('a', 'nothing'); $subfields[] = new File_MARC_Subfield('z', 'everything'); // create a field $field = new File_MARC_Data_Field('100', $subfields, '0'); // create some new subfields $subfield1 = new File_MARC_Subfield('g', 'a little'); // test the fieldpost corner case by inserting prior to the first subfield $sf = $field->getSubfields('a'); // we might get an array back; in this case, we want the first subfield if (is_array($sf)) { $field->insertSubfield($subfield1, $sf[0], true); } else { $field->insertSubfield($subfield1, $sf, true); } // let's see the results print $field->getContents(); print "\n"; print $field->getContents('###'); print "\n"; ?> --EXPECT-- a littlenothingeverything a little###nothing###everything PK�����]p̎u1��u1����tests/marc_016.phptnu�[��������--TEST-- marc_016: generate a single collection of MARCXML records from a MARC record --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $records = new File_MARC($dir . '/' . 'music.mrc'); // Add the XML header and opening <collection> element $records->toXMLHeader(); // Iterate through the retrieved records while ($record = $records->next()) { // Change each 852 $c to "Audio-Visual" $holdings = $record->getFields('852'); foreach ($holdings as $holding) { // Get the $c subfields from this field $formats = $holding->getSubfields('c'); foreach ($formats as $format) { if ($format->getData('AV')) { $format->setData('Audio-Visual'); } } } // Generate the XML output for this record print $record->toXML('UTF-8', true, false); } // Add the </collection> closing element and dump the XMLWriter contents print $records->toXMLFooter(); --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <collection xmlns="http://www.loc.gov/MARC21/slim"> <record xmlns="http://www.loc.gov/MARC21/slim"> <leader>01145ncm 2200277 i 4500</leader> <controlfield tag="001">000073594</controlfield> <controlfield tag="004">AAJ5802</controlfield> <controlfield tag="005">20030415102100.0</controlfield> <controlfield tag="008">801107s1977 nyujza </controlfield> <datafield tag="010" ind1=" " ind2=" "> <subfield code="a"> 77771106 </subfield> </datafield> <datafield tag="035" ind1=" " ind2=" "> <subfield code="a">(CaOTUIC)15460184</subfield> </datafield> <datafield tag="035" ind1="9" ind2=" "> <subfield code="a">AAJ5802</subfield> </datafield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">LC</subfield> </datafield> <datafield tag="050" ind1="0" ind2="0"> <subfield code="a">M1366</subfield> <subfield code="b">.M62</subfield> <subfield code="d">M1527.2</subfield> </datafield> <datafield tag="245" ind1="0" ind2="4"> <subfield code="a">The Modern Jazz Quartet :</subfield> <subfield code="b">The legendary profile. --</subfield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <subfield code="a">New York :</subfield> <subfield code="b">M.J.Q. Music,</subfield> <subfield code="c">c1977.</subfield> </datafield> <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">score (72 p.) ;</subfield> <subfield code="c">31 cm.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">For piano, vibraphone, drums, and double bass.</subfield> </datafield> <datafield tag="505" ind1="0" ind2=" "> <subfield code="a">Lewis, J. Django.--Lewis, J. Plastic dreams (music from the film Kemek).--Lewis, J. Dancing (music from the film Kemek).--Lewis, J. Blues in A minor.--Lewis, J. Blues in B♭.--Lewis, J. Precious joy.--Jackson, M. The martyr.--Jackson, M. The legendary profile.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Jazz.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Motion picture music</subfield> <subfield code="v">Excerpts</subfield> <subfield code="v">Scores.</subfield> </datafield> <datafield tag="700" ind1="1" ind2="2"> <subfield code="a">Lewis, John,</subfield> <subfield code="d">1920-</subfield> <subfield code="t">Selections.</subfield> <subfield code="f">1977.</subfield> </datafield> <datafield tag="700" ind1="1" ind2="2"> <subfield code="a">Jackson, Milt.</subfield> <subfield code="t">Martyrs.</subfield> <subfield code="f">1977.</subfield> </datafield> <datafield tag="700" ind1="1" ind2="2"> <subfield code="a">Jackson, Milt.</subfield> <subfield code="t">Legendary profile.</subfield> <subfield code="f">1977.</subfield> </datafield> <datafield tag="740" ind1="4" ind2=" "> <subfield code="a">The legendary profile.</subfield> </datafield> <datafield tag="852" ind1="0" ind2="0"> <subfield code="b">MUSIC</subfield> <subfield code="c">Audio-Visual</subfield> <subfield code="k">folio</subfield> <subfield code="h">M1366</subfield> <subfield code="i">M62</subfield> <subfield code="9">1</subfield> <subfield code="4">Marvin Duchow Music</subfield> <subfield code="5"></subfield> </datafield> </record> <record xmlns="http://www.loc.gov/MARC21/slim"> <leader>01293cjm 2200289 a 4500</leader> <controlfield tag="001">001878039</controlfield> <controlfield tag="005">20050110174900.0</controlfield> <controlfield tag="007">sd fungnn|||e|</controlfield> <controlfield tag="008">940202r19931981nyujzn i d</controlfield> <datafield tag="024" ind1="1" ind2=" "> <subfield code="a">7464573372</subfield> </datafield> <datafield tag="028" ind1="0" ind2="2"> <subfield code="a">JK 57337</subfield> <subfield code="b">Red Baron</subfield> </datafield> <datafield tag="035" ind1=" " ind2=" "> <subfield code="a">(OCoLC)29737267</subfield> </datafield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">SVP</subfield> <subfield code="c">SVP</subfield> <subfield code="d">LGG</subfield> </datafield> <datafield tag="100" ind1="1" ind2=" "> <subfield code="a">Desmond, Paul,</subfield> <subfield code="d">1924-</subfield> </datafield> <datafield tag="245" ind1="1" ind2="0"> <subfield code="a">Paul Desmond & the Modern Jazz Quartet</subfield> <subfield code="h">[sound recording]</subfield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <subfield code="a">New York, N.Y. :</subfield> <subfield code="b">Red Baron :</subfield> <subfield code="b">Manufactured by Sony Music Entertainment,</subfield> <subfield code="c">p1993.</subfield> </datafield> <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">1 sound disc (39 min.) :</subfield> <subfield code="b">digital ;</subfield> <subfield code="c">4 3/4 in.</subfield> </datafield> <datafield tag="511" ind1="0" ind2=" "> <subfield code="a">Paul Desmond, alto saxophone; Modern Jazz Quartet: John Lewis, piano; Milt Jackson, vibraphone; Percy Heath, bass; Connie Kay, drums.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">All arrangements by John Lewis.</subfield> </datafield> <datafield tag="518" ind1=" " ind2=" "> <subfield code="a">Recorded live on December 25, 1971 at Town Hall, NYC.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Originally released in 1981 by Finesse as LP FW 27487.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Program notes by Irving Townsend, June 1981, on container insert.</subfield> </datafield> <datafield tag="505" ind1="0" ind2=" "> <subfield code="a">Greensleeves -- You go to my head -- Blue dove -- Jesus Christ Superstar -- Here's that rainy day -- East of the sun -- Bags' new groove.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Jazz</subfield> <subfield code="y">1971-1980.</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Lewis, John,</subfield> <subfield code="d">1920-</subfield> </datafield> <datafield tag="710" ind1="2" ind2=" "> <subfield code="a">Modern Jazz Quartet.</subfield> </datafield> <datafield tag="740" ind1="0" ind2=" "> <subfield code="a">Paul Desmond and the Modern Jazz Quartet.</subfield> </datafield> </record> <record xmlns="http://www.loc.gov/MARC21/slim"> <leader>01829cjm 2200385 a 4500</leader> <controlfield tag="001">001964482</controlfield> <controlfield tag="005">20060626132700.0</controlfield> <controlfield tag="007">sd fzngnn|m|e|</controlfield> <controlfield tag="008">871211p19871957nyujzn d</controlfield> <datafield tag="024" ind1="1" ind2=" "> <subfield code="a">4228332902</subfield> </datafield> <datafield tag="028" ind1="0" ind2="1"> <subfield code="a">833 290-2</subfield> <subfield code="b">Verve</subfield> </datafield> <datafield tag="033" ind1="0" ind2=" "> <subfield code="a">19571027</subfield> <subfield code="b">6299</subfield> <subfield code="c">D56</subfield> </datafield> <datafield tag="033" ind1="0" ind2=" "> <subfield code="a">196112--</subfield> <subfield code="b">3804</subfield> <subfield code="c">N4</subfield> </datafield> <datafield tag="033" ind1="0" ind2=" "> <subfield code="a">19571019</subfield> <subfield code="b">4104</subfield> <subfield code="c">C6</subfield> </datafield> <datafield tag="033" ind1="0" ind2=" "> <subfield code="a">197107--</subfield> <subfield code="b">6299</subfield> <subfield code="c">V7</subfield> </datafield> <datafield tag="035" ind1=" " ind2=" "> <subfield code="a">(OCoLC)17222092</subfield> </datafield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">CPL</subfield> <subfield code="c">CPL</subfield> <subfield code="d">OCL</subfield> <subfield code="d">LGG</subfield> </datafield> <datafield tag="048" ind1=" " ind2=" "> <subfield code="a">pz01</subfield> <subfield code="a">ka01</subfield> <subfield code="a">sd01</subfield> <subfield code="a">pd01</subfield> </datafield> <datafield tag="110" ind1="2" ind2=" "> <subfield code="a">Modern Jazz Quartet.</subfield> <subfield code="4">prf</subfield> </datafield> <datafield tag="245" ind1="1" ind2="4"> <subfield code="a">The Modern Jazz Quartet plus</subfield> <subfield code="h">[sound recording].</subfield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <subfield code="a">[New York] :</subfield> <subfield code="b">Verve,</subfield> <subfield code="c">p1987.</subfield> </datafield> <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">1 sound disc :</subfield> <subfield code="b">digital ;</subfield> <subfield code="c">4 3/4 in.</subfield> </datafield> <datafield tag="440" ind1=" " ind2="0"> <subfield code="a">Compact jazz</subfield> </datafield> <datafield tag="511" ind1="0" ind2=" "> <subfield code="a">Modern Jazz Quartet (principally) ; Milt Jackson, vibraphone (2nd and 8th works) ; Oscar Peterson, piano (2nd and 8th works) ; Ray Brown, bass (2nd and 8th works) ; Ed Thigpen (2nd work), Louis Hayes (8th work), drums.</subfield> </datafield> <datafield tag="518" ind1=" " ind2=" "> <subfield code="a">Recorded live, Oct. 27, 1957, at the Donaueschingen Jazz Festival (1st, 5th, 7th, and 10th works); Dec. 1961, in New York (2nd work); live, Oct. 19, 1957, at the Opera House, Chicago (3rd, 4th, 6th, and 9th works); July 1971, in Villingen, Germany (8th work).</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Compact disc.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Analog recording.</subfield> </datafield> <datafield tag="505" ind1="0" ind2=" "> <subfield code="a">The golden striker (4:08) -- On Green Dolphin Street (7:28) -- D & E (4:55) -- I'll remember April (4:51) -- Cortège (7:15) -- Now's the time (4:43) -- J.B. blues (5:09) -- Reunion blues (6:35) -- 'Round midnight (3:56) -- Three windows (7:20).</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Jazz.</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Jackson, Milt.</subfield> <subfield code="4">prf</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Peterson, Oscar,</subfield> <subfield code="d">1925-</subfield> <subfield code="4">prf</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Brown, Ray,</subfield> <subfield code="d">1926-2002.</subfield> <subfield code="4">prf</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Thigpen, Ed.</subfield> <subfield code="4">prf</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Hayes, Louis,</subfield> <subfield code="d">1937-</subfield> <subfield code="4">prf</subfield> </datafield> <datafield tag="852" ind1="8" ind2="0"> <subfield code="b">MUSIC</subfield> <subfield code="c">Audio-Visual</subfield> <subfield code="h">CD 1131</subfield> <subfield code="4">Marvin Duchow Music</subfield> <subfield code="5">Audio-Visual</subfield> </datafield> </record> </collection> PK�����](N��N����tests/camel.mrcnu�[��������00755cam 22002414a 4500001001300000003000600013005001700019008004100036010001700077020004300094040001800137042000800155050002600163082001700189100003100206245005400237260004200291300007200333500003300405650003700438630002500475630001300500fol05731351 IMchF20000613133448.0000107s2000 nyua 001 0 eng  a 00020737  a0471383147 (paper/cd-rom : alk. paper) aDLCcDLCdDLC apcc00aQA76.73.P22bM33 200000a005.13/32211 aMartinsson, Tobias,d1976-10aActivePerl with ASP and ADO /cTobias Martinsson. aNew York :bJohn Wiley & Sons,c2000. axxi, 289 p. :bill. ;c23 cm. +e1 computer laser disc (4 3/4 in.) a"Wiley Computer Publishing." 0aPerl (Computer program language)00aActive server pages.00aActiveX.00647pam 2200241 a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001800109042000800127050002600135082001500161100002600176245006700202260003800269263000900307300001100316650003700327650002500364700001600389fol05754809 IMchF20000601115601.0000203s2000 mau 001 0 eng  a 00022023  a1565926994 aDLCcDLCdDLC apcc00aQA76.73.P22bD47 200000a005.742211 aDescartes, Alligator.10aProgramming the Perl DBI /cAlligator Descartes and Tim Bunce. aCmabridge, MA :bO'Reilly,c2000. a1111 ap. cm. 0aPerl (Computer program language) 0aDatabase management.1 aBunce, Tim.00605cam 22002054a 4500001001300000003000600013005001700019008004100036010001700077040001800094042000800112050002700120082001700147100002100164245005500185260004500240300002600285504005100311650003700362fol05843555 IMchF20000525142739.0000318s1999 cau b 001 0 eng  a 00501349  aDLCcDLCdDLC apcc00aQA76.73.P22bB763 199900a005.13/32211 aBrown, Martin C.10aPerl :bprogrammer's reference /cMartin C. Brown. aBerkeley :bOsborne/McGraw-Hill,cc1999. axix, 380 p. ;c22 cm. aIncludes bibliographical references and index. 0aPerl (Computer program language)00579cam 22002054a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001800109042000800127050002700135082001700162100002100179245005500200260004500255300003600300650003700336fol05843579 IMchF20000525142716.0000318s1999 caua 001 0 eng  a 00502116  a0072120002 aDLCcDLCdDLC apcc00aQA76.73.P22bB762 199900a005.13/32211 aBrown, Martin C.10aPerl :bthe complete reference /cMartin C. Brown. aBerkeley :bOsborne/McGraw-Hill,cc1999. axxxv, 1179 p. :bill. ;c24 cm. 0aPerl (Computer program language)00801nam 22002778a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001300109042000800122050002600130082001800156100002000174245008800194250003200282260004100314263000900355300001100364650003700375650003600412650002600448700002500474700002400499fol05848297 IMchF20000524125727.0000518s2000 mau 001 0 eng  a 00041664  a1565924193 aDLCcDLC apcc00aQA76.73.P22bG84 200000a005.2/7622211 aGuelich, Scott.10aCGI programming with Perl /cScott Guelich, Shishir Gundavaram & Gunther Birznieks. a2nd ed., expanded & updated aCambridge, Mass. :bO'Reilly,c2000. a0006 ap. cm. 0aPerl (Computer program language) 0aCGI (Computer network protocol) 0aInternet programming.1 aGundavaram, Shishir.1 aBirznieks, Gunther.00665nam 22002298a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001300109042000800122050002700130082001700157111005200174245008600226250001200312260004100324263000900365300001100374650005000385fol05865950 IMchF20000615103017.0000612s2000 mau 100 0 eng  a 00055759  a0596000138 aDLCcDLC apcc00aQA76.73.P22bP475 200000a005.13/32212 aPerl Conference 4.0d(2000 :cMonterey, Calif.)10aProceedings of the Perl Conference 4.0 :bJuly 17-20, 2000, Monterey, California. a1st ed. aCambridge, Mass. :bO'Reilly,c2000. a0006 ap. cm. 0aPerl (Computer program language)vCongresses.00579nam 22002178a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001300109042000800122050002600130082001700156100002800173245006200201260004100263263000900304300001100313650003700324fol05865956 IMchF20000615102948.0000612s2000 mau 000 0 eng  a 00055770  a1565926099 aDLCcDLC apcc00aQA76.73.P22bB43 200000a005.13/32211 aBlank-Edelman, David N.10aPerl for system administration /cDavid N. Blank-Edelman. aCambridge, Mass. :bO'Reilly,c2000. a0006 ap. cm. 0aPerl (Computer program language)00661nam 22002538a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001300109042000800122050002600130082001700156100001700173245006700190250001200257260004100269263000900310300001100319650003700330700002300367700001700390fol05865967 IMchF20000615102611.0000614s2000 mau 000 0 eng  a 00055799  a0596000278 aDLCcDLC apcc00aQA76.73.P22bW35 200000a005.13/32211 aWall, Larry.10aProgramming Perl /cLarry Wall, Tom Christiansen & Jon Orwant. a3rd ed. aCambridge, Mass. :bO'Reilly,c2000. a0007 ap. cm. 0aPerl (Computer program language)1 aChristiansen, Tom.1 aOrwant, Jon.00603cam 22002054a 4500001001300000003000600013005001700019008004100036010001700077020001500094040001800109042000800127050002600135082001700161100003200178245006000210260005700270300003300327650003700360fol05872355 IMchF20000706095105.0000315s1999 njua 001 0 eng  a 00500678  a013020868X aDLCcDLCdDLC apcc00aQA76.73.P22bL69 199900a005.13/32211 aLowe, Vincentq(Vincent D.)10aPerl programmer's interactive workbook /cVincent Lowe. aUpper Saddle River, NJ :bPrentice Hall PTP,cc1999. axx, 633 p. :bill. ;c23 cm. 0aPerl (Computer program language)00696nam 22002538a 4500001001300000003000600013005001700019008004100036010001700077020002800094040001300122042000800135050002600143082001700169100002600186245004400212260005100256263000900307300001100316500002000327650003700347650001700384650004100401fol05882032 IMchF20000707091904.0000630s2000 cau 001 0 eng  a 00058174  a0764547291 (alk. paper) aDLCcDLC apcc00aQA76.73.P22bF64 200000a005.13/32212 aFoster-Johnson, Eric.10aCross-platform Perl /cEric F. Johnson. aFoster City, CA :bIDG Books Worldwide,c2000. a0009 ap. cm. aIncludes index. 0aPerl (Computer program language) 0aWeb servers. 0aCross-platform software development.00399ngm 2200121 a 4500001001300000003000700013007002800020008004100048245005600089260003800145300006000183538003400243ttt05000099 TEST avbfc dcebfaghhoiu050224s2005 ilu999 vleng d00aTest subfields in control fieldsh[videorecording]. aOregon, Ill. :bB. Baldus,c2005. a1 videocassette (ca. 1000 min.) :bsd., col. ;c1/2 in. aVHS format, SP playback mode.PK�����])] �� ����tests/marc_005.phptnu�[��������--TEST-- marc_005: Ensure a duplicated record is a deep copy; test deleteFields() --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARC($dir . '/' . 'example.mrc'); $marc_record = $marc_file->next(); $copy_record = $marc_record; $duplicate_record = clone $marc_record; $num_deleted1 = $marc_record->deleteFields('020'); print "Deleted $num_deleted1 fields from the original record.\n"; $num_deleted2 = $copy_record->deleteFields('8\\d\\d', true); print "Deleted $num_deleted2 fields from the shallow copy record.\n"; $num_deleted3 = $duplicate_record->deleteFields('9\\d\\d', true); print "Deleted $num_deleted3 fields from the duplicate record.\n"; print "Original:\n"; print $marc_record; print "\nCopy:\n"; print $copy_record; print "\nDuplicate:\n"; print $duplicate_record; print "\n"; ?> --EXPECT-- Deleted 1 fields from the original record. Deleted 12 fields from the shallow copy record. Deleted 7 fields from the duplicate record. Original: LDR 01850 2200517 4500 001 0000000044 003 EMILDA 008 980120s1998 fi j 000 0 swe 035 _99515008808 040 _aNB 042 _9NB _9SEE 084 _aHcd,u _2kssb/6 084 _5NB _auHc _2kssb 084 _5SEE _aHcf _2kssb/6 084 _5Q _aHcd,uf _2kssb/6 100 1 _aJansson, Tove, _d1914-2001 245 04 _aDet osynliga barnet och andra berttelser / _cTove Jansson 250 _a7. uppl. 260 _aHelsingfors : _bSchildt, _c1998 ; _e(Falun : _fScandbook) 300 _a166, [4] s. : _bill. ; _c21 cm 440 0 _aMumin-biblioteket, _x99-0698931-9 500 _aOriginaluppl. 1962 599 _aLi: S 740 4 _aDet osynliga barnet 775 1 _z951-50-0385-7 _w9515003857 _907 005 20050204111518.0 Copy: LDR 01850 2200517 4500 001 0000000044 003 EMILDA 008 980120s1998 fi j 000 0 swe 035 _99515008808 040 _aNB 042 _9NB _9SEE 084 _aHcd,u _2kssb/6 084 _5NB _auHc _2kssb 084 _5SEE _aHcf _2kssb/6 084 _5Q _aHcd,uf _2kssb/6 100 1 _aJansson, Tove, _d1914-2001 245 04 _aDet osynliga barnet och andra berttelser / _cTove Jansson 250 _a7. uppl. 260 _aHelsingfors : _bSchildt, _c1998 ; _e(Falun : _fScandbook) 300 _a166, [4] s. : _bill. ; _c21 cm 440 0 _aMumin-biblioteket, _x99-0698931-9 500 _aOriginaluppl. 1962 599 _aLi: S 740 4 _aDet osynliga barnet 775 1 _z951-50-0385-7 _w9515003857 _907 005 20050204111518.0 Duplicate: LDR 01850 2200517 4500 001 0000000044 003 EMILDA 008 980120s1998 fi j 000 0 swe 035 _99515008808 040 _aNB 042 _9NB _9SEE 084 _aHcd,u _2kssb/6 084 _5NB _auHc _2kssb 084 _5SEE _aHcf _2kssb/6 084 _5Q _aHcd,uf _2kssb/6 100 1 _aJansson, Tove, _d1914-2001 245 04 _aDet osynliga barnet och andra berttelser / _cTove Jansson 250 _a7. uppl. 260 _aHelsingfors : _bSchildt, _c1998 ; _e(Falun : _fScandbook) 300 _a166, [4] s. : _bill. ; _c21 cm 440 0 _aMumin-biblioteket, _x99-0698931-9 500 _aOriginaluppl. 1962 599 _aLi: S 740 4 _aDet osynliga barnet 775 1 _z951-50-0385-7 _w9515003857 _907 005 20050204111518.0 PK�����]W)��)����tests/marc_019.phptnu�[��������--TEST-- marc_019: generate a MARCXML record not in a collection element --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $records = new File_MARC($dir . '/' . 'music.mrc'); // Iterate through the retrieved records $record = $records->next(); // Change each 852 $c to "Audio-Visual" $holdings = $record->getFields('852'); foreach ($holdings as $holding) { // Get the $c subfields from this field $formats = $holding->getSubfields('c'); foreach ($formats as $format) { if ($format->getData('AV')) { $format->setData('Audio-Visual'); } } } // Generate the XML output for this record print($record->toXML('UTF-8', true, true)); --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <collection xmlns="http://www.loc.gov/MARC21/slim"> <record> <leader>01145ncm 2200277 i 4500</leader> <controlfield tag="001">000073594</controlfield> <controlfield tag="004">AAJ5802</controlfield> <controlfield tag="005">20030415102100.0</controlfield> <controlfield tag="008">801107s1977 nyujza </controlfield> <datafield tag="010" ind1=" " ind2=" "> <subfield code="a"> 77771106 </subfield> </datafield> <datafield tag="035" ind1=" " ind2=" "> <subfield code="a">(CaOTUIC)15460184</subfield> </datafield> <datafield tag="035" ind1="9" ind2=" "> <subfield code="a">AAJ5802</subfield> </datafield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">LC</subfield> </datafield> <datafield tag="050" ind1="0" ind2="0"> <subfield code="a">M1366</subfield> <subfield code="b">.M62</subfield> <subfield code="d">M1527.2</subfield> </datafield> <datafield tag="245" ind1="0" ind2="4"> <subfield code="a">The Modern Jazz Quartet :</subfield> <subfield code="b">The legendary profile. --</subfield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <subfield code="a">New York :</subfield> <subfield code="b">M.J.Q. Music,</subfield> <subfield code="c">c1977.</subfield> </datafield> <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">score (72 p.) ;</subfield> <subfield code="c">31 cm.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">For piano, vibraphone, drums, and double bass.</subfield> </datafield> <datafield tag="505" ind1="0" ind2=" "> <subfield code="a">Lewis, J. Django.--Lewis, J. Plastic dreams (music from the film Kemek).--Lewis, J. Dancing (music from the film Kemek).--Lewis, J. Blues in A minor.--Lewis, J. Blues in B♭.--Lewis, J. Precious joy.--Jackson, M. The martyr.--Jackson, M. The legendary profile.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Jazz.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Motion picture music</subfield> <subfield code="v">Excerpts</subfield> <subfield code="v">Scores.</subfield> </datafield> <datafield tag="700" ind1="1" ind2="2"> <subfield code="a">Lewis, John,</subfield> <subfield code="d">1920-</subfield> <subfield code="t">Selections.</subfield> <subfield code="f">1977.</subfield> </datafield> <datafield tag="700" ind1="1" ind2="2"> <subfield code="a">Jackson, Milt.</subfield> <subfield code="t">Martyrs.</subfield> <subfield code="f">1977.</subfield> </datafield> <datafield tag="700" ind1="1" ind2="2"> <subfield code="a">Jackson, Milt.</subfield> <subfield code="t">Legendary profile.</subfield> <subfield code="f">1977.</subfield> </datafield> <datafield tag="740" ind1="4" ind2=" "> <subfield code="a">The legendary profile.</subfield> </datafield> <datafield tag="852" ind1="0" ind2="0"> <subfield code="b">MUSIC</subfield> <subfield code="c">Audio-Visual</subfield> <subfield code="k">folio</subfield> <subfield code="h">M1366</subfield> <subfield code="i">M62</subfield> <subfield code="9">1</subfield> <subfield code="4">Marvin Duchow Music</subfield> <subfield code="5"></subfield> </datafield> </record> </collection> PK�����]=O �� ����tests/sandburg.xmlnu�[��������<?xml version="1.0" encoding="UTF-8"?> <collection xmlns="http://www.loc.gov/MARC21/slim"> <record> <leader>01142cam 2200301 a 4500</leader> <controlfield tag="001"> 92005291 </controlfield> <controlfield tag="003">DLC</controlfield> <controlfield tag="005">19930521155141.9</controlfield> <controlfield tag="008">920219s1993 caua j 000 0 eng </controlfield> <datafield tag="010" ind1=" " ind2=" "> <subfield code="a"> 92005291 </subfield> </datafield> <datafield tag="020" ind1=" " ind2=" "> <subfield code="a">0152038655 :</subfield> <subfield code="c">$15.95</subfield> </datafield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">DLC</subfield> <subfield code="c">DLC</subfield> <subfield code="d">DLC</subfield> </datafield> <datafield tag="042" ind1=" " ind2=" "> <subfield code="a">lcac</subfield> </datafield> <datafield tag="050" ind1="0" ind2="0"> <subfield code="a">PS3537.A618</subfield> <subfield code="b">A88 1993</subfield> </datafield> <datafield tag="082" ind1="0" ind2="0"> <subfield code="a">811/.52</subfield> <subfield code="2">20</subfield> </datafield> <datafield tag="100" ind1="1" ind2=" "> <subfield code="a">Sandburg, Carl,</subfield> <subfield code="d">1878-1967.</subfield> </datafield> <datafield tag="245" ind1="1" ind2="0"> <subfield code="a">Arithmetic /</subfield> <subfield code="c">Carl Sandburg ; illustrated as an anamorphic adventure by Ted Rand.</subfield> </datafield> <datafield tag="250" ind1=" " ind2=" "> <subfield code="a">1st ed.</subfield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <subfield code="a">San Diego :</subfield> <subfield code="b">Harcourt Brace Jovanovich,</subfield> <subfield code="c">c1993.</subfield> </datafield> <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">1 v. (unpaged) :</subfield> <subfield code="b">ill. (some col.) ;</subfield> <subfield code="c">26 cm.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">One Mylar sheet included in pocket.</subfield> </datafield> <datafield tag="520" ind1=" " ind2=" "> <subfield code="a">A poem about numbers and their characteristics. Features anamorphic, or distorted, drawings which can be restored to normal by viewing from a particular angle or by viewing the image's reflection in the provided Mylar cone.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Arithmetic</subfield> <subfield code="x">Juvenile poetry.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Children's poetry, American.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="1"> <subfield code="a">Arithmetic</subfield> <subfield code="x">Poetry.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="1"> <subfield code="a">American poetry.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="1"> <subfield code="a">Visual perception.</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Rand, Ted,</subfield> <subfield code="e">ill.</subfield> </datafield> </record> </collection> PK�����] VU,��,����tests/marc_field_21246.phptnu�[��������--TEST-- marc_field_21246: Delete multiple subfields --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $field = new File_MARC_Data_Field(650, [ new File_MARC_Subfield('9', 'test1'), new File_MARC_Subfield('9', 'test2'), new File_MARC_Subfield('0', 'test3'), new File_MARC_Subfield('9', 'test4'), ] ); echo "--- Before: ---\n$field\n\n"; foreach ($field->getSubfields('9') as $subfield) { echo "Deleting subfield: $subfield\n"; $field->deleteSubfield($subfield); } echo "\n--- After: ---\n$field\n\n"; ?> --EXPECT-- --- Before: --- 650 _9test1 _9test2 _0test3 _9test4 Deleting subfield: [9]: test1 Deleting subfield: [9]: test2 Deleting subfield: [9]: test4 --- After: --- 650 _0test3 PK�����]O~iK!��K!����tests/marc_013.phptnu�[��������--TEST-- marc_013: test formatField() convenience method --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARC($dir . '/' . 'music.mrc'); while ($marc_record = $marc_file->next()) { $fields = $marc_record->getFields(); foreach ($fields as $field) { print $field; print "\n"; print $field->formatField(); print "\n"; print $field->formatField(array('a', '2', 'c')); print "\n"; } } ?> --EXPECT-- 001 000073594 000073594 000073594 004 AAJ5802 AAJ5802 AAJ5802 005 20030415102100.0 20030415102100.0 20030415102100.0 008 801107s1977 nyujza 801107s1977 nyujza 801107s1977 nyujza 010 _a 77771106 77771106 035 _a(CaOTUIC)15460184 (CaOTUIC)15460184 035 9 _aAAJ5802 AAJ5802 040 _aLC LC 050 00 _aM1366 _b.M62 _dM1527.2 M1366 .M62 M1527.2 .M62 M1527.2 245 04 _aThe Modern Jazz Quartet : _bThe legendary profile. -- The Modern Jazz Quartet : The legendary profile. -- The legendary profile. -- 260 _aNew York : _bM.J.Q. Music, _cc1977. New York : M.J.Q. Music, c1977. M.J.Q. Music, 300 _ascore (72 p.) ; _c31 cm. score (72 p.) ; 31 cm. 500 _aFor piano, vibraphone, drums, and double bass. For piano, vibraphone, drums, and double bass. 505 0 _aLewis, J. Django.--Lewis, J. Plastic dreams (music from the film Kemek).--Lewis, J. Dancing (music from the film Kemek).--Lewis, J. Blues in A minor.--Lewis, J. Blues in B♭.--Lewis, J. Precious joy.--Jackson, M. The martyr.--Jackson, M. The legendary profile. Lewis, J. Django.--Lewis, J. Plastic dreams (music from the film Kemek).--Lewis, J. Dancing (music from the film Kemek).--Lewis, J. Blues in A minor.--Lewis, J. Blues in B♭.--Lewis, J. Precious joy.--Jackson, M. The martyr.--Jackson, M. The legendary profile. 650 0 _aJazz. Jazz. 650 0 _aMotion picture music _vExcerpts _vScores. Motion picture music -- Excerpts -- Scores. -- Excerpts -- Scores. 700 12 _aLewis, John, _d1920- _tSelections. _f1977. Lewis, John, 1920- Selections. 1977. 1920- Selections. 1977. 700 12 _aJackson, Milt. _tMartyrs. _f1977. Jackson, Milt. Martyrs. 1977. Martyrs. 1977. 700 12 _aJackson, Milt. _tLegendary profile. _f1977. Jackson, Milt. Legendary profile. 1977. Legendary profile. 1977. 740 4 _aThe legendary profile. The legendary profile. 852 00 _bMUSIC _cMAIN _kfolio _hM1366 _iM62 _91 _4Marvin Duchow Music _5 MUSIC MAIN folio M1366 M62 1 Marvin Duchow Music MUSIC folio M1366 M62 1 Marvin Duchow Music 001 001878039 001878039 001878039 005 20050110174900.0 20050110174900.0 20050110174900.0 007 sd fungnn|||e| sd fungnn|||e| sd fungnn|||e| 008 940202r19931981nyujzn i d 940202r19931981nyujzn i d 940202r19931981nyujzn i d 024 1 _a7464573372 7464573372 028 02 _aJK 57337 _bRed Baron JK 57337 Red Baron Red Baron 035 _a(OCoLC)29737267 (OCoLC)29737267 040 _aSVP _cSVP _dLGG SVP SVP LGG LGG 100 1 _aDesmond, Paul, _d1924- Desmond, Paul, 1924- 1924- 245 10 _aPaul Desmond & the Modern Jazz Quartet _h[sound recording] Paul Desmond & the Modern Jazz Quartet [sound recording] [sound recording] 260 _aNew York, N.Y. : _bRed Baron : _bManufactured by Sony Music Entertainment, _cp1993. New York, N.Y. : Red Baron : Manufactured by Sony Music Entertainment, p1993. Red Baron : Manufactured by Sony Music Entertainment, 300 _a1 sound disc (39 min.) : _bdigital ; _c4 3/4 in. 1 sound disc (39 min.) : digital ; 4 3/4 in. digital ; 511 0 _aPaul Desmond, alto saxophone; Modern Jazz Quartet: John Lewis, piano; Milt Jackson, vibraphone; Percy Heath, bass; Connie Kay, drums. Paul Desmond, alto saxophone; Modern Jazz Quartet: John Lewis, piano; Milt Jackson, vibraphone; Percy Heath, bass; Connie Kay, drums. 500 _aAll arrangements by John Lewis. All arrangements by John Lewis. 518 _aRecorded live on December 25, 1971 at Town Hall, NYC. Recorded live on December 25, 1971 at Town Hall, NYC. 500 _aOriginally released in 1981 by Finesse as LP FW 27487. Originally released in 1981 by Finesse as LP FW 27487. 500 _aProgram notes by Irving Townsend, June 1981, on container insert. Program notes by Irving Townsend, June 1981, on container insert. 505 0 _aGreensleeves -- You go to my head -- Blue dove -- Jesus Christ Superstar -- Here's that rainy day -- East of the sun -- Bags' new groove. Greensleeves -- You go to my head -- Blue dove -- Jesus Christ Superstar -- Here's that rainy day -- East of the sun -- Bags' new groove. 650 0 _aJazz _y1971-1980. Jazz -- 1971-1980. -- 1971-1980. 700 1 _aLewis, John, _d1920- Lewis, John, 1920- 1920- 710 2 _aModern Jazz Quartet. Modern Jazz Quartet. 740 0 _aPaul Desmond and the Modern Jazz Quartet. Paul Desmond and the Modern Jazz Quartet. 001 001964482 001964482 001964482 005 20060626132700.0 20060626132700.0 20060626132700.0 007 sd fzngnn|m|e| sd fzngnn|m|e| sd fzngnn|m|e| 008 871211p19871957nyujzn d 871211p19871957nyujzn d 871211p19871957nyujzn d 024 1 _a4228332902 4228332902 028 01 _a833 290-2 _bVerve 833 290-2 Verve Verve 033 0 _a19571027 _b6299 _cD56 19571027 6299 D56 6299 033 0 _a196112-- _b3804 _cN4 196112-- 3804 N4 3804 033 0 _a19571019 _b4104 _cC6 19571019 4104 C6 4104 033 0 _a197107-- _b6299 _cV7 197107-- 6299 V7 6299 035 _a(OCoLC)17222092 (OCoLC)17222092 040 _aCPL _cCPL _dOCL _dLGG CPL CPL OCL LGG OCL LGG 048 _apz01 _aka01 _asd01 _apd01 pz01 ka01 sd01 pd01 110 2 _aModern Jazz Quartet. _4prf Modern Jazz Quartet. prf prf 245 14 _aThe Modern Jazz Quartet plus _h[sound recording]. The Modern Jazz Quartet plus [sound recording]. [sound recording]. 260 _a[New York] : _bVerve, _cp1987. [New York] : Verve, p1987. Verve, 300 _a1 sound disc : _bdigital ; _c4 3/4 in. 1 sound disc : digital ; 4 3/4 in. digital ; 440 0 _aCompact jazz Compact jazz 511 0 _aModern Jazz Quartet (principally) ; Milt Jackson, vibraphone (2nd and 8th works) ; Oscar Peterson, piano (2nd and 8th works) ; Ray Brown, bass (2nd and 8th works) ; Ed Thigpen (2nd work), Louis Hayes (8th work), drums. Modern Jazz Quartet (principally) ; Milt Jackson, vibraphone (2nd and 8th works) ; Oscar Peterson, piano (2nd and 8th works) ; Ray Brown, bass (2nd and 8th works) ; Ed Thigpen (2nd work), Louis Hayes (8th work), drums. 518 _aRecorded live, Oct. 27, 1957, at the Donaueschingen Jazz Festival (1st, 5th, 7th, and 10th works); Dec. 1961, in New York (2nd work); live, Oct. 19, 1957, at the Opera House, Chicago (3rd, 4th, 6th, and 9th works); July 1971, in Villingen, Germany (8th work). Recorded live, Oct. 27, 1957, at the Donaueschingen Jazz Festival (1st, 5th, 7th, and 10th works); Dec. 1961, in New York (2nd work); live, Oct. 19, 1957, at the Opera House, Chicago (3rd, 4th, 6th, and 9th works); July 1971, in Villingen, Germany (8th work). 500 _aCompact disc. Compact disc. 500 _aAnalog recording. Analog recording. 505 0 _aThe golden striker (4:08) -- On Green Dolphin Street (7:28) -- D & E (4:55) -- I'll remember April (4:51) -- Cortège (7:15) -- Now's the time (4:43) -- J.B. blues (5:09) -- Reunion blues (6:35) -- 'Round midnight (3:56) -- Three windows (7:20). The golden striker (4:08) -- On Green Dolphin Street (7:28) -- D & E (4:55) -- I'll remember April (4:51) -- Cortège (7:15) -- Now's the time (4:43) -- J.B. blues (5:09) -- Reunion blues (6:35) -- 'Round midnight (3:56) -- Three windows (7:20). 650 0 _aJazz. Jazz. 700 1 _aJackson, Milt. _4prf Jackson, Milt. prf prf 700 1 _aPeterson, Oscar, _d1925- _4prf Peterson, Oscar, 1925- prf 1925- prf 700 1 _aBrown, Ray, _d1926-2002. _4prf Brown, Ray, 1926-2002. prf 1926-2002. prf 700 1 _aThigpen, Ed. _4prf Thigpen, Ed. prf prf 700 1 _aHayes, Louis, _d1937- _4prf Hayes, Louis, 1937- prf 1937- prf 852 80 _bMUSIC _cAV _hCD 1131 _4Marvin Duchow Music _5Audio-Visual MUSIC AV CD 1131 Marvin Duchow Music Audio-Visual MUSIC CD 1131 Marvin Duchow Music Audio-Visual PK�����]ye@������tests/marc_xml_007.phptnu�[��������--TEST-- marc_xml_007: test getTag(), isControlField(), and isDataField() convenience methods on MARCXML --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARCXML($dir . '/' . 'bigarchive.xml'); while ($marc_record = $marc_file->next()) { $fields = $marc_record->getFields(); foreach ($fields as $field) { print $field->getTag(); if ($field->isControlField()) { print "\tControl field!"; } if ($field->isDataField()) { print "\tData field!"; } print "\n"; } } ?> --EXPECT-- 001 Control field! 003 Control field! 005 Control field! 006 Control field! 007 Control field! 008 Control field! 037 Data field! 040 Data field! 245 Data field! 246 Data field! 260 Data field! 300 Data field! 500 Data field! 500 Data field! 500 Data field! 510 Data field! 510 Data field! 533 Data field! 651 Data field! 830 Data field! 856 Data field! 909 Data field! PK�����]44-������tests/marc_field_003.phptnu�[��������--TEST-- marc_field_003: Add subfields to an existing field --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; // create some subfields $subfields[] = new File_MARC_Subfield('a', 'nothing'); $subfields[] = new File_MARC_Subfield('z', 'everything'); // create a field $field = new File_MARC_Data_Field('100', $subfields, '0'); // create some new subfields $subfield1 = new File_MARC_Subfield('g', 'a little'); $subfield2 = new File_MARC_Subfield('k', 'a bit more'); $subfield3 = new File_MARC_Subfield('t', 'a lot'); $subfield4 = new File_MARC_Subfield('0', 'first post'); // append a new subfield to the existing set of subfields // expected order: a-z-g $field->appendSubfield($subfield1); // insert a new subfield after the first subfield with code 'z' // expected order: a-z-k-g $sf = $field->getSubfields('z'); // we might get an array back; in this case, we want the first subfield if (is_array($sf)) { $field->insertSubfield($subfield2, $sf[0]); } else { $field->insertSubfield($subfield2, $sf); } // insert a new subfield prior to the first subfield with code 'z' // expected order: a-t-z-k-g $sf = $field->getSubfields('z'); // we might get an array back; in this case, we want the first subfield if (is_array($sf)) { $field->insertSubfield($subfield3, $sf[0], true); } else { $field->insertSubfield($subfield3, $sf, true); } // insert a new subfield at the very start of the field $field->prependSubfield($subfield4); // let's see the results print $field; print "\n"; ?> --EXPECT-- 100 0 _0first post _anothing _ta lot _zeverything _ka bit more _ga little PK�����]1��1����tests/marc_xml_008.phptnu�[��������--TEST-- marc_xml_008: generate a single collection of MARCXML records from a MARCXML record --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $records = new File_MARCXML($dir . '/' . 'music.xml'); // Add the XML header and opening <collection> element $records->toXMLHeader(); // Iterate through the retrieved records while ($record = $records->next()) { // Change each 852 $c to "Audio-Visual" $holdings = $record->getFields('852'); foreach ($holdings as $holding) { // Get the $c subfields from this field $formats = $holding->getSubfields('c'); foreach ($formats as $format) { if ($format->getData('AV')) { $format->setData('Audio-Visual'); } } } // Generate the XML output for this record print $record->toXML('UTF-8', true, false); } // Add the </collection> closing element and dump the XMLWriter contents print $records->toXMLFooter(); --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <collection xmlns="http://www.loc.gov/MARC21/slim"> <record xmlns="http://www.loc.gov/MARC21/slim"> <leader>01145ncm a2200277 i 4500</leader> <controlfield tag="001">000073594</controlfield> <controlfield tag="004">AAJ5802</controlfield> <controlfield tag="005">20030415102100.0</controlfield> <controlfield tag="008">801107s1977 nyujza </controlfield> <datafield tag="010" ind1=" " ind2=" "> <subfield code="a"> 77771106 </subfield> </datafield> <datafield tag="035" ind1=" " ind2=" "> <subfield code="a">(CaOTUIC)15460184</subfield> </datafield> <datafield tag="035" ind1="9" ind2=" "> <subfield code="a">AAJ5802</subfield> </datafield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">LC</subfield> </datafield> <datafield tag="050" ind1="0" ind2="0"> <subfield code="a">M1366</subfield> <subfield code="b">.M62</subfield> <subfield code="d">M1527.2</subfield> </datafield> <datafield tag="245" ind1="0" ind2="4"> <subfield code="a">The Modern Jazz Quartet :</subfield> <subfield code="b">The legendary profile. --</subfield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <subfield code="a">New York :</subfield> <subfield code="b">M.J.Q. Music,</subfield> <subfield code="c">c1977.</subfield> </datafield> <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">score (72 p.) ;</subfield> <subfield code="c">31 cm.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">For piano, vibraphone, drums, and double bass.</subfield> </datafield> <datafield tag="505" ind1="0" ind2=" "> <subfield code="a">Lewis, J. Django.--Lewis, J. Plastic dreams (music from the film Kemek).--Lewis, J. Dancing (music from the film Kemek).--Lewis, J. Blues in A minor.--Lewis, J. Blues in B́Ư.--Lewis, J. Precious joy.--Jackson, M. The martyr.--Jackson, M. The legendary profile.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Jazz.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Motion picture music</subfield> <subfield code="v">Excerpts</subfield> <subfield code="v">Scores.</subfield> </datafield> <datafield tag="700" ind1="1" ind2="2"> <subfield code="a">Lewis, John,</subfield> <subfield code="d">1920-</subfield> <subfield code="t">Selections.</subfield> <subfield code="f">1977.</subfield> </datafield> <datafield tag="700" ind1="1" ind2="2"> <subfield code="a">Jackson, Milt.</subfield> <subfield code="t">Martyrs.</subfield> <subfield code="f">1977.</subfield> </datafield> <datafield tag="700" ind1="1" ind2="2"> <subfield code="a">Jackson, Milt.</subfield> <subfield code="t">Legendary profile.</subfield> <subfield code="f">1977.</subfield> </datafield> <datafield tag="740" ind1="4" ind2=" "> <subfield code="a">The legendary profile.</subfield> </datafield> <datafield tag="852" ind1="0" ind2="0"> <subfield code="b">MUSIC</subfield> <subfield code="c">Audio-Visual</subfield> <subfield code="k">folio</subfield> <subfield code="h">M1366</subfield> <subfield code="i">M62</subfield> <subfield code="9">1</subfield> <subfield code="4">Marvin Duchow Music</subfield> <subfield code="5"></subfield> </datafield> </record> <record xmlns="http://www.loc.gov/MARC21/slim"> <leader>01293cjm a2200289 a 4500</leader> <controlfield tag="001">001878039</controlfield> <controlfield tag="005">20050110174900.0</controlfield> <controlfield tag="007">sd fungnn|||e|</controlfield> <controlfield tag="008">940202r19931981nyujzn i d</controlfield> <datafield tag="024" ind1="1" ind2=" "> <subfield code="a">7464573372</subfield> </datafield> <datafield tag="028" ind1="0" ind2="2"> <subfield code="a">JK 57337</subfield> <subfield code="b">Red Baron</subfield> </datafield> <datafield tag="035" ind1=" " ind2=" "> <subfield code="a">(OCoLC)29737267</subfield> </datafield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">SVP</subfield> <subfield code="c">SVP</subfield> <subfield code="d">LGG</subfield> </datafield> <datafield tag="100" ind1="1" ind2=" "> <subfield code="a">Desmond, Paul,</subfield> <subfield code="d">1924-</subfield> </datafield> <datafield tag="245" ind1="1" ind2="0"> <subfield code="a">Paul Desmond & the Modern Jazz Quartet</subfield> <subfield code="h">[sound recording]</subfield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <subfield code="a">New York, N.Y. :</subfield> <subfield code="b">Red Baron :</subfield> <subfield code="b">Manufactured by Sony Music Entertainment,</subfield> <subfield code="c">p1993.</subfield> </datafield> <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">1 sound disc (39 min.) :</subfield> <subfield code="b">digital ;</subfield> <subfield code="c">4 3/4 in.</subfield> </datafield> <datafield tag="511" ind1="0" ind2=" "> <subfield code="a">Paul Desmond, alto saxophone; Modern Jazz Quartet: John Lewis, piano; Milt Jackson, vibraphone; Percy Heath, bass; Connie Kay, drums.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">All arrangements by John Lewis.</subfield> </datafield> <datafield tag="518" ind1=" " ind2=" "> <subfield code="a">Recorded live on December 25, 1971 at Town Hall, NYC.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Originally released in 1981 by Finesse as LP FW 27487.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Program notes by Irving Townsend, June 1981, on container insert.</subfield> </datafield> <datafield tag="505" ind1="0" ind2=" "> <subfield code="a">Greensleeves -- You go to my head -- Blue dove -- Jesus Christ Superstar -- Here's that rainy day -- East of the sun -- Bags' new groove.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Jazz</subfield> <subfield code="y">1971-1980.</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Lewis, John,</subfield> <subfield code="d">1920-</subfield> </datafield> <datafield tag="710" ind1="2" ind2=" "> <subfield code="a">Modern Jazz Quartet.</subfield> </datafield> <datafield tag="740" ind1="0" ind2=" "> <subfield code="a">Paul Desmond and the Modern Jazz Quartet.</subfield> </datafield> </record> <record xmlns="http://www.loc.gov/MARC21/slim"> <leader>01829cjm a2200385 a 4500</leader> <controlfield tag="001">001964482</controlfield> <controlfield tag="005">20060626132700.0</controlfield> <controlfield tag="007">sd fzngnn|m|e|</controlfield> <controlfield tag="008">871211p19871957nyujzn d</controlfield> <datafield tag="024" ind1="1" ind2=" "> <subfield code="a">4228332902</subfield> </datafield> <datafield tag="028" ind1="0" ind2="1"> <subfield code="a">833 290-2</subfield> <subfield code="b">Verve</subfield> </datafield> <datafield tag="033" ind1="0" ind2=" "> <subfield code="a">19571027</subfield> <subfield code="b">6299</subfield> <subfield code="c">D56</subfield> </datafield> <datafield tag="033" ind1="0" ind2=" "> <subfield code="a">196112--</subfield> <subfield code="b">3804</subfield> <subfield code="c">N4</subfield> </datafield> <datafield tag="033" ind1="0" ind2=" "> <subfield code="a">19571019</subfield> <subfield code="b">4104</subfield> <subfield code="c">C6</subfield> </datafield> <datafield tag="033" ind1="0" ind2=" "> <subfield code="a">197107--</subfield> <subfield code="b">6299</subfield> <subfield code="c">V7</subfield> </datafield> <datafield tag="035" ind1=" " ind2=" "> <subfield code="a">(OCoLC)17222092</subfield> </datafield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">CPL</subfield> <subfield code="c">CPL</subfield> <subfield code="d">OCL</subfield> <subfield code="d">LGG</subfield> </datafield> <datafield tag="048" ind1=" " ind2=" "> <subfield code="a">pz01</subfield> <subfield code="a">ka01</subfield> <subfield code="a">sd01</subfield> <subfield code="a">pd01</subfield> </datafield> <datafield tag="110" ind1="2" ind2=" "> <subfield code="a">Modern Jazz Quartet.</subfield> <subfield code="4">prf</subfield> </datafield> <datafield tag="245" ind1="1" ind2="4"> <subfield code="a">The Modern Jazz Quartet plus</subfield> <subfield code="h">[sound recording].</subfield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <subfield code="a">[New York] :</subfield> <subfield code="b">Verve,</subfield> <subfield code="c">p1987.</subfield> </datafield> <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">1 sound disc :</subfield> <subfield code="b">digital ;</subfield> <subfield code="c">4 3/4 in.</subfield> </datafield> <datafield tag="440" ind1=" " ind2="0"> <subfield code="a">Compact jazz</subfield> </datafield> <datafield tag="511" ind1="0" ind2=" "> <subfield code="a">Modern Jazz Quartet (principally) ; Milt Jackson, vibraphone (2nd and 8th works) ; Oscar Peterson, piano (2nd and 8th works) ; Ray Brown, bass (2nd and 8th works) ; Ed Thigpen (2nd work), Louis Hayes (8th work), drums.</subfield> </datafield> <datafield tag="518" ind1=" " ind2=" "> <subfield code="a">Recorded live, Oct. 27, 1957, at the Donaueschingen Jazz Festival (1st, 5th, 7th, and 10th works); Dec. 1961, in New York (2nd work); live, Oct. 19, 1957, at the Opera House, Chicago (3rd, 4th, 6th, and 9th works); July 1971, in Villingen, Germany (8th work).</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Compact disc.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Analog recording.</subfield> </datafield> <datafield tag="505" ind1="0" ind2=" "> <subfield code="a">The golden striker (4:08) -- On Green Dolphin Street (7:28) -- D & E (4:55) -- I'll remember April (4:51) -- Cort©·ge (7:15) -- Now's the time (4:43) -- J.B. blues (5:09) -- Reunion blues (6:35) -- 'Round midnight (3:56) -- Three windows (7:20).</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Jazz.</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Jackson, Milt.</subfield> <subfield code="4">prf</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Peterson, Oscar,</subfield> <subfield code="d">1925-</subfield> <subfield code="4">prf</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Brown, Ray,</subfield> <subfield code="d">1926-2002.</subfield> <subfield code="4">prf</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Thigpen, Ed.</subfield> <subfield code="4">prf</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Hayes, Louis,</subfield> <subfield code="d">1937-</subfield> <subfield code="4">prf</subfield> </datafield> <datafield tag="852" ind1="8" ind2="0"> <subfield code="b">MUSIC</subfield> <subfield code="c">Audio-Visual</subfield> <subfield code="h">CD 1131</subfield> <subfield code="4">Marvin Duchow Music</subfield> <subfield code="5">Audio-Visual</subfield> </datafield> </record> </collection> PK�����] \������tests/marc_lint_001.phptnu�[��������--TEST-- marc_lint_001: Full test of Lint suite --SKIPIF-- <?php include('tests/skipif.inc'); ?> <?php include('tests/skipif_noispn.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_lint = new File_MARC_Lint(); print "Test records in camel.mrc\n"; $marc_file = new File_MARC($dir . '/' . 'camel.mrc'); while ($marc_record = $marc_file->next()) { $warnings = $marc_lint->checkRecord($marc_record); foreach ($warnings as $warning) { print $warning . "\n"; } } print "\nTest from a constructed record\n"; $rec = new File_MARC_Record(); $rec->setLeader("00000nam 22002538a 4500"); $rec->appendField( new File_MARC_Data_Field( '041', array( new File_MARC_Subfield('a', 'end'), new File_MARC_Subfield('a', 'fren') ), "0", "" ) ); $rec->appendField( new File_MARC_Data_Field( '043', array( new File_MARC_Subfield('a', 'n-us-pn') ), "", "" ) ); $rec->appendField( new File_MARC_Data_Field( '082', array( new File_MARC_Subfield('a', '005.13/3'), // typo 'R' for 'W' and missing 'b' subfield new File_MARC_Subfield('R', 'all'), new File_MARC_Subfield('2', '21') ), "0", "4" ) ); $rec->appendField( new File_MARC_Data_Field( '082', array( new File_MARC_Subfield('a', '005.13'), new File_MARC_Subfield('b', 'Wall'), new File_MARC_Subfield('2', '14') ), "1", "4" ) ); $rec->appendField( new File_MARC_Data_Field( '100', array( new File_MARC_Subfield('a', 'Wall, Larry') ), "1", "4" ) ); $rec->appendField( new File_MARC_Data_Field( '110', array( new File_MARC_Subfield('a', "O'Reilly & Associates.") ), "1", "" ) ); $rec->appendField( new File_MARC_Data_Field( '245', array( new File_MARC_Subfield('a', 'Programming Perl / '), new File_MARC_Subfield('a', 'Big Book of Perl /'), new File_MARC_Subfield('c', 'Larry Wall, Tom Christiansen & Jon Orwant.') ), "9", "0" ) ); $rec->appendField( new File_MARC_Data_Field( '250', array( new File_MARC_Subfield('a', '3rd ed.') ), "", "" ) ); $rec->appendField( new File_MARC_Data_Field( '250', array( new File_MARC_Subfield('a', '3rd ed.') ), "", "" ) ); $rec->appendField( new File_MARC_Data_Field( '260', array( new File_MARC_Subfield('a', 'Cambridge, Mass. : '), new File_MARC_Subfield('b', "O'Reilly, "), new File_MARC_Subfield('r', '2000.') ), "", "" ) ); $rec->appendField( new File_MARC_Data_Field( '590', array( new File_MARC_Subfield('a', 'Personally signed by Larry.') ), "4", "" ) ); $rec->appendField( new File_MARC_Data_Field( '650', array( new File_MARC_Subfield('a', 'Perl (Computer program language)'), new File_MARC_Subfield('0', '(DLC)sh 95010633') ), "", "0" ) ); $rec->appendField( new File_MARC_Data_Field( '856', array( new File_MARC_Subfield('u', 'http://www.perl.com/') ), "4", "3" ) ); $rec->appendField( new File_MARC_Data_Field( '886', array( new File_MARC_Subfield('4', 'Some foreign thing'), new File_MARC_Subfield('q', 'Another foreign thing') ), "0", "" ) ); $warnings = $marc_lint->checkRecord($rec); foreach ($warnings as $warning) { print $warning . "\n"; } ?> --EXPECT-- Test records in camel.mrc 100: Indicator 1 must be 0, 1 or 3 but it's "2" 007: Subfields are not allowed in fields lower than 010 Test from a constructed record 1XX: Only one 1XX tag is allowed, but I found 2 of them. 041: Subfield _a, end (end), is not valid. 041: Subfield _a must be evenly divisible by 3 or exactly three characters if ind2 is not 7, (fren). 043: Subfield _a, n-us-pn, is not valid. 082: Subfield _R is not allowed. 100: Indicator 2 must be blank but it's "4" 245: Indicator 1 must be 0 or 1 but it's "9" 245: Subfield _a is not repeatable. 260: Subfield _r is not allowed. 856: Indicator 2 must be blank, 0, 1, 2 or 8 but it's "3" PK�����]Y��Y����tests/marc_xml_009.phptnu�[��������--TEST-- marc_xml_009: convert a MARCXML record with an overly long leader to MARC --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARCXML($dir . '/' . 'bad_leader.xml'); while ($marc_record = $marc_file->next()) { print $marc_record->toRaw(); } ?> --EXPECT-- 00749cam a2200241 454500001001400000003000600014005001700020008004100037020001800078020001500096035002100111040003600132050002400168100002500192245007800217260003700295300002100332504004100353650001700394650002200411852004800433901002600481LIBN539044247OCoLC20081030150430.0070630||||| ||| 000 0 eng d a9781856075442 a1856075443 a(OCoLC)156822300 aBTCTAcBTCTAdYDXCPdBAKERdEMT 4aBL2747.2b.W45 20061 aWhite, Stephen Ross.10aSpace for unknowing :bthe place of agnosis in faith /cStephen R. White. aDublin :bColumba Press,cc2006. a160 p. ;c22 cm. aIncludes bibliographical references. 0aAgnosticism. 0aBelief and doubt. a1h230 WHIp11111027105040t65112549p26.95 aLIBN539044247bSystem PK�����]������tests/marc_008.phptnu�[��������--TEST-- marc_008: Attempt to open a file that does not exist --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; try { $marc_file = new File_MARC('super_bogus_file'); } catch (File_MARC_Exception $fme) { print $fme->getMessage(); } ?> --EXPECTF-- Warning: fopen(super_bogus_file): failed to open stream: No such file or directory in %sMARC.php on line %d Invalid input file "super_bogus_file" PK�����]+W �� ����tests/bigarchive.xmlnu�[��������<?xml version="1.0"?> <record xmlns="http://www.loc.gov/MARC21/slim"><leader>00000nam 2200277 4500</leader><controlfield tag="001">99865026e</controlfield><controlfield tag="003">UnM</controlfield><controlfield tag="005">19961010163452.0</controlfield><controlfield tag="006">m g d</controlfield><controlfield tag="007">cr bn |||a|bb|</controlfield><controlfield tag="008">940112s1649 enk s 00| | eng d</controlfield><datafield tag="037" ind1=" " ind2=" "><subfield code="a">CL0051000003</subfield><subfield code="b">ProQuest Information and Learning. 300 N. Zeeb Rd., Ann Arbor, MI 48106</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">Cu-RivES</subfield><subfield code="c">Cu-RivES</subfield><subfield code="d">CStRLIN</subfield><subfield code="e">dcrb</subfield><subfield code="d">WaOLN</subfield></datafield><datafield tag="245" ind1="0" ind2="4"><subfield code="a">The VVelsh embassador, or the happy newes his vvorship hath brought to London.</subfield><subfield code="h">[electronic resource] :</subfield><subfield code="b">Togetherwith her thirteen articles of acreements, which her propounds to all her cousens in her principality of Wales,and her Cities of London.</subfield></datafield><datafield tag="246" ind1="2" ind2=" "><subfield code="a">Happy newes his vvorship hath brought to London</subfield></datafield><datafield tag="260" ind1=" " ind2=" "><subfield code="a">[London] :</subfield><subfield code="b">Printed for George Roberts, and are to be soldat the Maiden Head on Snow-Hill neer Holborn Conduit,</subfield><subfield code="c">1649.</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">[2], 6 p.</subfield></datafield><datafield tag="500" ind1=" " ind2=" "><subfield code="a">Place of publication from Wing.</subfield></datafield><datafield tag="500" ind1=" " ind2=" "><subfield code="a">Annotation on Thomason copy: "May 4th".</subfield></datafield><datafield tag="500" ind1=" " ind2=" "><subfield code="a">Reproduction of the original in the British Library.</subfield></datafield><datafield tag="510" ind1="4" ind2=" "><subfield code="a">Wing (2nd ed.)</subfield><subfield code="c">W1315.</subfield></datafield><datafield tag="510" ind1="4" ind2=" "><subfield code="a">Thomason</subfield><subfield code="c">E.552[19].</subfield></datafield><datafield tag="533" ind1=" " ind2=" "><subfield code="a">Electronic reproduction.</subfield><subfield code="b">Ann Arbor, Mich. :</subfield><subfield code="c">UMI,</subfield><subfield code="d">1999-</subfield><subfield code="f">(Early English books online)</subfield><subfield code="n">Digital version of: (Thomason Tracts ; 85:E552[19])</subfield><subfield code="7">s1999 miun s</subfield></datafield><datafield tag="651" ind1=" " ind2="4"><subfield code="a">Great Britain</subfield><subfield code="x">Politics and government</subfield><subfield code="y">1642-1649</subfield><subfield code="v">Early works to 1800.</subfield></datafield><datafield tag="830" ind1=" " ind2="0"><subfield code="a">Early English books online.</subfield></datafield><datafield tag="856" ind1="4" ind2="0"><subfield code="z">E-book (Onsite access at NYPL Research Libraries)</subfield><subfield code="u">http://gateway.proquest.com/openurl?ctx_ver=Z39.88-2003&res_id=xri:eebo&rft_val_fmt=&rft_id=xri:eebo:image:117259</subfield></datafield><datafield tag="909" ind1=" " ind2=" "><subfield code="a">Not for export in OCLC Reclamation Project</subfield></datafield></record> PK�����]x;#��#����tests/marc_006.phptnu�[��������--TEST-- marc_006: test read.php --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; // Read MARC records from a stream (a file, in this case) $marc_source = new File_MARC($dir . '/' . 'example.mrc'); // Retrieve the first MARC record from the source $marc_record = $marc_source->next(); // Retrieve a personal name field from the record $names = $marc_record->getFields('100'); foreach ($names as $name_field) { // Now print the $a subfield switch ($name_field->getIndicator(1)) { case 0: print "Forename: "; break; case 1: print "Surname: "; break; case 2: print "Family name: "; break; } $name = $name_field->getSubfields('a'); if (count($name) == 1) { print $name[0]->getData() . "\n"; } else { print "Error -- \$a subfield appears more than once in this field!"; } } // Retrieve all series statement fields // Series statement fields start with a 4 (PCRE) $subjects = $marc_record->getFields('^4', true); // Iterate through all of the returned series statement fields foreach ($subjects as $field) { // print with File_MARC_Field_Data's magic __toString() method print $field; } ?> --EXPECT-- Surname: Jansson, Tove, 440 0 _aMumin-biblioteket, _x99-0698931-9 PK�����]kP������tests/marc_023.phptnu�[��������--TEST-- marc_023: test extended Record interface --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; class MyRecord extends File_MARC_Record { public function myNewMethod() { return $this->getField('040')->getSubfield('a')->getData(); } } $marc_file = new File_MARC($dir . '/' . 'example.mrc', File_MARC::SOURCE_FILE, MyRecord::class); $rec = $marc_file->next(); print get_class($rec) . "\n"; print $rec->myNewMethod() . "\n"; ?> --EXPECT-- MyRecord NB PK�����]f~������tests/marc_field_001.phptnu�[��������--TEST-- marc_field_001: Exercise basic methods for File_MARC_Field class --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; // create some subfields $subfields[] = new File_MARC_Subfield('a', 'nothing'); $subfields[] = new File_MARC_Subfield('z', 'everything'); // test constructor $field = new File_MARC_Data_Field('100', $subfields, '0'); // test basic getter methods print "Tag: " . $field->getTag() . "\n"; print "Get Ind1: " . $field->getIndicator(1) . "\n"; print "Get Ind2: " . $field->getIndicator(2) . "\n"; // test basic setter methods print "Set Ind1: " . $field->setIndicator(1, '3') . "\n"; // test pretty print print $field; print "\n"; // test raw print print $field->toRaw(); ?> --EXPECT-- Tag: 100 Get Ind1: 0 Get Ind2: Set Ind1: 3 100 3 _anothing _zeverything 3 anothingzeverything PK�����]%Hh��h����tests/marc_003.phptnu�[��������--TEST-- marc_003: getFields() with various regular expressions --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARC($dir . '/' . 'music.mrc'); print "Test with a simple string\n"; while ($marc_record = $marc_file->next()) { print "\nNext record:\n"; $fields = $marc_record->getFields('650'); foreach ($fields as $field) { print $field; print "\n"; } } print "\nTest with regular expression\n"; $marc_file = new File_MARC($dir . '/' . 'music.mrc'); while ($marc_record = $marc_file->next()) { print "\nNext record:\n"; $fields = $marc_record->getFields('00\d', true); foreach ($fields as $field) { print $field; print "\n"; } } ?> --EXPECT-- Test with a simple string Next record: 650 0 _aJazz. 650 0 _aMotion picture music _vExcerpts _vScores. Next record: 650 0 _aJazz _y1971-1980. Next record: 650 0 _aJazz. Test with regular expression Next record: 001 000073594 004 AAJ5802 005 20030415102100.0 008 801107s1977 nyujza Next record: 001 001878039 005 20050110174900.0 007 sd fungnn|||e| 008 940202r19931981nyujzn i d Next record: 001 001964482 005 20060626132700.0 007 sd fzngnn|m|e| 008 871211p19871957nyujzn d PK�����]S3 �� ����tests/marc_021.phptnu�[��������--TEST-- marc_021: test MARC-in-JSON serialization with subfield 0 --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARC($dir . '/' . 'example.mrc'); while ($marc_record = $marc_file->next()) { // create some subfields $subfields[] = new File_MARC_Subfield('0', 'nothing'); $subfields[] = new File_MARC_Subfield('1', 'everything'); $field = new File_MARC_Data_Field('999', $subfields, '', ''); $marc_record->appendField($field); $subfields = null; $field = null; $subfields[] = new File_MARC_Subfield('a', 'bee'); $subfields[] = new File_MARC_Subfield('0', 'cee'); $subfields[] = new File_MARC_Subfield('d', 'eee'); $field = new File_MARC_Data_Field('999', $subfields, '', ''); $marc_record->appendField($field); print $marc_record->toJSON(); print "\n"; } ?> --EXPECT-- {"leader":"01850 2200517 4500","fields":[{"001":"0000000044"},{"003":"EMILDA"},{"008":"980120s1998 fi j 000 0 swe"},{"020":{"ind1":" ","ind2":" ","subfields":[{"a":"9515008808"},{"c":"FIM 72:00"}]}},{"035":{"ind1":" ","ind2":" ","subfields":[{"9":"9515008808"}]}},{"040":{"ind1":" ","ind2":" ","subfields":[{"a":"NB"}]}},{"042":{"ind1":" ","ind2":" ","subfields":[{"9":"NB"},{"9":"SEE"}]}},{"084":{"ind1":" ","ind2":" ","subfields":[{"a":"Hcd,u"},{"2":"kssb\/6"}]}},{"084":{"ind1":" ","ind2":" ","subfields":[{"5":"NB"},{"a":"uHc"},{"2":"kssb"}]}},{"084":{"ind1":" ","ind2":" ","subfields":[{"5":"SEE"},{"a":"Hcf"},{"2":"kssb\/6"}]}},{"084":{"ind1":" ","ind2":" ","subfields":[{"5":"Q"},{"a":"Hcd,uf"},{"2":"kssb\/6"}]}},{"100":{"ind1":"1","ind2":" ","subfields":[{"a":"Jansson, Tove,"},{"d":"1914-2001"}]}},{"245":{"ind1":"0","ind2":"4","subfields":[{"a":"Det osynliga barnet och andra ber\u00e4ttelser \/"},{"c":"Tove Jansson"}]}},{"250":{"ind1":" ","ind2":" ","subfields":[{"a":"7. uppl."}]}},{"260":{"ind1":" ","ind2":" ","subfields":[{"a":"Helsingfors :"},{"b":"Schildt,"},{"c":"1998 ;"},{"e":"(Falun :"},{"f":"Scandbook)"}]}},{"300":{"ind1":" ","ind2":" ","subfields":[{"a":"166, [4] s. :"},{"b":"ill. ;"},{"c":"21 cm"}]}},{"440":{"ind1":" ","ind2":"0","subfields":[{"a":"Mumin-biblioteket,"},{"x":"99-0698931-9"}]}},{"500":{"ind1":" ","ind2":" ","subfields":[{"a":"Originaluppl. 1962"}]}},{"599":{"ind1":" ","ind2":" ","subfields":[{"a":"Li: S"}]}},{"740":{"ind1":"4","ind2":" ","subfields":[{"a":"Det osynliga barnet"}]}},{"775":{"ind1":"1","ind2":" ","subfields":[{"z":"951-50-0385-7"},{"w":"9515003857"},{"9":"07"}]}},{"841":{"ind1":" ","ind2":" ","subfields":[{"5":"Li"},{"a":"xa"},{"b":"0201080u 0 4000uu |000000"},{"e":"1"}]}},{"841":{"ind1":" ","ind2":" ","subfields":[{"5":"SEE"},{"a":"xa"},{"b":"0201080u 0 4000uu |000000"},{"e":"1"}]}},{"841":{"ind1":" ","ind2":" ","subfields":[{"5":"L"},{"a":"xa"},{"b":"0201080u 0 4000uu |000000"},{"e":"1"}]}},{"841":{"ind1":" ","ind2":" ","subfields":[{"5":"NB"},{"a":"xa"},{"b":"0201080u 0 4000uu |000000"},{"e":"1"}]}},{"841":{"ind1":" ","ind2":" ","subfields":[{"5":"Q"},{"a":"xa"},{"b":"0201080u 0 4000uu |000000"},{"e":"1"}]}},{"841":{"ind1":" ","ind2":" ","subfields":[{"5":"S"},{"a":"xa"},{"b":"0201080u 0 4000uu |000000"},{"e":"1"}]}},{"852":{"ind1":" ","ind2":" ","subfields":[{"5":"NB"},{"b":"NB"},{"c":"NB98:12"},{"h":"plikt"},{"j":"R, 980520"}]}},{"852":{"ind1":" ","ind2":" ","subfields":[{"5":"Li"},{"b":"Li"},{"c":"CNB"},{"h":"h,u"}]}},{"852":{"ind1":" ","ind2":" ","subfields":[{"5":"SEE"},{"b":"SEE"}]}},{"852":{"ind1":" ","ind2":" ","subfields":[{"5":"Q"},{"b":"Q"},{"j":"98947"}]}},{"852":{"ind1":" ","ind2":" ","subfields":[{"5":"L"},{"b":"L"},{"c":"0100"},{"h":"98\/"},{"j":"3043 H"}]}},{"852":{"ind1":" ","ind2":" ","subfields":[{"5":"S"},{"b":"S"},{"h":"Sv97"},{"j":"7235"}]}},{"900":{"ind1":"1","ind2":"s","subfields":[{"a":"Yanson, Tobe,"},{"d":"1914-2001"},{"u":"Jansson, Tove,"},{"d":"1914-2001"}]}},{"900":{"ind1":"1","ind2":"s","subfields":[{"a":"Janssonov\u00e1, Tove,"},{"d":"1914-2001"},{"u":"Jansson, Tove,"},{"d":"1914-2001"}]}},{"900":{"ind1":"1","ind2":"s","subfields":[{"a":"Jansone, Tuve,"},{"d":"1914-2001"},{"u":"Jansson, Tove,"},{"d":"1914-2001"}]}},{"900":{"ind1":"1","ind2":"s","subfields":[{"a":"Janson, Tuve,"},{"d":"1914-2001"},{"u":"Jansson, Tove,"},{"d":"1914-2001"}]}},{"900":{"ind1":"1","ind2":"s","subfields":[{"a":"Jansson, Tuve,"},{"d":"1914-2001"},{"u":"Jansson, Tove,"},{"d":"1914-2001"}]}},{"900":{"ind1":"1","ind2":"s","subfields":[{"a":"Janssonova, Tove,"},{"d":"1914-2001"},{"u":"Jansson, Tove,"},{"d":"1914-2001"}]}},{"976":{"ind1":" ","ind2":"2","subfields":[{"a":"Hcd,u"},{"b":"Sk\u00f6nlitteratur"}]}},{"005":"20050204111518.0"},{"999":{"ind1":" ","ind2":" ","subfields":[{"0":"nothing"},{"1":"everything"}]}},{"999":{"ind1":" ","ind2":" ","subfields":[{"a":"bee"},{"0":"cee"},{"d":"eee"}]}}]} PK�����]p޸������tests/marc_007.phptnu�[��������--TEST-- marc_007: Use key=>value iteration for tags and codes --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARC($dir . '/' . 'example.mrc'); if ($marc_record = $marc_file->next()) { foreach ($marc_record->getFields() as $tag=>$value) { print "$tag: "; if ($value instanceof File_MARC_Control_Field) { print $value->getData(); } else { foreach ($value->getSubfields() as $code=>$subdata) { print "_$code"; } } print "\n"; } } ?> --EXPECT-- 001: 0000000044 003: EMILDA 008: 980120s1998 fi j 000 0 swe 020: _a_c 035: _9 040: _a 042: _9_9 084: _a_2 084: _5_a_2 084: _5_a_2 084: _5_a_2 100: _a_d 245: _a_c 250: _a 260: _a_b_c_e_f 300: _a_b_c 440: _a_x 500: _a 599: _a 740: _a 775: _z_w_9 841: _5_a_b_e 841: _5_a_b_e 841: _5_a_b_e 841: _5_a_b_e 841: _5_a_b_e 841: _5_a_b_e 852: _5_b_c_h_j 852: _5_b_c_h 852: _5_b 852: _5_b_j 852: _5_b_c_h_j 852: _5_b_h_j 900: _a_d_u_d 900: _a_d_u_d 900: _a_d_u_d 900: _a_d_u_d 900: _a_d_u_d 900: _a_d_u_d 976: _a_b 005: 20050204111518.0 PK�����]N&��&����tests/marc_xml_002.phptnu�[��������--TEST-- marc_xml_002: iterate and pretty print a MARC record (LOC standard) --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARC($dir . '/' . 'sandburg.mrc'); while ($marc_record = $marc_file->next()) { print $marc_record->toXML(); print "\n"; } ?> --EXPECT-- <?xml version="1.0" encoding="UTF-8"?> <collection xmlns="http://www.loc.gov/MARC21/slim"> <record> <leader>01142cam 2200301 a 4500</leader> <controlfield tag="001"> 92005291 </controlfield> <controlfield tag="003">DLC</controlfield> <controlfield tag="005">19930521155141.9</controlfield> <controlfield tag="008">920219s1993 caua j 000 0 eng </controlfield> <datafield tag="010" ind1=" " ind2=" "> <subfield code="a"> 92005291 </subfield> </datafield> <datafield tag="020" ind1=" " ind2=" "> <subfield code="a">0152038655 :</subfield> <subfield code="c">$15.95</subfield> </datafield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">DLC</subfield> <subfield code="c">DLC</subfield> <subfield code="d">DLC</subfield> </datafield> <datafield tag="042" ind1=" " ind2=" "> <subfield code="a">lcac</subfield> </datafield> <datafield tag="050" ind1="0" ind2="0"> <subfield code="a">PS3537.A618</subfield> <subfield code="b">A88 1993</subfield> </datafield> <datafield tag="082" ind1="0" ind2="0"> <subfield code="a">811/.52</subfield> <subfield code="2">20</subfield> </datafield> <datafield tag="100" ind1="1" ind2=" "> <subfield code="a">Sandburg, Carl,</subfield> <subfield code="d">1878-1967.</subfield> </datafield> <datafield tag="245" ind1="1" ind2="0"> <subfield code="a">Arithmetic /</subfield> <subfield code="c">Carl Sandburg ; illustrated as an anamorphic adventure by Ted Rand.</subfield> </datafield> <datafield tag="250" ind1=" " ind2=" "> <subfield code="a">1st ed.</subfield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <subfield code="a">San Diego :</subfield> <subfield code="b">Harcourt Brace Jovanovich,</subfield> <subfield code="c">c1993.</subfield> </datafield> <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">1 v. (unpaged) :</subfield> <subfield code="b">ill. (some col.) ;</subfield> <subfield code="c">26 cm.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">One Mylar sheet included in pocket.</subfield> </datafield> <datafield tag="520" ind1=" " ind2=" "> <subfield code="a">A poem about numbers and their characteristics. Features anamorphic, or distorted, drawings which can be restored to normal by viewing from a particular angle or by viewing the image's reflection in the provided Mylar cone.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Arithmetic</subfield> <subfield code="x">Juvenile poetry.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Children's poetry, American.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="1"> <subfield code="a">Arithmetic</subfield> <subfield code="x">Poetry.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="1"> <subfield code="a">American poetry.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="1"> <subfield code="a">Visual perception.</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Rand, Ted,</subfield> <subfield code="e">ill.</subfield> </datafield> </record> </collection> PK�����]5;-��-����tests/music.xmlnu�[��������<?xml version="1.0" encoding="UTF-8"?> <collection xmlns="http://www.loc.gov/MARC21/slim"> <record> <leader>01145ncm a2200277 i 4500</leader> <controlfield tag="001">000073594</controlfield> <controlfield tag="004">AAJ5802</controlfield> <controlfield tag="005">20030415102100.0</controlfield> <controlfield tag="008">801107s1977 nyujza </controlfield> <datafield tag="010" ind1=" " ind2=" "> <subfield code="a"> 77771106 </subfield> </datafield> <datafield tag="035" ind1=" " ind2=" "> <subfield code="a">(CaOTUIC)15460184</subfield> </datafield> <datafield tag="035" ind1="9" ind2=" "> <subfield code="a">AAJ5802</subfield> </datafield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">LC</subfield> </datafield> <datafield tag="050" ind1="0" ind2="0"> <subfield code="a">M1366</subfield> <subfield code="b">.M62</subfield> <subfield code="d">M1527.2</subfield> </datafield> <datafield tag="245" ind1="0" ind2="4"> <subfield code="a">The Modern Jazz Quartet :</subfield> <subfield code="b">The legendary profile. --</subfield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <subfield code="a">New York :</subfield> <subfield code="b">M.J.Q. Music,</subfield> <subfield code="c">c1977.</subfield> </datafield> <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">score (72 p.) ;</subfield> <subfield code="c">31 cm.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">For piano, vibraphone, drums, and double bass.</subfield> </datafield> <datafield tag="505" ind1="0" ind2=" "> <subfield code="a">Lewis, J. Django.--Lewis, J. Plastic dreams (music from the film Kemek).--Lewis, J. Dancing (music from the film Kemek).--Lewis, J. Blues in A minor.--Lewis, J. Blues in B́Ư.--Lewis, J. Precious joy.--Jackson, M. The martyr.--Jackson, M. The legendary profile.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Jazz.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Motion picture music</subfield> <subfield code="v">Excerpts</subfield> <subfield code="v">Scores.</subfield> </datafield> <datafield tag="700" ind1="1" ind2="2"> <subfield code="a">Lewis, John,</subfield> <subfield code="d">1920-</subfield> <subfield code="t">Selections.</subfield> <subfield code="f">1977.</subfield> </datafield> <datafield tag="700" ind1="1" ind2="2"> <subfield code="a">Jackson, Milt.</subfield> <subfield code="t">Martyrs.</subfield> <subfield code="f">1977.</subfield> </datafield> <datafield tag="700" ind1="1" ind2="2"> <subfield code="a">Jackson, Milt.</subfield> <subfield code="t">Legendary profile.</subfield> <subfield code="f">1977.</subfield> </datafield> <datafield tag="740" ind1="4" ind2=" "> <subfield code="a">The legendary profile.</subfield> </datafield> <datafield tag="852" ind1="0" ind2="0"> <subfield code="b">MUSIC</subfield> <subfield code="c">MAIN</subfield> <subfield code="k">folio</subfield> <subfield code="h">M1366</subfield> <subfield code="i">M62</subfield> <subfield code="9">1</subfield> <subfield code="4">Marvin Duchow Music</subfield> <subfield code="5"></subfield> </datafield> </record> <record> <leader>01293cjm a2200289 a 4500</leader> <controlfield tag="001">001878039</controlfield> <controlfield tag="005">20050110174900.0</controlfield> <controlfield tag="007">sd fungnn|||e|</controlfield> <controlfield tag="008">940202r19931981nyujzn i d</controlfield> <datafield tag="024" ind1="1" ind2=" "> <subfield code="a">7464573372</subfield> </datafield> <datafield tag="028" ind1="0" ind2="2"> <subfield code="a">JK 57337</subfield> <subfield code="b">Red Baron</subfield> </datafield> <datafield tag="035" ind1=" " ind2=" "> <subfield code="a">(OCoLC)29737267</subfield> </datafield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">SVP</subfield> <subfield code="c">SVP</subfield> <subfield code="d">LGG</subfield> </datafield> <datafield tag="100" ind1="1" ind2=" "> <subfield code="a">Desmond, Paul,</subfield> <subfield code="d">1924-</subfield> </datafield> <datafield tag="245" ind1="1" ind2="0"> <subfield code="a">Paul Desmond & the Modern Jazz Quartet</subfield> <subfield code="h">[sound recording]</subfield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <subfield code="a">New York, N.Y. :</subfield> <subfield code="b">Red Baron :</subfield> <subfield code="b">Manufactured by Sony Music Entertainment,</subfield> <subfield code="c">p1993.</subfield> </datafield> <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">1 sound disc (39 min.) :</subfield> <subfield code="b">digital ;</subfield> <subfield code="c">4 3/4 in.</subfield> </datafield> <datafield tag="511" ind1="0" ind2=" "> <subfield code="a">Paul Desmond, alto saxophone; Modern Jazz Quartet: John Lewis, piano; Milt Jackson, vibraphone; Percy Heath, bass; Connie Kay, drums.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">All arrangements by John Lewis.</subfield> </datafield> <datafield tag="518" ind1=" " ind2=" "> <subfield code="a">Recorded live on December 25, 1971 at Town Hall, NYC.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Originally released in 1981 by Finesse as LP FW 27487.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Program notes by Irving Townsend, June 1981, on container insert.</subfield> </datafield> <datafield tag="505" ind1="0" ind2=" "> <subfield code="a">Greensleeves -- You go to my head -- Blue dove -- Jesus Christ Superstar -- Here's that rainy day -- East of the sun -- Bags' new groove.</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Jazz</subfield> <subfield code="y">1971-1980.</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Lewis, John,</subfield> <subfield code="d">1920-</subfield> </datafield> <datafield tag="710" ind1="2" ind2=" "> <subfield code="a">Modern Jazz Quartet.</subfield> </datafield> <datafield tag="740" ind1="0" ind2=" "> <subfield code="a">Paul Desmond and the Modern Jazz Quartet.</subfield> </datafield> </record> <record> <leader>01829cjm a2200385 a 4500</leader> <controlfield tag="001">001964482</controlfield> <controlfield tag="005">20060626132700.0</controlfield> <controlfield tag="007">sd fzngnn|m|e|</controlfield> <controlfield tag="008">871211p19871957nyujzn d</controlfield> <datafield tag="024" ind1="1" ind2=" "> <subfield code="a">4228332902</subfield> </datafield> <datafield tag="028" ind1="0" ind2="1"> <subfield code="a">833 290-2</subfield> <subfield code="b">Verve</subfield> </datafield> <datafield tag="033" ind1="0" ind2=" "> <subfield code="a">19571027</subfield> <subfield code="b">6299</subfield> <subfield code="c">D56</subfield> </datafield> <datafield tag="033" ind1="0" ind2=" "> <subfield code="a">196112--</subfield> <subfield code="b">3804</subfield> <subfield code="c">N4</subfield> </datafield> <datafield tag="033" ind1="0" ind2=" "> <subfield code="a">19571019</subfield> <subfield code="b">4104</subfield> <subfield code="c">C6</subfield> </datafield> <datafield tag="033" ind1="0" ind2=" "> <subfield code="a">197107--</subfield> <subfield code="b">6299</subfield> <subfield code="c">V7</subfield> </datafield> <datafield tag="035" ind1=" " ind2=" "> <subfield code="a">(OCoLC)17222092</subfield> </datafield> <datafield tag="040" ind1=" " ind2=" "> <subfield code="a">CPL</subfield> <subfield code="c">CPL</subfield> <subfield code="d">OCL</subfield> <subfield code="d">LGG</subfield> </datafield> <datafield tag="048" ind1=" " ind2=" "> <subfield code="a">pz01</subfield> <subfield code="a">ka01</subfield> <subfield code="a">sd01</subfield> <subfield code="a">pd01</subfield> </datafield> <datafield tag="110" ind1="2" ind2=" "> <subfield code="a">Modern Jazz Quartet.</subfield> <subfield code="4">prf</subfield> </datafield> <datafield tag="245" ind1="1" ind2="4"> <subfield code="a">The Modern Jazz Quartet plus</subfield> <subfield code="h">[sound recording].</subfield> </datafield> <datafield tag="260" ind1=" " ind2=" "> <subfield code="a">[New York] :</subfield> <subfield code="b">Verve,</subfield> <subfield code="c">p1987.</subfield> </datafield> <datafield tag="300" ind1=" " ind2=" "> <subfield code="a">1 sound disc :</subfield> <subfield code="b">digital ;</subfield> <subfield code="c">4 3/4 in.</subfield> </datafield> <datafield tag="440" ind1=" " ind2="0"> <subfield code="a">Compact jazz</subfield> </datafield> <datafield tag="511" ind1="0" ind2=" "> <subfield code="a">Modern Jazz Quartet (principally) ; Milt Jackson, vibraphone (2nd and 8th works) ; Oscar Peterson, piano (2nd and 8th works) ; Ray Brown, bass (2nd and 8th works) ; Ed Thigpen (2nd work), Louis Hayes (8th work), drums.</subfield> </datafield> <datafield tag="518" ind1=" " ind2=" "> <subfield code="a">Recorded live, Oct. 27, 1957, at the Donaueschingen Jazz Festival (1st, 5th, 7th, and 10th works); Dec. 1961, in New York (2nd work); live, Oct. 19, 1957, at the Opera House, Chicago (3rd, 4th, 6th, and 9th works); July 1971, in Villingen, Germany (8th work).</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Compact disc.</subfield> </datafield> <datafield tag="500" ind1=" " ind2=" "> <subfield code="a">Analog recording.</subfield> </datafield> <datafield tag="505" ind1="0" ind2=" "> <subfield code="a">The golden striker (4:08) -- On Green Dolphin Street (7:28) -- D & E (4:55) -- I'll remember April (4:51) -- Cort©·ge (7:15) -- Now's the time (4:43) -- J.B. blues (5:09) -- Reunion blues (6:35) -- 'Round midnight (3:56) -- Three windows (7:20).</subfield> </datafield> <datafield tag="650" ind1=" " ind2="0"> <subfield code="a">Jazz.</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Jackson, Milt.</subfield> <subfield code="4">prf</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Peterson, Oscar,</subfield> <subfield code="d">1925-</subfield> <subfield code="4">prf</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Brown, Ray,</subfield> <subfield code="d">1926-2002.</subfield> <subfield code="4">prf</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Thigpen, Ed.</subfield> <subfield code="4">prf</subfield> </datafield> <datafield tag="700" ind1="1" ind2=" "> <subfield code="a">Hayes, Louis,</subfield> <subfield code="d">1937-</subfield> <subfield code="4">prf</subfield> </datafield> <datafield tag="852" ind1="8" ind2="0"> <subfield code="b">MUSIC</subfield> <subfield code="c">AV</subfield> <subfield code="h">CD 1131</subfield> <subfield code="4">Marvin Duchow Music</subfield> <subfield code="5">Audio-Visual</subfield> </datafield> </record> </collection> PK�����]ԛ �� ����tests/marc_014.phptnu�[��������--TEST-- marc_014: Add fields to a MARC record --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; // Get ourselves a MARC record $marc_file = new File_MARC($dir . '/' . 'example.mrc'); $marc_record = $marc_file->next(); // create some subfields $subfields[] = new File_MARC_Subfield('a', 'nothing'); $subfields[] = new File_MARC_Subfield('z', 'everything'); // create a data field $data_field = new File_MARC_Data_Field('100', $subfields, '0'); // append the data field $marc_record->appendField($data_field); // create a control field $ctrl_field = new File_MARC_Control_Field('001', '01234567890'); // prepend the control field $marc_record->prependField($ctrl_field); // reproduce test case reported by Mark Jordan $subfields_966_2[] = new File_MARC_Subfield('l', 'web'); $subfields_966_2[] = new File_MARC_Subfield('r', '0'); $subfields_966_2[] = new File_MARC_Subfield('s', 'b'); $subfields_966_2[] = new File_MARC_Subfield('i', '49'); $subfields_966_2[] = new File_MARC_Subfield('c', '1'); $field_966_2 = new File_MARC_Data_Field('966', $subfields_966_2, null, null); $marc_record->appendField($field_966_2); // let's see the results print utf8_encode($marc_record); print "\n"; ?> --EXPECT-- LDR 01850 2200517 4500 001 01234567890 001 0000000044 003 EMILDA 008 980120s1998 fi j 000 0 swe 020 _a9515008808 _cFIM 72:00 035 _99515008808 040 _aNB 042 _9NB _9SEE 084 _aHcd,u _2kssb/6 084 _5NB _auHc _2kssb 084 _5SEE _aHcf _2kssb/6 084 _5Q _aHcd,uf _2kssb/6 100 1 _aJansson, Tove, _d1914-2001 245 04 _aDet osynliga barnet och andra berättelser / _cTove Jansson 250 _a7. uppl. 260 _aHelsingfors : _bSchildt, _c1998 ; _e(Falun : _fScandbook) 300 _a166, [4] s. : _bill. ; _c21 cm 440 0 _aMumin-biblioteket, _x99-0698931-9 500 _aOriginaluppl. 1962 599 _aLi: S 740 4 _aDet osynliga barnet 775 1 _z951-50-0385-7 _w9515003857 _907 841 _5Li _axa _b0201080u 0 4000uu |000000 _e1 841 _5SEE _axa _b0201080u 0 4000uu |000000 _e1 841 _5L _axa _b0201080u 0 4000uu |000000 _e1 841 _5NB _axa _b0201080u 0 4000uu |000000 _e1 841 _5Q _axa _b0201080u 0 4000uu |000000 _e1 841 _5S _axa _b0201080u 0 4000uu |000000 _e1 852 _5NB _bNB _cNB98:12 _hplikt _jR, 980520 852 _5Li _bLi _cCNB _hh,u 852 _5SEE _bSEE 852 _5Q _bQ _j98947 852 _5L _bL _c0100 _h98/ _j3043 H 852 _5S _bS _hSv97 _j7235 900 1s _aYanson, Tobe, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJanssonová, Tove, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJansone, Tuve, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJanson, Tuve, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJansson, Tuve, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJanssonova, Tove, _d1914-2001 _uJansson, Tove, _d1914-2001 976 2 _aHcd,u _bSkönlitteratur 005 20050204111518.0 100 0 _anothing _zeverything 966 _lweb _r0 _sb _i49 _c1 PK�����]f=��=����tests/bad_example.mrcnu�[��������01853 a2200517 450000100110000000300070001100800390001802000260005703500150008304000070009804200120010508400180011708400180013508400210015308400220017410000300019624500630022625000130028926000580030230-0033003604400037003935000023004305990010004537400024004637750034004878410048005218410049005698410047006188410048006658410047007138410047007608520038008078520021008458520013008668520016008798520028008958520021009239000056009449000061010009000057010619000056011189000057011749000060012319760027012910050017013180000000044EMILDA980120s1998 fi j 000 0 swe a9515008808cFIM 72:00 99515008808 aNB 9NB9SEE aHcd,u2kssb/6 5NBauHc2kssb 5SEEaHcf2kssb/6 5QaHcd,uf2kssb/61 aJansson, Tove,d1914-200104aDet osynliga barnet och andra bert̃telser /cTove Jansson a7. uppl. aHelsingfors :bSchildt,c1998 ;e(Falun :fScandbook) a166, [4] s. :bill. ;c21 cm 0aMumin-biblioteket,x99-0698931-9 aOriginaluppl. 1962 aLi: S4 aDet osynliga barnet1 z951-50-0385-7w9515003857907 5Liaxab0201080u 0 4000uu |000000e1 5SEEaxab0201080u 0 4000uu |000000e1 5Laxab0201080u 0 4000uu |000000e1 5NBaxab0201080u 0 4000uu |000000e1 5Qaxab0201080u 0 4000uu |000000e1 5Saxab0201080u 0 4000uu |000000e1 5NBbNBcNB98:12hpliktjR, 980520 5LibLicCNBhh,u 5SEEbSEE 5QbQj98947 5LbLc0100h98/j3043 H 5SbShSv97j72351saYanson, Tobe,d1914-2001uJansson, Tove,d1914-20011saJanssonov,̀ Tove,d1914-2001uJansson, Tove,d1914-20011saJansone, Tuve,d1914-2001uJansson, Tove,d1914-20011saJanson, Tuve,d1914-2001uJansson, Tove,d1914-20011saJansson, Tuve,d1914-2001uJansson, Tove,d1914-20011saJanssonova, Tove,d1914-2001uJansson, Tove,d1914-2001 2aHcd,ubSkn̲litteratur20050204111518.0PK�����]e �� ����tests/marc_011.phptnu�[��������--TEST-- marc_011: iterate and pretty print a MARC record (SOURCE_STRING) --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; // Pull the MARC records into a string (as though we got it from YAZ) $marc_string = file_get_contents($dir . '/' . 'example.mrc'); // Use the File_MARC::SOURCE_STRING flag to indicate that our source is a, uh, string $marc_file = new File_MARC($marc_string, File_MARC::SOURCE_STRING); while ($marc_record = $marc_file->next()) { print $marc_record; print "\n"; } ?> --EXPECT-- LDR 01850 2200517 4500 001 0000000044 003 EMILDA 008 980120s1998 fi j 000 0 swe 020 _a9515008808 _cFIM 72:00 035 _99515008808 040 _aNB 042 _9NB _9SEE 084 _aHcd,u _2kssb/6 084 _5NB _auHc _2kssb 084 _5SEE _aHcf _2kssb/6 084 _5Q _aHcd,uf _2kssb/6 100 1 _aJansson, Tove, _d1914-2001 245 04 _aDet osynliga barnet och andra berttelser / _cTove Jansson 250 _a7. uppl. 260 _aHelsingfors : _bSchildt, _c1998 ; _e(Falun : _fScandbook) 300 _a166, [4] s. : _bill. ; _c21 cm 440 0 _aMumin-biblioteket, _x99-0698931-9 500 _aOriginaluppl. 1962 599 _aLi: S 740 4 _aDet osynliga barnet 775 1 _z951-50-0385-7 _w9515003857 _907 841 _5Li _axa _b0201080u 0 4000uu |000000 _e1 841 _5SEE _axa _b0201080u 0 4000uu |000000 _e1 841 _5L _axa _b0201080u 0 4000uu |000000 _e1 841 _5NB _axa _b0201080u 0 4000uu |000000 _e1 841 _5Q _axa _b0201080u 0 4000uu |000000 _e1 841 _5S _axa _b0201080u 0 4000uu |000000 _e1 852 _5NB _bNB _cNB98:12 _hplikt _jR, 980520 852 _5Li _bLi _cCNB _hh,u 852 _5SEE _bSEE 852 _5Q _bQ _j98947 852 _5L _bL _c0100 _h98/ _j3043 H 852 _5S _bS _hSv97 _j7235 900 1s _aYanson, Tobe, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJanssonov, Tove, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJansone, Tuve, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJanson, Tuve, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJansson, Tuve, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJanssonova, Tove, _d1914-2001 _uJansson, Tove, _d1914-2001 976 2 _aHcd,u _bSknlitteratur 005 20050204111518.0 PK�����]Ҕ �� ����tests/marc_16783.phptnu�[��������--TEST-- marc_16783: iterate and pretty print a non-compliant MARC record (tag = '30-') --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARC($dir . '/' . 'bad_example.mrc'); while ($marc_record = $marc_file->next()) { print $marc_record; print "\n"; } ?> --EXPECT-- LDR 01853 a2200517 4500 001 0000000044 003 EMILDA 008 980120s1998 fi j 000 0 swe 020 _a9515008808 _cFIM 72:00 035 _99515008808 040 _aNB 042 _9NB _9SEE 084 _aHcd,u _2kssb/6 084 _5NB _auHc _2kssb 084 _5SEE _aHcf _2kssb/6 084 _5Q _aHcd,uf _2kssb/6 100 1 _aJansson, Tove, _d1914-2001 245 04 _aDet osynliga barnet och andra bert̃telser / _cTove Jansson 250 _a7. uppl. 260 _aHelsingfors : _bSchildt, _c1998 ; _e(Falun : _fScandbook) 440 0 _aMumin-biblioteket, _x99-0698931-9 500 _aOriginaluppl. 1962 599 _aLi: S 740 4 _aDet osynliga barnet 775 1 _z951-50-0385-7 _w9515003857 _907 841 _5Li _axa _b0201080u 0 4000uu |000000 _e1 841 _5SEE _axa _b0201080u 0 4000uu |000000 _e1 841 _5L _axa _b0201080u 0 4000uu |000000 _e1 841 _5NB _axa _b0201080u 0 4000uu |000000 _e1 841 _5Q _axa _b0201080u 0 4000uu |000000 _e1 841 _5S _axa _b0201080u 0 4000uu |000000 _e1 852 _5NB _bNB _cNB98:12 _hplikt _jR, 980520 852 _5Li _bLi _cCNB _hh,u 852 _5SEE _bSEE 852 _5Q _bQ _j98947 852 _5L _bL _c0100 _h98/ _j3043 H 852 _5S _bS _hSv97 _j7235 900 1s _aYanson, Tobe, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJanssonov,̀ Tove, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJansone, Tuve, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJanson, Tuve, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJansson, Tuve, _d1914-2001 _uJansson, Tove, _d1914-2001 900 1s _aJanssonova, Tove, _d1914-2001 _uJansson, Tove, _d1914-2001 976 2 _aHcd,u _bSkn̲litteratur 005 20050204111518.0 PK�����]7������tests/marc_009.phptnu�[��������--TEST-- marc_009: Parse a record where leader record length != real record length --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARC($dir . '/' . 'wronglen.mrc'); while ($marc_record = $marc_file->next()) { print $marc_record; print "\n"; print "WARNINGS:\n"; foreach ($marc_record->getWarnings() as $warning) { print " * $warning\n"; } } ?> --EXPECT-- LDR 00727nam 2200205 a 4500 001 03-0016458 005 19971103184734.0 008 970701s1997 oru u000 0 eng u 035 _a(Sirsi) a351664 050 00 _aML270.2 _b.A6 1997 100 1 _aAnthony, James R. 245 00 _aFrench baroque music from Beaujoyeulx to Rameau 250 _aRev. and expanded ed. 260 _aPortland, OR : _bAmadeus Press, _c1997. 300 _a586 p. : _bmusic 650 0 _aMusic _<France _y16th century _xHistory and criticism. 650 0 _aMusic _zFrance _y17th century _xHistory and criticism. 650 0 _aMusic _zFrance _y18th century _xHistory and criticism. 949 _aML 270.2 A6 1997 _wLC _i30007006841505 _rY _tBOOKS _lHUNT-CIRC _mHUNEXTRALON WARNINGS: * Invalid record length: Leader says "00727" bytes; actual record length is "741" * Field for tag "949" does not end with an end of field character * Field for tag "596" does not end with an end of field character * Invalid indicators "GSTUFF" forced to blanks for tag "596" PK�����]81��1����tests/marc_record_001.phptnu�[��������--TEST-- marc_record_001: create a MARC record from scratch --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc = new File_MARC_Record(); $marc->appendField(new File_MARC_Data_Field('245', array( new File_MARC_Subfield('a', 'Main title: '), new File_MARC_Subfield('b', 'subtitle'), new File_MARC_Subfield('c', 'author') ), null, null )); print $marc; ?> --EXPECT-- LDR 245 _aMain title: _bsubtitle _cauthor PK�����]è{��{����tests/marc_020.phptnu�[��������--TEST-- marc_020: Test MARC binary output --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; // Get ourselves a MARC record $marc_file = new File_MARC($dir . '/' . 'example.mrc'); $marc_record = $marc_file->next(); // create some subfields $subfields[] = new File_MARC_Subfield('a', 'nothing'); $subfields[] = new File_MARC_Subfield('z', 'everything'); // create a data field $data_field = new File_MARC_Data_Field('100', $subfields, '0'); // append the data field $marc_record->appendField($data_field); // create a control field $ctrl_field = new File_MARC_Control_Field('001', '01234567890'); // prepend the control field $marc_record->prependField($ctrl_field); // reproduce test case reported by Mark Jordan $subfields_966_2[] = new File_MARC_Subfield('l', 'web'); $subfields_966_2[] = new File_MARC_Subfield('r', '0'); $subfields_966_2[] = new File_MARC_Subfield('s', 'b'); $subfields_966_2[] = new File_MARC_Subfield('i', '49'); $subfields_966_2[] = new File_MARC_Subfield('c', '1'); $field_966_2 = new File_MARC_Data_Field('966', $subfields_966_2, null, null); $marc_record->appendField($field_966_2); // let's see the results print convert_uuencode($marc_record->toRaw()); ?> --EXPECT-- M,#$Y-#,@("`@(#(R,#`U-3,@("`T-3`P,#`Q,#`Q,C`P,#`P,#`Q,#`Q,3`P M,#$R,#`S,#`P-S`P,#(S,#`X,#`S.3`P,#,P,#(P,#`R-C`P,#8Y,#,U,#`Q M-3`P,#DU,#0P,#`P-S`P,3$P,#0R,#`Q,C`P,3$W,#@T,#`Q.#`P,3(Y,#@T M,#`Q.#`P,30W,#@T,#`R,3`P,38U,#@T,#`R,C`P,3@V,3`P,#`S,#`P,C`X M,C0U,#`V,C`P,C,X,C4P,#`Q,S`P,S`P,C8P,#`U.#`P,S$S,S`P,#`S,S`P M,S<Q-#0P,#`S-S`P-#`T-3`P,#`R,S`P-#0Q-3DY,#`Q,#`P-#8T-S0P,#`R M-#`P-#<T-S<U,#`S-#`P-#DX.#0Q,#`T.#`P-3,R.#0Q,#`T.3`P-3@P.#0Q M,#`T-S`P-C(Y.#0Q,#`T.#`P-C<V.#0Q,#`T-S`P-S(T.#0Q,#`T-S`P-S<Q M.#4R,#`S.#`P.#$X.#4R,#`R,3`P.#4V.#4R,#`Q,S`P.#<W.#4R,#`Q-C`P M.#DP.#4R,#`R.#`P.3`V.#4R,#`R,3`P.3,T.3`P,#`U-C`P.34U.3`P,#`V M,#`Q,#$Q.3`P,#`U-S`Q,#<Q.3`P,#`U-C`Q,3(X.3`P,#`U-S`Q,3@T.3`P M,#`V,#`Q,C0Q.3<V,#`R-C`Q,S`Q,#`U,#`Q-S`Q,S(W,3`P,#`R-#`Q,S0T M.38V,#`R,3`Q,S8X'C`Q,C,T-38W.#DP'C`P,#`P,#`P-#0>14U)3$1!'CDX M,#$R,',Q.3DX("`@(&9I("`@("!J("`@("`@,#`P(#`@<W=E'B`@'V$Y-3$U M,#`X.#`X'V-&24T@-S(Z,#`>("`?.3DU,34P,#@X,#@>("`?84Y"'B`@'SE. M0A\Y4T5%'B`@'V%(8V0L=1\R:W-S8B\V'B`@'S5.0A]A=4AC'S)K<W-B'B`@ M'S53144?84AC9A\R:W-S8B\V'B`@'S51'V%(8V0L=68?,FMS<V(O-AXQ(!]A M2F%N<W-O;BP@5&]V92P?9#$Y,30M,C`P,1XP-!]A1&5T(&]S>6YL:6=A(&)A M<FYE="!O8V@@86YD<F$@8F5RY'1T96QS97(@+Q]C5&]V92!*86YS<V]N'B`@ M'V$W+B!U<'!L+AX@(!]A2&5L<VEN9V9O<G,@.A]B4V-H:6QD="P?8S$Y.3@@ M.Q]E*$9A;'5N(#H?9E-C86YD8F]O:RD>("`?83$V-BP@6S1=(',N(#H?8FEL M;"X@.Q]C,C$@8VT>(#`?84UU;6EN+6)I8FQI;W1E:V5T+!]X.3DM,#8Y.#DS M,2TY'B`@'V%/<FEG:6YA;'5P<&PN(#$Y-C(>("`?84QI.B!3'C0@'V%$970@ M;W-Y;FQI9V$@8F%R;F5T'C$@'WHY-3$M-3`M,#,X-2TW'W<Y-3$U,#`S.#4W M'SDP-QX@(!\U3&D?87AA'V(P,C`Q,#@P=2`@("`P("`@-#`P,'5U("`@?#`P M,#`P,!]E,1X@(!\U4T5%'V%X81]B,#(P,3`X,'4@("`@,"`@(#0P,#!U=2`@ M('PP,#`P,#`?93$>("`?-4P?87AA'V(P,C`Q,#@P=2`@("`P("`@-#`P,'5U M("`@?#`P,#`P,!]E,1X@(!\U3D(?87AA'V(P,C`Q,#@P=2`@("`P("`@-#`P M,'5U("`@?#`P,#`P,!]E,1X@(!\U41]A>&$?8C`R,#$P.#!U("`@(#`@("`T M,#`P=74@("!\,#`P,#`P'V4Q'B`@'S53'V%X81]B,#(P,3`X,'4@("`@,"`@ M(#0P,#!U=2`@('PP,#`P,#`?93$>("`?-4Y"'V).0A]C3D(Y.#HQ,A]H<&QI M:W0?:E(L(#DX,#4R,!X@(!\U3&D?8DQI'V-#3D(?:&@L=1X@(!\U4T5%'V)3 M144>("`?-5$?8E$?:CDX.30W'B`@'S5,'V),'V,P,3`P'V@Y."\?:C,P-#,@ M2!X@(!\U4Q]B4Q]H4W8Y-Q]J-S(S-1XQ<Q]A66%N<V]N+"!4;V)E+!]D,3DQ M-"TR,#`Q'W5*86YS<V]N+"!4;W9E+!]D,3DQ-"TR,#`Q'C%S'V%*86YS<V]N M;W;A+"!4;W9E+!]D,3DQ-"TR,#`Q'W5*86YS<V]N+"!4;W9E+!]D,3DQ-"TR M,#`Q'C%S'V%*86YS;VYE+"!4=79E+!]D,3DQ-"TR,#`Q'W5*86YS<V]N+"!4 M;W9E+!]D,3DQ-"TR,#`Q'C%S'V%*86YS;VXL(%1U=F4L'V0Q.3$T+3(P,#$? M=4IA;G-S;VXL(%1O=F4L'V0Q.3$T+3(P,#$>,7,?84IA;G-S;VXL(%1U=F4L M'V0Q.3$T+3(P,#$?=4IA;G-S;VXL(%1O=F4L'V0Q.3$T+3(P,#$>,7,?84IA M;G-S;VYO=F$L(%1O=F4L'V0Q.3$T+3(P,#$?=4IA;G-S;VXL(%1O=F4L'V0Q M.3$T+3(P,#$>(#(?84AC9"QU'V)3:_9N;&ET=&5R871U<AXR,#`U,#(P-#$Q M,34Q."XP'C`@'V%N;W1H:6YG'WIE=F5R>71H:6YG'B`@'VQW96(?<C`?<V(? (:30Y'V,Q'AT` ` PK�����]&c��c����tests/marc_002.phptnu�[��������--TEST-- marc_002: iterate and pretty print MARC records from a file with multiple records --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARC($dir . '/' . 'music.mrc'); while ($marc_record = $marc_file->next()) { print $marc_record; print "\n"; } ?> --EXPECT-- LDR 01145ncm 2200277 i 4500 001 000073594 004 AAJ5802 005 20030415102100.0 008 801107s1977 nyujza 010 _a 77771106 035 _a(CaOTUIC)15460184 035 9 _aAAJ5802 040 _aLC 050 00 _aM1366 _b.M62 _dM1527.2 245 04 _aThe Modern Jazz Quartet : _bThe legendary profile. -- 260 _aNew York : _bM.J.Q. Music, _cc1977. 300 _ascore (72 p.) ; _c31 cm. 500 _aFor piano, vibraphone, drums, and double bass. 505 0 _aLewis, J. Django.--Lewis, J. Plastic dreams (music from the film Kemek).--Lewis, J. Dancing (music from the film Kemek).--Lewis, J. Blues in A minor.--Lewis, J. Blues in B♭.--Lewis, J. Precious joy.--Jackson, M. The martyr.--Jackson, M. The legendary profile. 650 0 _aJazz. 650 0 _aMotion picture music _vExcerpts _vScores. 700 12 _aLewis, John, _d1920- _tSelections. _f1977. 700 12 _aJackson, Milt. _tMartyrs. _f1977. 700 12 _aJackson, Milt. _tLegendary profile. _f1977. 740 4 _aThe legendary profile. 852 00 _bMUSIC _cMAIN _kfolio _hM1366 _iM62 _91 _4Marvin Duchow Music _5 LDR 01293cjm 2200289 a 4500 001 001878039 005 20050110174900.0 007 sd fungnn|||e| 008 940202r19931981nyujzn i d 024 1 _a7464573372 028 02 _aJK 57337 _bRed Baron 035 _a(OCoLC)29737267 040 _aSVP _cSVP _dLGG 100 1 _aDesmond, Paul, _d1924- 245 10 _aPaul Desmond & the Modern Jazz Quartet _h[sound recording] 260 _aNew York, N.Y. : _bRed Baron : _bManufactured by Sony Music Entertainment, _cp1993. 300 _a1 sound disc (39 min.) : _bdigital ; _c4 3/4 in. 511 0 _aPaul Desmond, alto saxophone; Modern Jazz Quartet: John Lewis, piano; Milt Jackson, vibraphone; Percy Heath, bass; Connie Kay, drums. 500 _aAll arrangements by John Lewis. 518 _aRecorded live on December 25, 1971 at Town Hall, NYC. 500 _aOriginally released in 1981 by Finesse as LP FW 27487. 500 _aProgram notes by Irving Townsend, June 1981, on container insert. 505 0 _aGreensleeves -- You go to my head -- Blue dove -- Jesus Christ Superstar -- Here's that rainy day -- East of the sun -- Bags' new groove. 650 0 _aJazz _y1971-1980. 700 1 _aLewis, John, _d1920- 710 2 _aModern Jazz Quartet. 740 0 _aPaul Desmond and the Modern Jazz Quartet. LDR 01829cjm 2200385 a 4500 001 001964482 005 20060626132700.0 007 sd fzngnn|m|e| 008 871211p19871957nyujzn d 024 1 _a4228332902 028 01 _a833 290-2 _bVerve 033 0 _a19571027 _b6299 _cD56 033 0 _a196112-- _b3804 _cN4 033 0 _a19571019 _b4104 _cC6 033 0 _a197107-- _b6299 _cV7 035 _a(OCoLC)17222092 040 _aCPL _cCPL _dOCL _dLGG 048 _apz01 _aka01 _asd01 _apd01 110 2 _aModern Jazz Quartet. _4prf 245 14 _aThe Modern Jazz Quartet plus _h[sound recording]. 260 _a[New York] : _bVerve, _cp1987. 300 _a1 sound disc : _bdigital ; _c4 3/4 in. 440 0 _aCompact jazz 511 0 _aModern Jazz Quartet (principally) ; Milt Jackson, vibraphone (2nd and 8th works) ; Oscar Peterson, piano (2nd and 8th works) ; Ray Brown, bass (2nd and 8th works) ; Ed Thigpen (2nd work), Louis Hayes (8th work), drums. 518 _aRecorded live, Oct. 27, 1957, at the Donaueschingen Jazz Festival (1st, 5th, 7th, and 10th works); Dec. 1961, in New York (2nd work); live, Oct. 19, 1957, at the Opera House, Chicago (3rd, 4th, 6th, and 9th works); July 1971, in Villingen, Germany (8th work). 500 _aCompact disc. 500 _aAnalog recording. 505 0 _aThe golden striker (4:08) -- On Green Dolphin Street (7:28) -- D & E (4:55) -- I'll remember April (4:51) -- Cortège (7:15) -- Now's the time (4:43) -- J.B. blues (5:09) -- Reunion blues (6:35) -- 'Round midnight (3:56) -- Three windows (7:20). 650 0 _aJazz. 700 1 _aJackson, Milt. _4prf 700 1 _aPeterson, Oscar, _d1925- _4prf 700 1 _aBrown, Ray, _d1926-2002. _4prf 700 1 _aThigpen, Ed. _4prf 700 1 _aHayes, Louis, _d1937- _4prf 852 80 _bMUSIC _cAV _hCD 1131 _4Marvin Duchow Music _5Audio-Visual PK�����]>������tests/marc_xml_003.phptnu�[��������--TEST-- marc_xml_003: Round-trip a MARCXML record to MARC21 (LOC standard) --SKIPIF-- <?php include('tests/skipif.inc'); ?> --FILE-- <?php $dir = dirname(__FILE__); require __DIR__ . '/bootstrap.php'; $marc_file = new File_MARCXML($dir . '/' . 'sandburg.xml'); while ($marc_record = $marc_file->next()) { print $marc_record->toRaw(); } ?> --EXPECT-- 01142cam 2200301 a 4500001001300000003000400013005001700017008004100034010001700075020002500092040001800117042000900135050002600144082001600170100003200186245008600218250001200304260005200316300004900368500004000417520022800457650003300685650003300718650002400751650002100775650002300796700002100819 92005291 DLC19930521155141.9920219s1993 caua j 000 0 eng  a 92005291  a0152038655 :c$15.95 aDLCcDLCdDLC alcac00aPS3537.A618bA88 199300a811/.522201 aSandburg, Carl,d1878-1967.10aArithmetic /cCarl Sandburg ; illustrated as an anamorphic adventure by Ted Rand. a1st ed. aSan Diego :bHarcourt Brace Jovanovich,cc1993. a1 v. (unpaged) :bill. (some col.) ;c26 cm. aOne Mylar sheet included in pocket. aA poem about numbers and their characteristics. Features anamorphic, or distorted, drawings which can be restored to normal by viewing from a particular angle or by viewing the image's reflection in the provided Mylar cone. 0aArithmeticxJuvenile poetry. 0aChildren's poetry, American. 1aArithmeticxPoetry. 1aAmerican poetry. 1aVisual perception.1 aRand, Ted,eill. PK�����^]�!��!�� ��CHANGELOGnu�[��������1.4.1 * Reintroduce include_path to composer.json 1.4.0 * Update File_MARC_Lint to match MARC::Lint 1.52 (thanks Demian Katz) * Warn about out-of-range skip indicators (thanks Demian Katz) * Support initialization from SimpleXMLELement object (thanks Dan Michael O. Heggø) * Fix Travis-CI support (thanks Daniel O'Connor) * Tweak composer.json to support Composer 2.0 * Silence PEAR style errors and warnings in File/MARCBASE.php 1.3.0 * Support reading MARC-in-JSON serializations * Fix positions using MARC_List's appendNode method (thanks Waldemar Bartikowski!) 1.2.0 * Support injection of extended Record class (thanks Dan Michael O. Heggø!) * Support regular expression matching of subfields (thanks Waldemar Bartikowski!) * Fix deletion of multiple subfields at once (thanks Dan Michael O. Heggø!) 1.1.5 * Drop support for PHP 5.3 and 5.4 1.1.4 * Fix insertField() behaviour, which could truncate records (reported by Andreas Roussos) * Docs correction for Data_Field (thanks Daniel Walter) 1.1.3 * Add a getContents() convenience method, contributed by Carsten Klee 1.1.2 * Fetch pear_exception from Packagist [danmichaelo] 1.1.1 * Add MARC-in-JSON serialization fix for subfield 0 json_encode() limitation (thanks to Bill Dueber for reporting the bug) 1.1.0 * Enable namespaces in MARCXML handling (thanks Carsten Klee!) * Remove skip check for Structures/Linked_List 1.0.2 * Update MARC_Lint set of rules (thanks Demian Katz!) 1.0.1 * Fix bug in MARC binary serialization of subfields with value '0'. Thanks to Mark Jordan (mjordan@sfu.ca) for the bug report. 1.0.0 * First stable release! 0.8.0-beta * Drop Structures_LinkedList dependency in favour of SplDoublyLinkedList. This bumps the minimum PHP version up to 5.2.0. 0.7.3-beta * Merge patch from Karen Coombs (librarywebchic@gmail.com) adding default namespace to record elements 0.7.2-beta * Fix bug #19845 - Record::toXML() returns nothing 0.7.1-beta * Make Validate_ISPN an optional dependency 0.6.2-beta * Improve handling of bad leader data, including declared length and overly long leaders in MARCXML 0.6.1-beta * Correct layout per bug #17704 0.6.0-beta * Add two flavours of JSON output from File_MARC_Record: toJSON() and toJSONHash() 0.5.2-beta * Enable File_MARC_Record to be invoked with a null constructor again, useful for building MARC records from scratch * Add a test to check that the null constructor works to avoid future regressions 0.5.1-beta * Explicitly cast results to strings to avoid returning XML objects when File_MARCXML is in effect; problem doesn't show up in the PHP CLI, but does cause problems on the Web 0.5.0-beta * Drop MARCFLAT as it is unmaintained and, to my knowledge, unused * Add the ability to generate a proper collection of MARCXML records * Factor out some of the common toXML()-related methods to a new base class * Add tests of the new toXML() functionality for both MARC and MARCXML sources 0.4.4-beta * Enable MARCXML to handle bad tags, to match MARC * Handle corner case where only one indicator might have been provided 0.4.3-beta * Fix bug #16783 - handle bad MARC tags via warnings instead of bubbling an exception all the way up 0.4.2-beta * Fix bug #16642 - MARCXML files return keys of an invalid type 0.4.1-beta * Fix suggested by Dan Field (surfrdan @ gmail.com) for addWarnings() typo 0.4.0-beta * Add formatField() convenience method to File_MARC_Field (courtesy Mark Matienzo @ matienzo.org) * Move from split() to explode() to avoid PHP 5.3 deprecation warning (courtesy bertrand.zuchuat @ rero.ch 0.3.0-beta * Add isControlField() and isDataField() convenience methods to File_MARC_Field 0.2.3-beta * Handle single-record MARC21XML files with "record" as the root element 0.1.1-alpha * Add File_MARC_Record::toXML() method for generating MARCXML output * Add File_MARCXML class for reading MARCXML source * Add tests for MARCXML methods 0.1.0-alpha * Split each class out into its own file * Do not return anything from constructors 0.0.9-alpha * Separate getFields() from getField(), getSubfields() from getSubfield() to avoid forcing users to test is_array() after every call * Add addWarnings() / getWarnings() for records to avoid throwing an exception for a non-fatal error * Fix examples, touch up phpdoc in preparation for call for votes 0.0.8-alpha * Switch to PEAR_Exception for error handling 0.0.7-alpha * Implement useful key() overrides for key=>value iteration through fields and subfields * Adjust to new Structures_LinkedList_Double names 0.0.6-alpha * Remove package globals, define class constants & static vars instead * Change addField/Subfield() to append..(), prepend...(), and insert...() 0.0.5-alpha * Work towards a more consistent API (delete getAllSubfields) * Make PCRE expressions in getFields() and deleteFields() optional. * Make duplicate() actually return a deep copy of a record. * Stronger, better, faster (now with typehints) * Iterate with foreach() everywhere now 0.0.4-alpha * Adjust to Structures_Linked_List package name change and minor API changes * Adhere to PEAR CS (thanks PHP_CodeSniffer!) * Correct sloppy use of references (thanks E_STRICT!) * Okay, this time real error handling using PEAR_ErrorStack * Prepare first package for PEPR 0.0.3-alpha * Split MARC into separate File_MARC and Structure_Linked_List packages (with corresponding renaming of classes and constants) * Adopt PEAR naming conventions (s/MARC/File_MARC/) * Initial stab at PEAR_ErrorStack error handling 0.0.2-alpha * Fix marc_004.phpt: explicitly compare object references with === operator * Document all constants. * Fix MARC_Field::deleteSubfield() function * Add this ChangeLog 0.0.1-alpha * First publicly available release, based on MARC decoding algorithm from the emilda.org php-marc package with a completely new API and class hierarchy PK�����^]Dg��Dg����LICENSEnu�[�������� GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! PK�����^]������examples/subfields.phpnu�[��������<?php require 'File/MARC.php'; // File_MARC offers the ability to add subfields at any point within // an existing set of subfields // First, create some subfields $subfields[] = new File_MARC_Subfield('a', 'nothing'); $subfields[] = new File_MARC_Subfield('z', 'everything'); // Then, create a field including those subfields $field = new File_MARC_Data_Field('100', $subfields, '0'); // Create some new subfields $subfield1 = new File_MARC_Subfield('g', 'a little'); $subfield2 = new File_MARC_Subfield('k', 'a bit more'); $subfield3 = new File_MARC_Subfield('t', 'a lot'); // Append a new subfield to the existing set of subfields // Expected order: a-z-g $field->appendSubfield($subfield1); // Insert a new subfield after the first subfield with code 'z' // Expected order: a-z-k-g $sf = $field->getSubfields('z'); // getSubfields() always returns an array; we just want the first subfield if (count($sf) > 0) { $field->insertSubfield($subfield2, $sf[0]); } // Insert a new subfield prior to the first subfield with code 'z' // Expected order: a-t-z-k-g $sf = $field->getSubfield('z'); // getSubfield() simply returns the first matching subfield if ($sf) { $field->insertSubfield($subfield3, $sf, true); } // let's see the results print $field; print "\n"; ?> PK�����^]cV������examples/marc_yaz.phpnu�[��������<?php $dir = dirname(__FILE__); require 'File/MARC.php'; // Define the usable fields for our CCL query $ccl_fields = array( "ti" => "1=4", "au" => "1=1", "isbn" => "1=7" ); // Declare the array that will hold the parsed results $ccl_results = array(); // Connect to the laurentian.ca Z39.50 server $conn = yaz_connect('142.51.8.7:2200/UNICORN'); yaz_ccl_conf($conn, $ccl_fields); // Define our query for a most excellent text $ccl_query = "ti='derby' and au='scott'"; // Parse the CCL query into yaz's native format $result = yaz_ccl_parse($conn, $ccl_query, $ccl_results); if (!$result) { echo "Error: " . $ccl_results['errorstring']; exit(); } // Submit the query $rpn = $ccl_results['rpn']; yaz_search($conn, 'rpn', $rpn); yaz_wait(); // Any errors trying to retrieve this record? $error = yaz_error($conn); if ($error) { print "Error: $error\n"; exit(); } // Retrieve the first MARC record as raw MARC $rec = yaz_record($conn, 1, "raw"); if (!$rec) { print "Error: Retrieved no results.\n"; exit(); } // Parse the retrieved MARC record $marc_file = new File_MARC($rec, File_MARC::SOURCE_STRING); while ($marc_record = $marc_file->next()) { print $marc_record; print "\n"; } ?> PK�����^]~N0:��:����examples/example.mrcnu�[��������01850 2200517 45000010011000000030007000110080039000180200026000570350015000830400007000980420012001050840018001170840018001350840021001530840022001741000030001962450062002262500013002882600058003013000033003594400037003925000023004295990010004527400024004627750034004868410048005208410049005688410047006178410048006648410047007128410047007598520038008068520021008448520013008658520016008788520028008948520021009229000056009439000060009999000057010599000056011169000057011729000060012299760026012890050017013150000000044EMILDA980120s1998 fi j 000 0 swe a9515008808cFIM 72:00 99515008808 aNB 9NB9SEE aHcd,u2kssb/6 5NBauHc2kssb 5SEEaHcf2kssb/6 5QaHcd,uf2kssb/61 aJansson, Tove,d1914-200104aDet osynliga barnet och andra berttelser /cTove Jansson a7. uppl. aHelsingfors :bSchildt,c1998 ;e(Falun :fScandbook) a166, [4] s. :bill. ;c21 cm 0aMumin-biblioteket,x99-0698931-9 aOriginaluppl. 1962 aLi: S4 aDet osynliga barnet1 z951-50-0385-7w9515003857907 5Liaxab0201080u 0 4000uu |000000e1 5SEEaxab0201080u 0 4000uu |000000e1 5Laxab0201080u 0 4000uu |000000e1 5NBaxab0201080u 0 4000uu |000000e1 5Qaxab0201080u 0 4000uu |000000e1 5Saxab0201080u 0 4000uu |000000e1 5NBbNBcNB98:12hpliktjR, 980520 5LibLicCNBhh,u 5SEEbSEE 5QbQj98947 5LbLc0100h98/j3043 H 5SbShSv97j72351saYanson, Tobe,d1914-2001uJansson, Tove,d1914-20011saJanssonov, Tove,d1914-2001uJansson, Tove,d1914-20011saJansone, Tuve,d1914-2001uJansson, Tove,d1914-20011saJanson, Tuve,d1914-2001uJansson, Tove,d1914-20011saJansson, Tuve,d1914-2001uJansson, Tove,d1914-20011saJanssonova, Tove,d1914-2001uJansson, Tove,d1914-2001 2aHcd,ubSknlitteratur20050204111518.0PK�����^]~������examples/read.phpnu�[��������<?php require 'File/MARC.php'; // Read MARC records from a stream (a file, in this case) $marc_source = new File_MARC('example.mrc'); // Retrieve the first MARC record from the source $marc_record = $marc_source->next(); // Retrieve a personal name field from the record $names = $marc_record->getFields('100'); foreach ($names as $name_field) { // Now print the $a subfield switch ($name_field->getIndicator(1)) { case 0: print "Forename: "; break; case 1: print "Surname: "; break; case 2: print "Family name: "; break; } $name = $name_field->getSubfields('a'); if (count($name) == 1) { print $name[0]->getData() . "\n"; } else { print "Error -- \$a subfield appears more than once in this field!"; } } print "\nPrint all series statement fields (4xx):\n"; // Retrieve all series statement fields // Series statement fields start with a 4 (PCRE) $subjects = $marc_record->getFields('^4', true); // Iterate through all of the returned series statement fields foreach ($subjects as $field) { // print with File_MARC_Field_Data's magic __toString() method print $field; } print "\n"; ?> PK�������]���������������������tests/marc_xml_005.phptnu�[��������PK�������]#" )�� )��������������2��tests/marc_022.phptnu�[��������PK�������]\.iv��v��������������/��tests/sandburg.mrcnu�[��������PK�������]E4kL �� ��������������74��tests/marc_001.phptnu�[��������PK�������]#c �� ��������������E>��tests/onerecord.xmlnu�[��������PK�������]F-/��/��������������tK��tests/marc_field_002.phptnu�[��������PK�������]rP �� ��������������M��tests/marc_xml_004.phptnu�[��������PK�������]0S����������������AY��tests/marc_subfield_001.phptnu�[��������PK�������].%`��`��������������j\��tests/marc_010.phptnu�[��������PK�������]_X���������������� o��tests/marc_field_004.phptnu�[��������PK�������]2.i ��i ��������������r��tests/marc_018.phptnu�[��������PK�������]!Ņ\������������������tests/marc_xml_001.phptnu�[��������PK�������]<-��-��������������ϝ��tests/marc_subfield_002.phptnu�[��������PK�������]_|6 ��6 ��������������H��tests/marc_lint_002.phptnu�[��������PK�������]y �� ��������������ƫ��tests/marc_lint_003.phptnu�[��������PK�������](Y������������������tests/xmlescape.mrcnu�[��������PK�������]~N0:��:����������������tests/example.mrcnu�[��������PK�������]泮������������������tests/music.mrcnu�[��������PK�������]jS �� ��������������|��tests/marc_015.phptnu�[��������PK�������]a!������������������tests/namespace.xmlnu�[��������PK�������]}& G��G���������������tests/marc_lint_004.phptnu�[��������PK�������]2������������������6�tests/skipif.incnu�[��������PK�������]9D��D��������������'�tests/marc_017.phptnu�[��������PK�������]����������������+�tests/marc_xml_namespace.phptnu�[��������PK�������]`����������������.�tests/marc_012.phptnu�[��������PK�������]cܯ����������������6�tests/marc_xml_006.phptnu�[��������PK�������]c����������������;�tests/marc_xml_16642.phptnu�[��������PK�������]{ �� ��������������?�tests/marc_xml_rsinger.phptnu�[��������PK�������]F;Re%��e%��������������J�tests/marc_004.phptnu�[��������PK�������]B1 �� ��������������o�tests/marc_lint_005.phptnu�[��������PK�������]s}����$������������yz�tests/marc_xml_namespace_prefix.phptnu�[��������PK�������]}۶\p��p��������������}�tests/bad_example.xmlnu�[��������PK�������] ����������������=�tests/marc_field_005.phptnu�[��������PK�������]p̎u1��u1��������������}�tests/marc_016.phptnu�[��������PK�������](N��N��������������5�tests/camel.mrcnu�[��������PK�������])] �� ���������������tests/marc_005.phptnu�[��������PK�������]W)��)���������������tests/marc_019.phptnu�[��������PK�������]=O �� �������������� �tests/sandburg.xmlnu�[��������PK�������] VU,��,��������������k�tests/marc_field_21246.phptnu�[��������PK�������]O~iK!��K!���������������tests/marc_013.phptnu�[��������PK�������]ye@����������������p<�tests/marc_xml_007.phptnu�[��������PK�������]44-����������������@�tests/marc_field_003.phptnu�[��������PK�������]1��1��������������xG�tests/marc_xml_008.phptnu�[��������PK�������] \����������������Ay�tests/marc_lint_001.phptnu�[��������PK�������]Y��Y��������������.�tests/marc_xml_009.phptnu�[��������PK�������]����������������Ώ�tests/marc_008.phptnu�[��������PK�������]+W �� ���������������tests/bigarchive.xmlnu�[��������PK�������]x;#��#���������������tests/marc_006.phptnu�[��������PK�������]kP����������������S�tests/marc_023.phptnu�[��������PK�������]f~�����������������tests/marc_field_001.phptnu�[��������PK�������]%Hh��h��������������z�tests/marc_003.phptnu�[��������PK�������]S3 �� ��������������%�tests/marc_021.phptnu�[��������PK�������]p޸����������������t�tests/marc_007.phptnu�[��������PK�������]N&��&��������������o�tests/marc_xml_002.phptnu�[��������PK�������]5;-��-���������������tests/music.xmlnu�[��������PK�������]ԛ �� ���������������tests/marc_014.phptnu�[��������PK�������]f=��=���������������tests/bad_example.mrcnu�[��������PK�������]e �� ��������������X�tests/marc_011.phptnu�[��������PK�������]Ҕ �� ��������������^&�tests/marc_16783.phptnu�[��������PK�������]7����������������]0�tests/marc_009.phptnu�[��������PK�������]81��1��������������6�tests/marc_record_001.phptnu�[��������PK�������]è{��{��������������!9�tests/marc_020.phptnu�[��������PK�������]&c��c��������������H�tests/marc_002.phptnu�[��������PK�������]>����������������[�tests/marc_xml_003.phptnu�[��������PK�������^]�!��!�� ������������a�CHANGELOGnu�[��������PK�������^]Dg��Dg��������������x�LICENSEnu�[��������PK�������^]����������������z�examples/subfields.phpnu�[��������PK�������^]cV�����������������examples/marc_yaz.phpnu�[��������PK�������^]~N0:��:���������������examples/example.mrcnu�[��������PK�������^]~����������������Y�examples/read.phpnu�[��������PK����F�F�9��U���