PHP code example of ck / picaxmlconv
1. Go to this page and download the library: Download ck/picaxmlconv library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ck / picaxmlconv example snippets
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
}
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();