TAILIEUCHUNG - XML Step by Step- P3
XML Step by Step- P3:Extensible Markup Language, or XML, is currently the most promising language for storing and exchanging information on the World Wide Web. Although Hypertext Markup Language (HTML) is presently the most common language used to create Web pages, HTML has a limited capacity for storing information. In contrast, because XML allows you to create your own elements, attributes, and document structure, you can use it to describe virtually any kind of information from a simple recipe to a complex database | CHAPTER 21 2 Creating and Displaying Your First XML Document In this chapter you ll gain an overview of the entire process of creating and displaying an XML document in a Web browser. First you ll create a simple XML document explore the document s structure and learn some of the fundamental rules for creating a well-formed XML document. Then you ll discover how to display that document in the Microsoft Internet Explorer Web browser by creating and attaching a simple style sheet that tells the browser how to format the elements in the document. This chapter provides a brief preview of the topics that I ll address in depth throughout the remainder of the book. Creating an XML Document Because an XML document is written in plain text you can create one using your favorite text editor. For example you can use the Notepad editor that comes with Microsoft Windows. Or better yet you can use a programming editor with features that make it easier to type in XML and related source files. Useful features include automatic tab insertion the next line is indented automatically when you press the Enter key and the ability to select and indent or decrease the indent of multiple lines of text. The Microsoft Visual Studio programming editor the text editor that comes with Microsoft Visual Studio or Visual Studio .NET is one example of an editor with these features. Your First XML Document Chapter 2 Creating and Displaying Your First XML Document 23 tip Notepad normally assigns the .txt extension to a file you save. To assign a different extension such as .xml for an XML document or .css for a cascading style sheet you might need to put quotation marks around the entire filename and extension. For example to save a file as you might need to type including the quotation marks in the File Name text box of Notepad s Save As dialog box. If you omit the quotation marks Notepad will save the file as if the .xml extension isn t registered on .
đang nạp các trang xem trước