PHP Developer: Enrich your XML toolbox

xiaoxiao2021-03-06  99

PHP Developer: Enrich your XML toolbox

Author: Craig Knudsen Source: IBM China

PHP supports XML support With the popularity of PHP continues to enhance. You can find an XML tool available in the near PHP developer from this article. Tool advisor Craig Knudsen also describes a method of accessing more Java tools within PHP.

PHP's support for XML begins with version 3.06. At that time, the James CLARK popular C's EXPAT syntax analyzer was first integrated into the version of the PHP 3 module. Since then, many PHP modules and classes used for XML are constantly developed; for the summary of some tools found in the current supply tool survey, please refer to the table: XML tools for PHP developers. SAX or DOM syntax analysis? The default configuration of PHP 4 contains the Expat XML Syntax Analyzer, which is a SAX (XML simple API, Simple API for XML) Syntax Analyzer. In PHP 4, you can use the DOM (Document Object Model, Document Object Model), unless configured the PHP 4 package to be configured to use the DOM API (using -with-dom configuration option) or use Windows binary distribution to start PHP 4 The package, otherwise it will not be built. In order to use PHP's DOM module, you need to install the GNOME XML library and you need to use PHP 4.0.4 or update. DOM and SAX use different modes to grant the XML. When the SAX Syntax Analyzer encounters a tag you interested, it will call a specified callback. And DOM puts the entire document into a tree structure you can check and manipulate. From version 4.0.4, PHP's DOM module also supports XPath. Not everyone can control the server environment, so re-building PHP may not be feasible. Fortunately, there is another way to use the DOM in PHP. project has developed a PHP class that supports DOM. Since it is written in PHP, it is not necessary to make any modifications to the server. Configuring phpWindows users for XML will find the binary release of the downloading PHP is very easy. The advantage of the binary release is that someone has made some work for you; you don't have to download any code for compilation, and it has built a lot of extensions (including DOM extensions). If you are not using Windows, you may need to build a PHP from the source code. When default, PHP's latest release will automatically contain Expat (SAX)-based XML support. If you want to include DOM support in the package, you must configure the PHP package to process the DOM. For more information on how to build PHP from the source code, please check the reference. At the same time, please remember to add -with-dom as an option to the CONFIGURE script. DOM support in PHP is still in the experimental phase (from version 4.0.5), which means that the API will make changes in future versions. XSLT features also added using XSLTPHP 4. (XSLT allows you to transform XML documents into other formats, such as documents in PDF or HTML format, and also allow you to make changes on more programs.) The XSLT module in PHP 4 can use Expat and Sabloton at the same time. Before building PHP, you must download and install Sabloton (see Resources) and you must 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 according to your needs. The SOAPX4 package also provides clients and servers written in PHP.

For XML-RPC, you can select one from a variety of XML-RPC implementations, including a good one developed by USEful Information. All SOAP and XML-RPC implementations are written in PHP. If your server enables XML support (default) to PHP, you do not need to make any modifications to the server. Outside of PHP If you have never been able to find a PHP interface for the tool to be used, there is another option: Java. Although the PHP's XML tool list is constantly expanding, there is still more available XML tools in Java. PHP 4 contains support for accessing Java objects, which allows PHP developers to use a variety of Java XML tools. Although PHP's Java support is not brand new, it is necessary to find out how to install and use the Java module. There are no such indications in the PHP manual. However, you can view the "Readme File" under the PHP Release Ext / Java directory to learn about the documentation for installation and use. Remember that the installation process has a little difference in each Java implementation. PHP Developer's XML Tool Syntax Analyzer: PHP XML Based on SAX-based syntax analyzer, it is built within PHP according to JIM CLARK's EXPAT. PHP DOM builds DOM support in PHP, it requires sabloton. allows DOM to access the XML document using the PHP DOM module. PHPDomphPDom provides a PHP4 package for the PHP DOM module. PRAXPRAX is a PHP implementation of RAX, an alternative to SAX. Agreement: SOAPX4DIETRICH AYALA Developed SOAP clients and servers implement PHP SOAP clients and server Giga Ideas developed SOAP clients and servers implementing PHP XML-PRC client and server Useful Information Developed XML- RPC client and server implementation EZ XMLRPC XML-RPC client and server implementation HAIL STONEXML-RPC server XMLRPC-EPI This is a simple and fast-based PHP module that implements client and server. XML-RPC. Reference

转载请注明原文地址:https://www.9cbs.com/read-104903.html

New Post(0)