使用DOM XML 创建 XML ,
怎样添加XML样式表。。XSL .

解决方案 »

  1.   

    用XSLTProcessor<?php # LOAD XML FILE 
    $XML = new DOMDocument(); 
    $XML->load( 'data.xml' ); # START XSLT 
    $xslt = new XSLTProcessor(); # IMPORT STYLESHEET 1 
    $XSL = new DOMDocument(); 
    $XSL->load( 'template1.xsl' ); 
    $xslt->importStylesheet( $XSL ); #IMPORT STYLESHEET 2 
    $XSL = new DOMDocument(); 
    $XSL->load( 'template2.xsl' ); 
    $xslt->importStylesheet( $XSL ); #PRINT 
    print $xslt->transformToXML( $XML ); 
    ?> 
      

  2.   

    PHP Fatal error: Class 'xsltprocessor' not found 这个又是怎么回事。
      

  3.   

    需要安装扩展
    ubuntu 的话 sudo apt-get install php5-xslextension=xsl.sowindows我就不知道了。是xsl.dll?