SimpleXmlResponseProcessor
in package
implements
ResponseProcessorInterface
Class for processing API responses into SimpleXML objects.
Tags
Interfaces, Classes, Traits and Enums
- ResponseProcessorInterface
- Interface for processing API responses.
Table of Contents
- $badXmlLog : string|bool
- Filename for logging bad XML responses (false for none)
- $sanitize : bool
- Should we sanitize XML?
- $sanitizeRegex : array<string|int, mixed>
- An array of regex strings used to sanitize XML
- __construct() : mixed
- Constructor
- process() : mixed
- Process an OAI-PMH response into a SimpleXML object. Throw an exception if an error is detected.
- collectXmlErrors() : string
- Collect LibXML errors into a single string.
- logBadXML() : void
- Log a bad XML response.
- sanitizeXml() : string
- Sanitize XML.
Properties
$badXmlLog
Filename for logging bad XML responses (false for none)
protected
string|bool
$badXmlLog
= false
$sanitize
Should we sanitize XML?
protected
bool
$sanitize
= false
$sanitizeRegex
An array of regex strings used to sanitize XML
protected
array<string|int, mixed>
$sanitizeRegex
= []
Methods
__construct()
Constructor
public
__construct(string $basePath[, array<string|int, mixed> $settings = [] ]) : mixed
Parameters
- $basePath : string
-
Base path to harvest directory.
- $settings : array<string|int, mixed> = []
-
OAI-PMH settings from oai.ini.
Return values
mixed —process()
Process an OAI-PMH response into a SimpleXML object. Throw an exception if an error is detected.
public
process(string $xml) : mixed
Parameters
- $xml : string
-
Raw XML to process
Tags
Return values
mixed —collectXmlErrors()
Collect LibXML errors into a single string.
protected
collectXmlErrors() : string
Return values
string —logBadXML()
Log a bad XML response.
protected
logBadXML(string $xml) : void
Parameters
- $xml : string
-
Bad XML
Return values
void —sanitizeXml()
Sanitize XML.
protected
sanitizeXml(string $rawXml) : string
Parameters
- $rawXml : string
-
XML to sanitize