lecture8

lecture8 - PIC 40A Lecture 8: Document Type Definitions How...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
PIC 40A Lecture 8: Document Type Definitions
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
How do we define an XML application? Create either: 1. a Document Type Definition (DTD) 2. an XML Schema Definition (XSD)
Background image of page 2
Document Type Definition • Defines an XML application's vocabulary (element, attribute, and entity set) grammar (element content models , that is, rules for possible arrangements of elements in terms of order, frequency, and nesting) • Not all XML documents need one • Used to test an XML document's validity
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
DTD Syntax A DTD is a sequence of declarations There are 4 kinds of DTD declarations 1. <!ATTLIST … > 2. <!ELEMENT … > 3. <!ENTITY … > 4. <!NOTATION … >
Background image of page 4
DTD’s • DTD's can be either internal (inside the XML document) external (in a separate .dtd text file) XML documents that use a DTD need a SGML DOCTYPE declaration immediately after the XML declaration.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Internal DTD DOCTYPE Declaration <?xml version="1.0" encoding="us-ascii"?> <!DOCTYPE root_name [ <!-– The DTD declarations replace this comment --> ] > <!-– Rest of XML document -->
Background image of page 6
External DTD DOCTYPE Declaration <?xml version="1.0" encoding="us-ascii"?> <!DOCTYPE root_name SYSTEM "dtd_filename"> <!-– Rest of XML document -->
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/15/2010 for the course PIC 40A taught by Professor Ouellette during the Winter '10 term at UCLA.

Page1 / 19

lecture8 - PIC 40A Lecture 8: Document Type Definitions How...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online