Class File_MARCXML

Description

The main File_MARCXML class enables you to return File_MARC_Record objects from an XML stream or string.

Located in /MARCXML.php (line 63)


	
			
Class Constant Summary
Variable Summary
int $counter
resource $source
int $type
Method Summary
File_MARCXML __construct (int $source, [ $type = self::SOURCE_FILE], string $in)
Variables
int $counter (line 98)

Counter for MARCXML records in a collection

  • access: protected
resource $source (line 84)

Source containing raw records

  • access: protected
int $type (line 91)

Source type (SOURCE_FILE or SOURCE_STRING)

  • access: protected
Methods
Constructor __construct (line 122)

Read in MARCXML records

This function reads in files or strings that contain one or more MARCXML records.

  1.  <?php
  2.  // Retrieve MARC records from a file
  3.   $journals new File_MARC('journals.mrc'SOURCE_FILE);
  4.  
  5.  // Retrieve MARC records from a string (e.g. Z39 query results)
  6.   $monographs new File_MARC($raw_marcSOURCE_STRING);
  7.  ?>

File_MARCXML __construct (int $source, [ $type = self::SOURCE_FILE], string $in)
  • string $in: Name of the file, or a raw MARC string
  • int $source: Source of the input, either SOURCE_FILE or SOURCE_STRING
  • $type
next (line 172)

Return next File_MARC_Record object

Decodes the next MARCXML record and returns the File_MARC_Record object.

  1.  <?php
  2.  // Retrieve a set of MARCXML records from a file
  3.   $journals new File_MARCXML('journals.xml'SOURCE_FILE);
  4.  
  5.  // Iterate through the retrieved records
  6.   while ($record $journals->next()) {
  7.      print $record;
  8.      print "\n";
  9.  }
  10.  
  11.  ?>

  • return: next record, or false if there are no more records
Class Constants
SOURCE_FILE = 1 (line 70)

MARC records retrieved from a file

SOURCE_STRING = 2 (line 75)

MARC records retrieved from a binary string

Documentation generated on Mon, 01 Jan 2007 23:44:42 -0500 by phpDocumentor 1.3.1