library picaxmlconv
Converts picaXML and ppmxl vive versa.
ck/picaxmlconv
Converts picaXML and ppmxl vive versa.
- Monday, February 15, 2016
- by collidoscope
- Repository
- 3 Watchers
- 0 Stars
- 7 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
Pica+ XML Converter
Converts PicaXML (namespace info:srw/schema/5/picaXML-v1.0) and ppxml (namespace http://www.oclcpica.org/xmlns/ppxml-1.0) vice versa., (*1)
Installation
composer require ck/picaxmlconv
Usage
require vendor/autoload.php;
use CK\PicaXMLConv\PicaXMLConv;
$pconv = new PicaXMLConv;
$picaXML = $pconv->convert('/path/to/ppxml.xml');
print $picaXML; # XML
print get_class($picaXML->getSource()); # DOMDocument
if($pconv->validate($picaXML)) {
print $pconv->getNamespace(); # info:srw/schema/5/picaXML-v1.0
$pconv->convert();
$pconv->validate($pconv->getTarget());
print $pconv->getNamespace(); # http://www.oclcpica.org/xmlns/ppxml-1.0
}
Usage with HAB\Pica\Reader\PicaXmlReader
composer require ck/picaxmlconv hab/picareader
require vendor/autoload.php;
use CK\PicaXMLConv\PicaXMLConv;
use HAB\Pica\Reader\PicaXmlReader;
$pconv = new PicaXMLConv;
$picaXML = $pconv->convert('/path/to/ppxml.xml');
$reader = new PicaXmlReader;
$reader->open($picaXML);
while($record = $reader->read()) {
...
}
$reader->close();
API
For CK\PicaXMLConv::convert and CK\PicaXMLConv::validate string is either XML or a valid file path., (*2)
- CK\PicaXMLConv::convert(string|DOMDocument)
- CK\PicaXMLConv::validate(string|DOMDocument)
- CK\PicaXMLConv::getSource()
- CK\PicaXMLConv::getTarget()
- CK\PicaXMLConv::getNamespace()
Resources
XSL
XSD
dev-master
9999999-dev
Converts picaXML and ppmxl vive versa.
Sources
Download
MIT
The Requires
v0.1.2
0.1.2.0
Converts picaXML and ppmxl vive versa.
Sources
Download
MIT
The Requires