RecordXmlFormatter

OAI-PMH XML Record Formatter

category

VuFind

package

Harvest_Tools

author

Demian Katz demian.katz@villanova.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Methods

Constructor

__construct(array $settings = array()) 

Arguments

$settings

array

Configuration settings

Format a line of XML.

createTag(string $tag, string $value) : string

Arguments

$tag

string

Tag name

$value

string

Content of tag

Response

string

Extract attributes from the <metadata> tag that need to be inserted into the metadata record contained within the tag.

extractMetadataAttributes(string $raw, string $record) : string

Arguments

$raw

string

The full XML

$record

string

The metadata record with the outer tag stripped off.

Response

string

Fix namespaces in the top tag of the XML document to compensate for bugs in the SimpleXML library.

fixNamespaces(string $xml, array $ns, string $attr = '') : string

Arguments

$xml

string

XML document to clean up

$ns

array

Namespaces to check

$attr

string

Attributes extracted from the tag

Response

string

Save a record to disk.

format(string $id, object $recordObj) : string

Arguments

$id

string

ID of record to save.

$recordObj

object

Record to save (in SimpleXML format).

Response

string

Format header elements as XML tags for inclusion in final record.

getHeaderAdditions(object $header) : string

Arguments

$header

object

Header element (in SimpleXML format).

Response

string

Format setSpec header element as XML tags for inclusion in final record.

getHeaderSetAdditions(object $setSpec) : string

Arguments

$setSpec

object

Header setSpec element (in SimpleXML format).

Response

string

Format the ID as an XML tag for inclusion in final record.

getIdAdditions(string $id) : string

Arguments

$id

string

Record ID

Response

string

Do we need access to set information?

needsSetNames() : boolean

Response

boolean

Perform global search and replace.

performGlobalReplace(string $xml) : string

Arguments

$xml

string

XML to update.

Response

string

Inject set name information.

setSetNames(array $names) : void

Arguments

$names

array

Associative array of setSpec => setName

Properties

Search strings for global search-and-replace.

globalSearch : array
var

Type(s)

array

Replacement strings for global search-and-replace.

globalReplace : array
var

Type(s)

array

Tag to use for injecting IDs into XML (false for none)

injectId : string|boolean
var

Type(s)

string|boolean

Tag to use for injecting setSpecs (false for none)

injectSetSpec : string|boolean
var

Type(s)

string|boolean

Tag to use for injecting set names (false for none)

injectSetName : string|boolean
var

Type(s)

string|boolean

Tag to use for injecting datestamp (false for none)

injectDate : string|boolean
var

Type(s)

string|boolean

List of header elements to copy into body

injectHeaderElements : array
var

Type(s)

array

Associative array of setSpec => setName

setNames : array
var

Type(s)

array