note 48659 deleted from function.xsl-xsltprocessor-set-parameter by didou

From: Date: Tue, 04 Jan 2005 10:41:35 +0000
Subject: note 48659 deleted from function.xsl-xsltprocessor-set-parameter by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-82686@lists.php.net to get a copy of this message
Note Submitter: nikolaeff at gmail dot com ---- Little example... transform.php: <?php $name="mr. Anderson"; $xml = new DomDocument; $xml->load('example.xml'); $xsl = new DomDocument; $xsl->load('example.xsl'); $proc = new xsltprocessor; $proc->setParameter('', 'name', $name); $proc->importStyleSheet($xsl); echo $proc->transformToXML($xml); ?> example.xsl: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" encoding="iso-8869-1" indent="no"/> <xsl:template match="/"> <h3>Hello, <xsl:value-of select="$name"/></h3> </xsl:template> </xsl:stylesheet> example.xml: <?xml version="1.0" encoding="iso-8859-1" ?> <names> </names>

« previous php.notes (#82686) next »