Presentation is loading. Please wait.

Presentation is loading. Please wait.

Kevin Murphy Basics of XML Masters Project CS 490.

Similar presentations


Presentation on theme: "Kevin Murphy Basics of XML Masters Project CS 490."— Presentation transcript:

1 Kevin Murphy Basics of XML Masters Project CS 490

2 Kevin Murphy What is XML eXtensible Markup Language n Describes the structure of a document n Based on SGML ( Standard Generalized Markup Language ) n XML is focused on Content description n Make your own elements n Each element has a name and is contained in a tag. n Portable, structured dynamic and descriptive

3 Kevin Murphy What XML Isn’t n Static n A set of pre defined tags n Purpose of XML is to describe the general structure relating to the content inside a document—NOT that content’s actual appearance on the page or on the screen.

4 Kevin Murphy Rules About Tags n Tags have a beginning and an ending tag, surrounding the text that they affect. n Closing tags have the tag name preceded by a slash (/). n All XML tags have a beginning and an end. n All XML tags are case insensitive. n Caution: If you forget to close a paired set of tags or you include a backslash or some other character rather than a forward slash, the tag won’t be closed, and the command will stay in effect.

5 Kevin Murphy Tag naming conventions n In XML, tags can be invented that best describe the contents. n using markup that is readable by both humans and machines. n XML tags look something like this: Chevy

6 Kevin Murphy The Tag n This tag indicates that the content of this file is in XML language. n All the text and other XML tags and commands should be placed within beginning and ending XML tags. n Example: n...Web page...

7 Kevin Murphy XML Formatting XML has to be well formed, This means the file must follow three basic rules: 1. The document starts with an XML declaration,. 2. There is a root element in which all others are contained. 3. All elements must be properly nested. No overlapping is permitted.

8 Kevin Murphy Step 1: Creating an XML Page n What is minimally needed: A. a basic text editor (to create your XML files) B.a browser to view them. IE 5 has an internal XML viewer and debugger. n File extension: Give the filename an extension of.xml n Example: file.xml n A good rule is to use lowercase names n Don’t use spaces or special characters—(Just letters and numbers are fine.)

9 Kevin Murphy Step 2: Viewing XML Source Pages n You see the tags in your browser; as part of the final result. n Most Web browsers will allow you to view the XML source code. n In IE, go to the view menu and choose source.

10 Kevin Murphy Step 3: View the Document n Start up your Web browser n From the menu bar, select File, Open Page (or a similar command depending on the browser).

11 Kevin Murphy Step 4: If your page didn’t work! n Check your code n Look for opening and closing tags n If the text repeated in the browser, make sure the file was saved with the.xml extension. n After making corrections, save the file, and try viewing it again.

12 Kevin Murphy Example Kevin Murphy kmurphy@neiu.edu 123321234 cs neiu

13 Kevin Murphy Future of XML n This is a new language which Microsoft is still expanding. It is dynamic so there are many directions it can go, as with web the future is open.


Download ppt "Kevin Murphy Basics of XML Masters Project CS 490."

Similar presentations


Ads by Google