如何用PHP把RDF内容插入Web站点之中(5)
时间:2007-02-17 来源:PHP爱好者
关键字 php xml rdf
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
出处 http://www.devshed.com/Server_Side/PHP/PHPRDF/page1.html
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
免费午餐(A Free Lunch)
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
上面我所写的那个类也是很基本的,是拿来说明问题的,或许也可以用于低访问量的站点。如果你想寻找一些更专业的东西,去网上吧,那里有许多的开放源码的RDF分析器,他们带有各种附加的功能(包括缓存)。 那么就让我们看一些如何运用这些分析器的例子吧。
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
第一个要讲的是由Stefan Saasen 为fase4网站开发的RDF分析器类,可以从http://www.fase4.com/rdf/上免费下载。这是一个功能非常齐全的RDF分析器,支持缓存和通过代理认证。下面是如何使用它的例子:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<html>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<head>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<style type="text/css">
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
body {font-family: Verdana; font-size: 11px;}
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
.fase4_rdf {font-size: 13px; font-family: Verdana} .fase4_rdf_title
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
{font-size: 13px; font-weight : bolder;}
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</style>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</head>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<body>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<?
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// include class
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
include("rdf.class.php");
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// instantiate object
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$rdf = new fase4_rdf;
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// set number of items to display
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$rdf->set_max_item(5);
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// set RDF engine options
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$rdf->use_dynamic_display(true);
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$rdf->set_Options( array("image"=>"hidden", "textinput"=>"hidden") );
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// parse and display data
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$rdf->parse_RDF("http://www.freshmeat.net/backend/fm-releases.rdf");
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$rdf->finish();
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
?>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</body>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</html>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
另一个要介绍的是由Jason Williams开发的PHP RDF分析器,可以在http://www.nerdzine.net/php_rdf/下载。这是一个未经任何任何渲染的PHP类,实现了一些基本的方法。但是它包含的大量的属性,可以让你用来安排经过处理的数据,直到你满意为止。
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
--------------------------------------------------------------------------------
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<html>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<head>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<basefont face="Verdana">
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</head>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<body link="Red" vlink="Red" alink="Red">
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<?
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
include("rdf_class.php");
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// this needs to be a local file
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$f = new rdfFile("./fm-releases.rdf");
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$f->parse(True);
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$f->ReturnTable(True, "black", "white", "100%");
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
?>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</body>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</html>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
关于这些类的文档在他们各自的网站上都有介绍。
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
增加一点样式(Adding A Little Style)
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
万一你讨厌遍历那些PHP数组并把他们用HTML标记出来的方式,那么你也可以选择通过使用XSLT样式单来格式化和显示这些数据。PHP4 .1可以通过新的XSLT API来支持Sablotron XSLT处理器,新的API可以用来合并一个XSLT样式单和一个XML文档(在这里,即RDF文件),从而非常容易的把XML标记转化为浏览器可读的HTML标记。
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
我不想在这上面讲的太细,你可以看一下PHP 手册,或者关注一下本文后面的链接以获得更加详细的信息。不过我还是会给出一个简单的例子来说明这个问题。首先,给出样式单文件:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<?xml version="1.0"?>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
xmlns:rss="http://purl.org/rss/1.0/"
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
xmlns:dc="http://purl.org/dc/elements/1.1/" version="1.0">
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<!-- main page -->
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:template match="/rdf:RDF">
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<html>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<head>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<basefont face="Arial" size="2"/>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</head>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<body>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:apply-templates select="rss:channel" />
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<ul>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:apply-templates select="rss:item" />
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</ul>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</body>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</html>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</xsl:template>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<!-- channel -->
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:template match="rss:channel">
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<b>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<a>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:attribute name="href"><xsl:value-of select="rss:link"
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
/></xsl:attribute>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:value-of select="rss:title" />
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</a>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</b>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</xsl:template>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<!-- item -->
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:template match="rss:item">
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<li />
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<a>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:attribute name="href"><xsl:value-of select="rss:link"
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
/></xsl:attribute>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:value-of select="rss:title" />
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</a>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<br />
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:value-of select="rss:description" />
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</xsl:template>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</xsl:stylesheet>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
下面是PHP脚本,用来把上面的样式单和讲的“鲜肉”RDF文档合并起来,生成一个HTML页面:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<?php
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// XML file
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// this needs to be a local file
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$xml = "fm-releases.rdf";
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// XSLT file
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$xslt = "fm.xsl";
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// create a new XSLT processor
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$xp = xslt_create();
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// transform the XML file as per the XSLT stylesheet
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// return the result to $result
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$result = xslt_process($xp, $xml, $xslt);
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
if ($result)
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
{
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// print it
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
echo $result;
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
}
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// clean up
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
xslt_free($xp);
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
?>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
我想这相当简单,无须再加说明。两个文档合并在一起,产生了下面的“合成物”:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
这是把RDF数据转换成浏览器可读的HTML的另一种方法,或许简单一些(尽管并不是最理想的)。不过要注意一点,你需要运行一个外部程序来定期更新你的RDF文件的本地副本,原因在于PHP XSLT处理器访问远端文件可能有困难。
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
家庭作业(Homework)
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
如果你有兴趣对这些文中谈到的和没谈到的技术了解的更多,你可以考虑访问下面的链接:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
RSS 1.0 规范:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
http://www.purl.org/rss/1.0/
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
RSS 发展史:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
http://backend.userland.com/stories/rss091
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
W3C 网站关于RDF的内容:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
http://www.w3.org/RDF/
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
PHP中关于SAX和DOM编程的讨论:http://www.devshed.com/Server_Side/XML/XMLwithPHP
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
用PHP实现XSLT转换的讨论:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
http://www.devshed.com/Server_Side/XML/XSLTrans
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
关于PHP类的讨论:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
http://www.devshed.com/Server_Side/PHP/BackToClass
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
XML基础的讨论:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
http://www.devshed.com/Server_Side/XML/XMLBasic
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
XSLT基础的讨论:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
http://www.devshed.com/Server_Side/XML/XSLBasics
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
PHP手册中关于SAX函数的内容:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
http://www.php.net/manual/en/ref.xml.php
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
PHP手册中关于XSLT函数的内容:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
http://www.php.net/manual/en/ref.xslt.php
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
下次再见了……保重身体呀!
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
注意:本文中的所有例子都在Linux/i386,Apache1.3.12,,PHP4.1.1环境下通过检验。
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
这些例子仅用于说明问题,不是为了某一个产品。Melonfire网站不对文中的源代码提供任何授权或支持。(本文版权为Melonfire网站所有, 原文出处:http://www.devshed.com/Server_Side/PHP/PHPRDF/page1.html)
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
php爱好者站 http://www.phpfans.net 文章|教程|下载|源码|论坛.
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
出处 http://www.devshed.com/Server_Side/PHP/PHPRDF/page1.html
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
免费午餐(A Free Lunch)
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
上面我所写的那个类也是很基本的,是拿来说明问题的,或许也可以用于低访问量的站点。如果你想寻找一些更专业的东西,去网上吧,那里有许多的开放源码的RDF分析器,他们带有各种附加的功能(包括缓存)。 那么就让我们看一些如何运用这些分析器的例子吧。
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
第一个要讲的是由Stefan Saasen 为fase4网站开发的RDF分析器类,可以从http://www.fase4.com/rdf/上免费下载。这是一个功能非常齐全的RDF分析器,支持缓存和通过代理认证。下面是如何使用它的例子:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<html>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<head>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<style type="text/css">
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
body {font-family: Verdana; font-size: 11px;}
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
.fase4_rdf {font-size: 13px; font-family: Verdana} .fase4_rdf_title
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
{font-size: 13px; font-weight : bolder;}
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</style>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</head>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<body>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<?
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// include class
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
include("rdf.class.php");
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// instantiate object
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$rdf = new fase4_rdf;
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// set number of items to display
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$rdf->set_max_item(5);
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// set RDF engine options
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$rdf->use_dynamic_display(true);
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$rdf->set_Options( array("image"=>"hidden", "textinput"=>"hidden") );
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// parse and display data
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$rdf->parse_RDF("http://www.freshmeat.net/backend/fm-releases.rdf");
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$rdf->finish();
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
?>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</body>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</html>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
另一个要介绍的是由Jason Williams开发的PHP RDF分析器,可以在http://www.nerdzine.net/php_rdf/下载。这是一个未经任何任何渲染的PHP类,实现了一些基本的方法。但是它包含的大量的属性,可以让你用来安排经过处理的数据,直到你满意为止。
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
--------------------------------------------------------------------------------
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<html>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<head>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<basefont face="Verdana">
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</head>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<body link="Red" vlink="Red" alink="Red">
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<?
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
include("rdf_class.php");
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// this needs to be a local file
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$f = new rdfFile("./fm-releases.rdf");
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$f->parse(True);
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$f->ReturnTable(True, "black", "white", "100%");
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
?>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</body>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</html>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
关于这些类的文档在他们各自的网站上都有介绍。
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
增加一点样式(Adding A Little Style)
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
万一你讨厌遍历那些PHP数组并把他们用HTML标记出来的方式,那么你也可以选择通过使用XSLT样式单来格式化和显示这些数据。PHP4 .1可以通过新的XSLT API来支持Sablotron XSLT处理器,新的API可以用来合并一个XSLT样式单和一个XML文档(在这里,即RDF文件),从而非常容易的把XML标记转化为浏览器可读的HTML标记。
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
我不想在这上面讲的太细,你可以看一下PHP 手册,或者关注一下本文后面的链接以获得更加详细的信息。不过我还是会给出一个简单的例子来说明这个问题。首先,给出样式单文件:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<?xml version="1.0"?>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
xmlns:rss="http://purl.org/rss/1.0/"
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
xmlns:dc="http://purl.org/dc/elements/1.1/" version="1.0">
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<!-- main page -->
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:template match="/rdf:RDF">
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<html>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<head>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<basefont face="Arial" size="2"/>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</head>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<body>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:apply-templates select="rss:channel" />
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<ul>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:apply-templates select="rss:item" />
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</ul>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</body>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</html>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</xsl:template>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<!-- channel -->
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:template match="rss:channel">
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<b>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<a>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:attribute name="href"><xsl:value-of select="rss:link"
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
/></xsl:attribute>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:value-of select="rss:title" />
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</a>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</b>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</xsl:template>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<!-- item -->
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:template match="rss:item">
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<li />
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<a>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:attribute name="href"><xsl:value-of select="rss:link"
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
/></xsl:attribute>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:value-of select="rss:title" />
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</a>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<br />
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<xsl:value-of select="rss:description" />
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</xsl:template>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
</xsl:stylesheet>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
下面是PHP脚本,用来把上面的样式单和讲的“鲜肉”RDF文档合并起来,生成一个HTML页面:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
<?php
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// XML file
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// this needs to be a local file
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$xml = "fm-releases.rdf";
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// XSLT file
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$xslt = "fm.xsl";
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// create a new XSLT processor
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$xp = xslt_create();
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// transform the XML file as per the XSLT stylesheet
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// return the result to $result
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
$result = xslt_process($xp, $xml, $xslt);
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
if ($result)
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
{
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// print it
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
echo $result;
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
}
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
// clean up
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
xslt_free($xp);
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
?>
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
我想这相当简单,无须再加说明。两个文档合并在一起,产生了下面的“合成物”:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
这是把RDF数据转换成浏览器可读的HTML的另一种方法,或许简单一些(尽管并不是最理想的)。不过要注意一点,你需要运行一个外部程序来定期更新你的RDF文件的本地副本,原因在于PHP XSLT处理器访问远端文件可能有困难。
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
家庭作业(Homework)
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
如果你有兴趣对这些文中谈到的和没谈到的技术了解的更多,你可以考虑访问下面的链接:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
RSS 1.0 规范:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
http://www.purl.org/rss/1.0/
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
RSS 发展史:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
http://backend.userland.com/stories/rss091
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
W3C 网站关于RDF的内容:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
http://www.w3.org/RDF/
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
PHP中关于SAX和DOM编程的讨论:http://www.devshed.com/Server_Side/XML/XMLwithPHP
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
用PHP实现XSLT转换的讨论:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
http://www.devshed.com/Server_Side/XML/XSLTrans
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
关于PHP类的讨论:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
http://www.devshed.com/Server_Side/PHP/BackToClass
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
XML基础的讨论:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
http://www.devshed.com/Server_Side/XML/XMLBasic
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
XSLT基础的讨论:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
http://www.devshed.com/Server_Side/XML/XSLBasics
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
PHP手册中关于SAX函数的内容:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
http://www.php.net/manual/en/ref.xml.php
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
PHP手册中关于XSLT函数的内容:
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
http://www.php.net/manual/en/ref.xslt.php
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
下次再见了……保重身体呀!
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
注意:本文中的所有例子都在Linux/i386,Apache1.3.12,,PHP4.1.1环境下通过检验。
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
这些例子仅用于说明问题,不是为了某一个产品。Melonfire网站不对文中的源代码提供任何授权或支持。(本文版权为Melonfire网站所有, 原文出处:http://www.devshed.com/Server_Side/PHP/PHPRDF/page1.html)
China It Power . ComizKVJ5WcA52mhq53rU0srVGXz
php爱好者站 http://www.phpfans.net 文章|教程|下载|源码|论坛.
相关阅读 更多 +