All pastes #387695 Raw Edit

Miscellany

public php v1 · immutable
·published 2007-03-09 15:43 UTC
rendered paste body
<?php$doc = "<?xml version='1.0' encoding='utf-8'?><main>	<doc>Some value 1 2 3</doc></main>";$trans = '<?xml version="1.0" encoding="utf-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output encoding="utf-8" method="html" doctype-system="http://www.w3.org/TR/html4/strict.dtd" doctype-public="-//W3C//DTD HTML 4.01//EN"/><xsl:template match="/main">	<xsl:value-of select="doc" /></xsl:template></xsl:stylesheet>';$transformer = new DOMDocument();$transformer->loadXML($trans);$document = new DOMDocument();$document->loadXML($doc);$xsl = new XSLTProcessor();$xsl->importStylesheet($transformer);echo $xsl->transformToDoc($document)->saveHtml();