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.
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.