Cheap Web Hosting for Developers

PHP, MySQL, Java, Unix Cheap Web Hosting

CHAPTER 6 DOCUMENT OBJECT MODEL (DOM) 211

Filed under: PHP and XML — webmaster @ 21:58

CHAPTER 6 DOCUMENT OBJECT MODEL (DOM) 211 Rob Richards 2005 Rob Richards The serialized tree looks almost exactly like the tree in Listing 6-1. This is good because that is the goal you are working toward. The only missing pieces are the prefaceand chapter subtrees. This will be left as an exercise for you to finish because I have already covered everything you need to complete the tree. Other Node Types The node types covered to this point are the most frequently used, which is why I have given them much greater emphasis. You can create and insert the remaining node types in the same manner as the previous nodes. Because the complete API is included in Appendix B, I will show how to create the remaining nodes through code: /* Create a DOMDocumentFragment */ $frag = $dom->createDocumentFragment(); $frag = new DOMDocumentFragment(); /* Create DOMComment */ $comment = $dom->createComment(”this is a comment”); $comment = new DOMComment(”this is a comment”); /* Results in */ /* Create DOMCDATASection */ $cdata = $dom->createCDATASection(”createProcessingInstruction(”php”, “echo ‘Hello World’;”); $pi = new DOMProcessingInstruction(”php”, “echo ‘Hello World’;”); /* Results in */

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP MySQL Web Hosting services

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by Cheap Web Hosting