note 90510 modified in book.xsl by danbrown
| From: | danbrown@php.net | Date: | Sat, 25 Apr 2009 19:43:01 +0000 |
| Subject: | note 90510 modified in book.xsl by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-153768@lists.php.net to get a copy of this message | ||
Here is a simplest way to transform the xml from php
<?php
$sXml = "<xml>";
$sXml .= "<sudhir>hello sudhir</sudhir>";
$sXml .= "</xml>";
# LOAD XML FILE
$XML = new DOMDocument();
$XML->loadXML( $sXml );
# START XSLT
$xslt = new XSLTProcessor();
$XSL = new DOMDocument();
$XSL->load( 'xsl/index.xsl', LIBXML_NOCDATA);
$xslt->importStylesheet( $XSL );
#PRINT
print $xslt->transformToXML( $XML );
?>
--was--
Here is a simplest way to transform the xml from php
$sXml = "<xml>";
$sXml .= "<sudhir>hello sudhir</sudhir>";
$sXml .= "</xml>";
# LOAD XML FILE
$XML = new DOMDocument();
$XML->loadXML( $sXml );
# START XSLT
$xslt = new XSLTProcessor();
$XSL = new DOMDocument();
$XSL->load( 'xsl/index.xsl', LIBXML_NOCDATA);
$xslt->importStylesheet( $XSL );
#PRINT
print $xslt->transformToXML( $XML );
http://php.net/manual/en/book.xsl.php