note 62686 added to function.xsl-xsltprocessor-set-parameter
| From: | heinemanndotjuergenathjcmsdotde at osu1 dot php dot net | Date: | Tue, 07 Mar 2006 11:39:55 +0000 |
| Subject: | note 62686 added to function.xsl-xsltprocessor-set-parameter | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-104969@lists.php.net to get a copy of this message | ||
Example for how it works.
<?xml version = '1.0' encoding = 'utf-8' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"
indent="yes"
encoding="ISO-8859-15"
doctype-system = "-//W3C//DTD XHTML 1.0 Transitional//EN"
doctype-public = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
/>
<xsl:template match="docs">
<html>
<head>
<title>
<xsl:text>Example</xsl:text>
</title>
</head>
<body>
<xsl:for-each select="block">
<div>
<xsl:value-of select="." />
</div>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
------------------
<?php
$dom = new DomDocument( '1.0', 'utf-8' );
$xsl = new XSLTProcessor;
$xsl->setParameter( 'block', 'xmlns', 'http://www.w3.org/1999/xhtml' );
$style = realpath( "./my_stylesheet.xslt" );
$dom->load( $style );
$xsl->importStyleSheet( $dom );
$dom->loadXML( '<docs>
<block>Howto set xhtml Transitional Namespaces width php</block>
<block>see http://www.php.net</block>
</docs>' );
$out = $xsl->transformToXML( $dom );
var_dump( '<pre>',
htmlentities( $out, ENT_QUOTES, 'utf-8' ),
$xsl->getParameter( 'block', 'xmlns' ),
$xsl->getParameter( 'docs', 'xmlns' ),
'</pre>' );
?>
----
Server IP: 66.163.161.117
Probable Submitter: 84.173.201.129
----
X-Spam-Status: No, hits=4.0 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER,
HTML_20_30,HTML_MESSAGE autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.xsl-xsltprocessor-set-parameter.php
Edit -- http://master.php.net/note/edit/62686
Del: integrated -- http://master.php.net/note/delete/62686/integrated
Del: useless -- http://master.php.net/note/delete/62686/useless
Del: bad code -- http://master.php.net/note/delete/62686/bad+code
Del: spam -- http://master.php.net/note/delete/62686/spam
Del: non-english -- http://master.php.net/note/delete/62686/non-english
Del: in docs -- http://master.php.net/note/delete/62686/in+docs
Del: other reasons-- http://master.php.net/note/delete/62686
Reject -- http://master.php.net/note/reject/62686
Search -- http://master.php.net/manage/user-notes.php