File_MARC
[ class tree: File_MARC ] [ index: File_MARC ] [ all elements ]

Class: File_MARCXML

Source Location: /File_MARC-0.2.3/MARCXML.php

Class Overview


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


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

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


[ Top ]


Class Variables

$counter =

[line 99]

Counter for MARCXML records in a collection
  • Access: protected

Type:   int


[ Top ]

$source =

[line 85]

Source containing raw records
  • Access: protected

Type:   resource


[ Top ]

$type =

[line 92]

Source type (SOURCE_FILE or SOURCE_STRING)
  • Access: protected

Type:   int


[ Top ]



Method Detail

__construct (Constructor)   [line 122]

File_MARCXML __construct( string $source, [int $type = self::SOURCE_FILE])

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.  ?>


Parameters:

string   $source   —  Name of the file, or a raw MARC string
int   $type   —  Source of the input, either SOURCE_FILE or SOURCE_STRING

[ Top ]

next   [line 172]

File_MARC_Record next( )

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

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:26:07 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.