网页功能: 加入收藏 设为首页 网站搜索  
使用php+xslt在windows平台上
发表日期:2004-07-23作者:[转贴] 出处:  

在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目录下的下列四个文件到windowssystem(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平台上
本类热点文章
  用PHP验证邮箱是否真实有效
  PHP5的变化与PHP6展望
  用户IP、浏览器、操作系统
  oracle资料库函式库
  oracle资料库函式库
  基于PHP的聊天室(二)
  基于PHP的聊天室(二)
  php调用mysql存储过程和函数的方法
  正则表达式在网络编程中的运用
  专家预言:PHP将比Java更受欢迎
  高效的中文字符串截取函数
  高效的中文字符串截取函数
最新分类信息我要发布 
最新招聘信息

关于我们 / 合作推广 / 给我留言 / 版权举报 / 意见建议 / 广告投放  
Copyright ©2003-2024 Lihuasoft.net webmaster(at)lihuasoft.net
网站编程QQ群   京ICP备05001064号 页面生成时间:0.01116