Using PHP+XSLT to _php the basics on the Windows platform

Source: Internet
Author: User
Tags xsl xslt
Using PHP+XSLT on the Windows platform

1. Download PHP 4.0.6 to Http://www.php.net

2. Unzip the Php-4.0.6-win32.zip to the c:\php

3. Configure PHP on the Web server

3. Copy the following four files under the DLLs directory to Windows\System (32)

Expat.dll
Sablot.dll
Xmlparser.dll
Xmltok.dll

4. Modify PHP.ini

Modify Extension_dir point to the correct extension directory

Extension_dir = C:/php/extensions

and find the following line.

; Extension=php_sablot.dll

Modified to:

Extension=php_sablot.dll

If PHP is configured with CGI mode, you do not need to restart the Web server, or you may need to restart the Web server

5. Let's use an example to test

Test.xml
============================
<?xml version= "1.0"?>

<articles>
<article>
This is the 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= "/" >
<body>
<xsl:value-of select= "Articles/article"/>
</body>
</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);
?>


Finally, the parser does not support GB2312. :(

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.