Web Resources

Answers to Self Review Exercises

Sections 19.119.6

19.1

a, b, d, f. [Choice c is incorrect because it contains a space. Choice e is incorrect because the first character is a number.]

19.2

a) True. b) False. In an XML document, markup text is delimited by tags enclosed in angle brackets (< and >) with a forward slash just after the < in the end tag. c) True. d) True. e) False. XML does support namespaces. f) False. When creating tags, document authors can use any valid name but should avoid ones that begin with the reserved word xml (also XML, Xml, etc.). g) False. XML reserved characters include the ampersand (&), the left-angle bracket (<) and the right-angle bracket (>), but not # and $.

19.3

a) Namespaces. b) Processing instructions. c) MSXML. d) xsl:output. e) schema. f) xsl:stylesheet. g) xsl:for-each.

19.4

a) False. XML is case sensitive. b) True. c) False. DTDs use EBNF grammar, which is not XML syntax. d) False. XPath is a technology for locating information in an XML document. XML Schema provides a means for type checking XML documents and verifying their validity.

 
19.5
 May
 5
 2005
.
 

Sections 19.719.10

19.6

"text/xsl" href = "wap.xsl"?>

19.7

a) parent. b) sibling. c)abstract.

19.8

/letter/contact.

19.9

Method Select receives as an argument either an XPathExpression or a string containing an XPathExpression, to select nodes referenced by the navigator.

Exercises

Sections 19.119.6

19.10

(Nutrition Information XML Document) Create an XML document that marks up the nutrition facts for a package of Grandma White's cookies. A package of cookies has a serving size of 1 package and the following nutritional value per serving: 260 calories, 100 fat calories, 11 grams of fat, 2 grams of saturated fat, 5 milligrams of cholesterol, 210 milligrams of sodium, 36 grams of total carbohydrates, 2 grams of fiber, 15 grams of sugars and 5 grams of protein. Name this document nutrition.xml. Load the XML document into Internet Explorer. [Hint: Your markup should contain elements describing the product name, serving size/amount, calories, sodium, cholesterol, proteins, etc. Mark up each nutrition fact/ingredient listed above.]

19.11

(Nutrition Information XML Schema) Write an XML Schema document (nuTRition.xsd) specifying the structure of the XML document created in Exercise 19.10.

Sections 19.719.10

19.12

(Nutrition Information XSL Style Sheet) Write an XSL style sheet for your solution to Exercise 19.10 that displays the nutritional facts in an XHTML table. Modify Fig. 19.30 (transformTest.cs) to output an XHTML file, nutrition.html. Render nutrition.html in a Web browser.

19.13

(Validation Against Multiple Schemas) Alter Fig. 19.28 (ValidationTest.cs) to validate a selected XML file against multiple schemasbook.xsd and nutrition.xsd (Exercise 19.11). Allow the user to select either book.xml, fail.xml or nuTRition.xml (Exercise 19.10). [Hint: You can add multiple schema documents to an XmlSchemaSet.]

19.14

(XmlReaderTest Modification) Modify XmlReaderTest (Fig. 19.22) to display article.xml (Fig. 19.2) in a TReeView instead of in a TextBox.

19.15

(Sorting XSLT Modification) Modify Fig. 19.19 (sorting.xsl) to sort by the number of pages rather than by chapter number. Save the modified document as sorting_byPage.xsl.

19.16

(transformTest Modification) Modify TRansformTest (Fig. 19.30) to use sorting.xml (Fig. 19.18), sorting.xsl (Fig. 19.19) and sorting_byPage.xsl (from Exercise 19.15). Display the result of transforming sorting.xml into two XHTML files, sorting_byChapter.html and sorting_byPage.html. [Hint: Remove the xml:stylesheet processing instruction from line 5 of sorting.xml before attempting to transform the file programmatically.]

Database, SQL and ADO NET

Preface

Index

    Introduction to Computers, the Internet and Visual C#

    Introduction to the Visual C# 2005 Express Edition IDE

    Introduction to C# Applications

    Introduction to Classes and Objects

    Control Statements: Part 1

    Control Statements: Part 2

    Methods: A Deeper Look

    Arrays

    Classes and Objects: A Deeper Look

    Object-Oriented Programming: Inheritance

    Polymorphism, Interfaces & Operator Overloading

    Exception Handling

    Graphical User Interface Concepts: Part 1

    Graphical User Interface Concepts: Part 2

    Multithreading

    Strings, Characters and Regular Expressions

    Graphics and Multimedia

    Files and Streams

    Extensible Markup Language (XML)

    Database, SQL and ADO.NET

    ASP.NET 2.0, Web Forms and Web Controls

    Web Services

    Networking: Streams-Based Sockets and Datagrams

    Searching and Sorting

    Data Structures

    Generics

    Collections

    Appendix A. Operator Precedence Chart

    Appendix B. Number Systems

    Appendix C. Using the Visual Studio 2005 Debugger

    Appendix D. ASCII Character Set

    Appendix E. Unicode®

    Appendix F. Introduction to XHTML: Part 1

    Appendix G. Introduction to XHTML: Part 2

    Appendix H. HTML/XHTML Special Characters

    Appendix I. HTML/XHTML Colors

    Appendix J. ATM Case Study Code

    Appendix K. UML 2: Additional Diagram Types

    Appendix L. Simple Types

    Index



    Visual C# How to Program
    Visual C# 2005 How to Program (2nd Edition)
    ISBN: 0131525239
    EAN: 2147483647
    Year: 2004
    Pages: 600

    Flylib.com © 2008-2020.
    If you may any questions please contact us: flylib@qtcs.net