Cheap Web Hosting for Developers

PHP, MySQL, Java, Unix Cheap Web Hosting

CHAPTER 2 XML STRUCTURE Listing 2-13. Invalid

Filed under: PHP and XML — webmaster @ 09:41

CHAPTER 2 XML STRUCTURE Listing 2-13. Invalid Comments within a document –> > Processing Instructions XML is purely concerned with document content. A PI allows application-specific instructions to be passed with the document to indicate to the application how it should be processed. The PI takes the form of , like so: The target indicates the application that the instruction targets. You might already be familiar with this syntax from PHP: This syntax is a PI. The PI target is php, and the instruction is echo “Hello World”;. If you were creating an XHTML document and embedding PHP code, this would constitute a well- formed XML document. Another case you may have already encountered is the association of style sheets with an XML document. Many XML editors will add the following PI so they can easily perform XSL transformations on the XML you may be editing: Entity References You have already encountered some of the built-in entity references (&, <, >, ', and ") throughout this chapter. Just as characters can be represented using numeric character references, entity references are used to reference strings, which are defined in the DTD. They take the form of &, which is followed by a legal name, and they terminate with a semicolon. You are probably familiar with the concept from HTML:

Copyright © 2002

The entity reference © is defined in the HTML DTD and represents the copyright symbol. Entity references cannot just be used blindly, however. The document must provide a meaning to an entity reference. For instance, if you were looking at a document that contained

&myref;

, the entity reference &myref; has absolutely no meaning to you or may mean something completely different to you than to me. You can use DTDs to define an entity reference. It is mandatory that any entity reference, other than those that are built in, must be defined. Looking at an HTML page, you may notice the DOCTYPE tag at the top of the page. The contents depend upon the type of HTML you are writing. For instance, -//W3C//DTD HTML 4.01 Transitional//EN refers to the DTD http://www.w3.org/TR/ html4/loose.dtd. This file contains a reference to http://www.w3.org/TR/html4/ HTMLlat1.ent. If you looked at the contents of this file, you will notice that the entity copy is defined as .

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