This is a discussion on Virtual Xml DOMDocument within the PHP Language forums, part of the PHP Programming Forums category; I would like to create a class that acts like an Xml document so that I can pass it through ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I would like to create a class that acts like an Xml document so that I
can pass it through an XSLT transform. But, there is never any Document created. Basically, what I'm trying to do, is a virtual XML layer over a persistence framework that allows you to access a database with XPath queries. I've already done something like this in another project and language, but, it's too custom to pass into an XSLT transform. Also, the database huge. I only want to read the portions in... requested by all the XPATH stuff in the XSLT file. So, I basically want to do something like..... class DBDOMDoc extends DOMDocument { var $PersistenceObject; // This object is the head of the hierarchy... .... override reading of the nodes, with Persistence Framework requests (db queries ) } $xml = new DBDOMDoc; $xml->PersistenceObject = $someDBObj; // Configure the transformer $proc = new XSLTProcessor; $proc->importStyleSheet($xsl); // attach the xsl rules if ( $argc == 4 && $argv[3]=='dom' ){ echo $proc->transformToDoc($xml)->firstChild->wholeText; } else { echo $proc->transformToXml($xml); } Any help is appreciated.... |