Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 15 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
15
Dung lượng
434,26 KB
Nội dung
[...]... error page whether or not the XML document is linked to a style sheet note The XML parser is the part of the XML processor that scans the XML document, analyzes its structure, and detects any errors in syntax See the Note on page 26 for a definition of XML processor 32 XML Step by Step In the following exercise, you’ll investigate the Internet Explorer error-checking feature by purposely introducing an... you can quickly check whether an XML document is well-formed by simply opening it directly in Internet Explorer (If you display an XML document through an HTML page, as described in Part 3, an XML document with an error will fail to display, but you won’t see an error message unless you explicitly write script code to show one.) Your First XML Document When you open an XML document directly in Internet... Displaying Your First XML Document In Windows Explorer or in a folder window, double-click the Inventory01 .xml filename to open the document Your First XML Document Internet Explorer will open the Inventory01 .xml document and display it according to the rules in the linked Inventory01.css style sheet, as shown here: 2 6 37 7 To get a feel for how you can change the XML document’s appearance by modifying the...Chapter 2 Creating and Displaying Your First XML Document 31 Your First XML Document 2 the entire document element will be collapsed, as shown here: Catch XML Errors in Internet Explorer Before Internet Explorer displays your XML document, its XML parser component analyzes the document contents If the parser detects an error, Internet Explorer... and then displays a message if it finds an error It doesn’t check whether the document is valid 2 note 36 XML Step by Step The Marble Faun Nathaniel Hawthorne trade paperback 473 $10.95 Moby-Dick Herman Melville hardcover 724 $9.95... filename Inventory .xml Rather than displaying the XML document, Internet Explorer will now display the following error-message page: Chapter 2 Creating and Displaying Your First XML Document 33 4 Because you’ll work with Inventory .xml again in later chapters, you should now restore the end-tag in the first TITLE element to its original form () and then resave the document note If an XML document... it in Internet Explorer to check for additional errors (You can quickly reopen the document or page that’s currently displayed in Internet Explorer by clicking the Refresh toolbar button or by pressing F5.) Even though you didn’t link a style sheet to the XML document, Internet Explorer uses a default style sheet to display the document; hence the error page refers to “using XSL style sheet.” (XSL style... processor 32 XML Step by Step In the following exercise, you’ll investigate the Internet Explorer error-checking feature by purposely introducing an error into the Inventory .xml document 1 In your text editor, open the Inventory .xml document that you created in a previous exercise Change the first TITLE element from The Adventures of Huckleberry Finn to The Adventures of Huckleberry... (Note that the 12-point fontsize specification made for the TITLE element overrides the 10-point specification made for the element’s parent, BOOK.) I Indent the AUTHOR, BINDING, and PRICE elements each by 15 points (margin-left:15pt) . definition of XML processor. 32 XML Step by Step In the following exercise, you’ll investigate the Internet Explorer error-checking feature by purposely introducing an error into the Inventory .xml document. 1. characters. The XML processor ignores comment text, although it can pass the text on to the application. (As explained in Chapter 11, the Internet Explorer XML processor 26 XML Step by Step makes. elements. note The document element in an XML document is similar to the BODY element in an HTML page, except that you can assign it any legal name. 28 XML Step by Step Each BOOK element likewise contains