使用php+xslt在windows平台上
2006-10-09 00:00
447 查看
在windows平台上使用php+xslt
1。到http://www.php.net下载php 4.0.6
2。将php-4.0.6-Win32.zip解压到c:\php下
3。在web server上配置好php
3。拷贝dlls目录下的下列四个文件到windows\system(32)下
expat.dll
sablot.dll
xmlparser.dll
xmltok.dll
4。修改php.ini
修改extension_dir指向正确的extension目录
extension_dir = c:/php/extensions
然后找到下面这行
;extension=php_sablot.dll
修改为:
extension=php_sablot.dll
如果php配置的是cgi模式,则不需要重启web server,否则可能需要重启web server
5。我们用例子来测试一下
test.xml
============================
<?xml version="1.0"?>
<articles>
<article>
This is the first article.
</article>
</articles>
test.xsl
============================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:value-of select="articles/article"/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
test.php
===========================
<?php
$parser=xslt_create();
xslt_run($parser,'test.xsl','test.xml');
print xslt_fetch_result($parser);
xslt_free($parser);
?>
最后,该parser不支持GB2312。:(
1。到http://www.php.net下载php 4.0.6
2。将php-4.0.6-Win32.zip解压到c:\php下
3。在web server上配置好php
3。拷贝dlls目录下的下列四个文件到windows\system(32)下
expat.dll
sablot.dll
xmlparser.dll
xmltok.dll
4。修改php.ini
修改extension_dir指向正确的extension目录
extension_dir = c:/php/extensions
然后找到下面这行
;extension=php_sablot.dll
修改为:
extension=php_sablot.dll
如果php配置的是cgi模式,则不需要重启web server,否则可能需要重启web server
5。我们用例子来测试一下
test.xml
============================
<?xml version="1.0"?>
<articles>
<article>
This is the first article.
</article>
</articles>
test.xsl
============================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:value-of select="articles/article"/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
test.php
===========================
<?php
$parser=xslt_create();
xslt_run($parser,'test.xsl','test.xml');
print xslt_fetch_result($parser);
xslt_free($parser);
?>
最后,该parser不支持GB2312。:(
相关文章推荐
- 使用php+xslt在windows平台上
- 在Windows平台下使用php的mail函数发送邮件
- 使用Microsoft Web Platform Installer在windows平台搭建IIS+PHP+MySQL开发环境
- 在windows平台下php使用imagick库把pdf转换成(合并)图片
- 使用Gitblit在Windows平台上安装与配置Git Server
- Windows平台下用IIS搭建PHP+MYSQL环境之基本设置
- 使用be2012备份windows平台下的oracle数据库(视频)
- PHP Windows下使用Memcached扩展
- Windows平台下如何使用node.js显示系统盘符
- [转载]搭建Windows下PHP MySQL IIS安全平台 (5)
- Linux,Windows,Mac平台php环境配置
- 使用recvfrom()接收UDP包在Windows和Linux平台的不同表现
- Windows平台下如何使用Android NDK
- Windows平台下PHP开发环境的快速搭建
- Windows平台下使用pthreads开发多线程应用
- (转)Windows平台使用Gitblit搭建Git服务器图文教程
- PHP包管理工具Composer的安装与使用(Windows环境)
- Windows平台下如何使用Android NDK
- redis在windows下安装和PHP中使用
- Windows平台使用Gitblit搭建Git服务器图文教程