PHP developers: enrich your xml toolbox

Source: Internet
Author: User
Tags php download php source code soap client xslt web database

Introduction: This is a PHP developer: enrich the detailed page of your xml toolkit. It introduces PHP, related knowledge, skills, experience, and some PHP source code.

Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 326932 'rolling = 'no'>

PHP's support for XML is increasing with the popularity of PHP. You can find nearly a dozen XML tools available by PHP developers from this article. Tool consultant Craig Knudsen also described a method for accessing more java tools from inside PHP.
PHP's support for XML started with version 3.06. At that time, James Clark's popular C-based expat syntax analyzer was first integrated into the PHP 3 module. Since then, many PHP modules and classes have been continuously developed for XML. For an overview of some of the tools I have found in my recent survey on current supply tools, see the table: PHP developer's XML tool.

Sax or DOM syntax analysis?
The default configuration of PHP 4 contains the expat XML syntax analyzer, which is a simple API of XML (Simple API for XML) syntax analyzer. The dom (Document Object Model, Document Object Model) API can be used in PHP 4 unless PHP 4ProgramYou can use the dom api (using the -- with-dom configuration option) or the binary release version of Windows to start the PHP 4 package. Otherwise, the PHP 4 package will not be built. To use the DOM module of PHP, install the gnome XML library and use PHP 4.0.4 or an updated version.

Dom and sax use different modes to perform syntax analysis on XML. When the sax syntax analyzer encounters a tag that you are interested in, it calls a specified callback. Dom loads the entire document into a tree that you can check and manipulate. Since version 4.0.4, PHP's Dom module also supports XPath.

Not everyone can control the server environment, so re-building PHP may not work. Fortunately, there is another way to use DOM in PHP. <Phpxml/> the project has developed a PHP class that supports Dom. Because it is all written in PHP, you do not need to make any modifications to the server.

Configure PHP for XML
Windows users will find it easy to download the PHP binary release. The benefit of a binary release is that someone has done some work for you; you do not have to download any otherCodeAnd it has built in many extensions (including Dom extensions ).

If you are not using Windows, you may needSource codeBuild PHP. The latest PHP release automatically includes XML support based on expat (SAX. To include Dom support in the program package, you must configure the PHP package to process the Dom. For more information about how to create PHP from source code, see references. In addition, remember to add -- With-dom as an option when running PHP's configure script.

Dom support in PHP is still in the experimental stage (since version 4.0.5), which means the API will be changed in future versions.

Use XSLT
PHP 4 also adds the XSLT function. (XSLT allows you to convert XML documents to other formats, such as PDF or HTML documents, and allows you to make more program changes .) The XSLT module in PHP 4 can use both expat and sabloton. Before building PHP, you must download and install sabloton (see references) and use the -- with-sablot option during PHP package configuration.

Web Services
If you are interested in developing web services using PHP, you can use soap or XML-RPC as needed. The soapx4 software package also provides clients and servers written in PHP. For XML-RPC, you can choose one from a variety of XML-RPC implementations, including a good one developed by useful information.

Both soap and XML-RPC implementations are all written in PHP. If your server enables XML support for PHP (by default), no modifications are required to the server.

Other options than PHP
If you have never been able to find the PHP interface for the tool you want to use, there is another option: Java. Although the XML tool list of PHP is constantly expanding, more available XML tools are available in Java. PHP 4 includes support for accessing Java objects, which allows PHP developers to use various Java XML tools.

Although PHP's Java support is not brand new, it still takes some time to find out how to install and use the instructions of the Java module. These instructions are not available in the PHP manual. However, you can view the "readme file" in the EXT/Java directory of the PHP release to learn about the installation and use documents. Remember that the installation process is slightly different for every Java implementation.

XML tools for PHP developers

Syntax analyzer:
Php xml is a sax-based syntax analyzer. It is built in PHP Based on Jim Clark's expat.
PHP Dom is supported by Dom built in PHP, which requires sabloton.
<Phpxml/> allow Dom to access XML documents using the PHP Dom module.
Phpdom provides a PhP4 class package for the PHP Dom module.
Prax is a PHP implementation of rax, which is an alternative to sax.
Protocol:
Soap client and server implementation developed by soapx4 Dietrich Ayala
Soap client and server implementation developed by Giga ideas for PHP client and server
XML-PRC client and server developed by useful information company of PHP
Ez xmlrpc client and server implementation of XML-RPC </TD>
Hail stone XML-RPC Server
XMLRPC-EPI is a simple and fast C-based PHP module that implements XML-RPC for clients and servers.

References

do you have any comments on the PHP tool? Click the discussion at the top or bottom of the Article to participate in the Forum related to this article.
you can download the PHP source code or the binary release version of Windows from the PHP download page.
the Document Object Model (DOM) provides a standard object set to represent HTML and XML documents, and provides a standard interface for accessing and manipulating these documents.
XML Path Language (XPath) is a language that can be used both in XSLT and xpointer to locate certain parts of XML documents.
simple xml api (SAX) is a standard interface for event-based XML syntax analysis.
XML record-oriented API (Rax) is an alternative to two mainstream APIs (Sax and DOM.
industrial strength or bubble? Soap, RPC, and RMI are analyzed.
the XML-RPC allows process calls on the entire Internet for software running in different operating systems and in different environments.
using the PHP script language to quickly compile a web database script contains step-by-step instructions for building PHP from the source code, and introduces the PHP application for building a database driver.
to enable Dom support when building PHP from source code, you must install the gnome xml c library.
to use the php xslt module, you must install sabloton before building PHP.
the PHP Manual contains documents on the use of XML functions, Dom XML functions, and XSLT functions based on expat.
PHP & Java in phpbuilder describes how to install and use the PHP Java module.
the PHP-XML message list is owned by the o'reilly network.
Find out how to compile and translate PHP into an Apache module that is dynamically loaded with DB2 support in Dan Scott's article in "DB2 developer's field.
you can take a closer look at the following online tutorials to learn the sample code for using PHP and XML.

Phpbuilder provides some excellent functions for XML syntax analysis, including using the expat function and Dom XML: expat substitution.
Phpwizard.net has a good article titled using PHP to analyze XML syntax.
PHP everywhere has a tutorial on using XML-RPC.
You can get a simple example of using a XML-RPC from linux.com.
The solutions 2001 developer conference will be held in San Francisco from October 13 to 14. Search for or view the description of more than 230 meetings in agendabuilder. More than two dozen meetings are concentrated on XML and related technologies, including:

Practice: integrate XML with DB2
Practice: Voice XML tool/build excellent applications
XSL example: XML Transformation Introduction
Use Java technology to perform syntax analysis and programming on XML documents.

Please participate in a survey containing 17 issues related to development habits to help IBM improve XML tools and services for developing software applications.

"Php developers: enrich your xml toolbox" for more articles

Love J2EE follow Java Michael Jackson video station JSON online tools

Http://biancheng.dnbcw.info/php/326932.html pageno: 13.

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.