better way?

From: Date: Thu, 17 Jul 2003 01:41:30 +0000
Subject: better way?
Groups: php.xml.dev 
Request: Send a blank email to php-xml-dev+get-156@lists.php.net to get a copy of this message
From an earlier thread I modified this with the new function names.. but, what I wish to do is load an external xsl doc. Is this possible? something like: $dom->applyXslDoc('my.xsl'); <?php // create new xsltprocessor $proc = new xsltprocessor(); // create new domDocument $dom = new domDocument; // create new domDocument $dom2 = new domDocument; // load domDocument from string $dom2->loadxml('<?xml version="1.0" encoding="UTF-8"?><root>hello world</root>'); // load domDocument from string $dom->loadxml('<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html"/> <xsl:template match="/"> <html> <body> <xsl:value-of select="root"/> <p/> </body> </html> </xsl:template> </xsl:stylesheet>'); // import stylesheet from domDocument $proc->importStylesheet($dom); // create domDocument from transformation (returns domDocument) $result = $proc->transformToDoc($dom2); // output domDocument xml to string print $result->savexml(); ?> Kind regards Kevin -- ______ (_____ \ _____) ) ____ ____ ____ ____ | ____/ / _ ) / _ | / ___) / _ ) | | ( (/ / ( ( | |( (___ ( (/ / |_| \____) \_||_| \____) \____) Kevin Waterson Port Macquarie, Australia

« previous php.xml.dev (#156) next »