Need to know how to process 1 XML file with 2 XSL files using PHP SimpleXML -


i new xsl. need process same xml file 2 xsl files using php simplexml. have tried few different approaches no luck.

$xmlfile = 'media/xml_files/article.xml'; if (file_exists($xmlfile)) { $xml = simplexml_load_file($xmlfile) or die("error: cannot create object");} $xslfile = media/xsl_files/jats-html.xsl; $xsl = simplexml_load_file($xslfile); $proc = new xsltprocessor; $proc->importstylesheet($xsl); echo $proc->transformtoxml($xml); 

i need process xml jats-pmccit.xsl before goes through jats-html.xsl transform. can please point me in right direction? can't seem find answer online anywhere.

you can try using xsltprocessor::transformtodoc() process first transformation , intermediate transformation result in domdocument object type. can pass domdocument object transformtoxml() final transformation result.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -