Saturday, May 5, 2012

codeWiz: How to create an XML Document

Ever wondering HTML pages are only simple, with the CSS, Javascript, PHP and etc., why don't you create an XML document, which offers flexibility not found within traditional HTML pages? Read this situation to find out.

Project- Statewide Realty Web Development

The Statewide Realty's apartment searches are been a great success. However, customers are asking how to search for apartments. You want to use Extensible Markup Language(XML).

How to create the data island

The World Wide Web Consortium(W3C), has made some facts for the XML. Here are some facts:

1. XML shall be straightforwardly usable over the Internet.
2. XML shall support a wide variety of applications.
3. XML shall be compatible with SGML.

There are more facts for XML, just check out www.w3.org. The correct syntax for XML documents are:

(XML tags are case-sensitive.)


<? xml version="1.0" encoding="utf-8"?>
<!-- File Name: file.xml -->
<!DOCTYPE ITEM
      [
<!ELEMENT ITEM (ITEMS,ITEMS,ITEMS)>
<!ELEMENT ITEM (#PCDATA)>
<!ELEMENT ITEM (#PCDATA)><!ELEMENT ITEM (#PCDATA)>
      ]
>
<ITEM>
<ITEM><ITEM>
</ITEM>
</ITEMS>


Just replace the word ITEMS for the prolog. Make sure you enter the code correctly and seriously, or else Internet Explorer cannot display the XML document, so be careful!

0 comments:

Post a Comment