Voting

: max(zero, three)?
(Example: nine)

The Note You're Voting On

heinemann dot juergen at hjcms dot de
19 years ago
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>' );

?>

<< Back to user notes page

To Top