Приглашаем посетить
Чернышевский (chernyshevskiy.lit-info.ru)

Summary

Table of Contents
Previous Next

Summary

In this chapter we looked at three different ways to read a fairly basic XML file and present it to the browser at an HTML table. We looked at using three different XML APIs to produce the same resulting HTML. We also looked at writing XML using DOM. We looked briefly at the three different APIs. The two main APIs SAX and DOM have more functionality than is shown in this chapter. The intent of this chapter is to provide a foundation for working with any of the XML APIs. Specifically, we looked at:

As you've seen from the examples in this chapter, using PHP to manipulate XML is not a difficult task. If you need to use the other API functions, you should be able incorporate them with relative ease.

Someone is always going to ask the hard question, "What is the best way of working with XML using PHP?". That is a difficult question to answer. After writing this chapter and putting together all the different code samples, I like the XSL and Sablotron approach the best. Of course you can't write XML using this. If you need to write XML, it's easiest with DOM, but not as reliable as writing (or getting from the Internet) a PHP class to do the writing. Keep an eye on DOM, it looks like it will be the best way of interacting with XML when all the bugs are worked out.


Table of Contents
Previous Next