cis562f10_note5_XMLBasics1

cis562f10_note5_XMLBasics1 - Chapter 3 XML Basics Reading...

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

View Full Document Right Arrow Icon
1 Chapter 3 XML Basics Reading: pp. 29 – 50 and pp. 3 – 28 in Coursepack; Section 2 in W3 XML Schema Primer ( http://www.w3.org/TR/xmlschema-0/ ); Lecture Notes. 1. Well-formed XML — XML is enabling the 2 nd generation of Web applications — XML is very useful for data integration (capable to incorporate diverse data types/structures) and data exchange (self- describing). • Limitations of HTML for data exchange * Fixed vocabulary (limited markup tags) * Mainly for rendering data rather than specifying data meaning * Mix data with rendition (partial separation can be achieved by using simple separate CSS (Cascading Style Sheet) style sheets) •XM L –e X tensible M arkup L anguage * For data representation rather than rendition For data representation rather than rendition * Extensible because you can make up own tags — some people call it as a meta- language/model to create your own markup language
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 * Feature a complete separation of content and style – no need to provide any style rules in the document, using complicated separate style sheets. * Example: attribute nested document element element
Background image of page 2
3 • Grammar rules * Rules for elements o start tags match end tags container element: <tag> content </tag> empty element: <tag … /> o no overlap among container elements. E.g., <tag1><tag2></tag1></tag2> is not allowed. o one root element (also called the document element) => an XML doc can be parsed into a tree according to the containment relationship among elements. o element names should be formed based on some rules, e.g., begin with a letter or ‘_’; case sensitive; no spaces between the tag characters and the element name; etc. * Rules for attributes o attributes must be in the start tag o one element cannot have two attributes with the same name o values must be enclosed within either values must be enclosed within either single or double quotes o names are formed based on the similar rules as above
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 * Rules for data o <, >, “, ‘ are reserved, and need to be represented by their character entity references: &lt;&gt ;&quot;&apos;, respectively o & itself can be represented as &amp; o nesting quotes in a value are fine. E.g., name=”Dr. O’Connor” => An XML document conforming to the above => An XML document conforming to the above rules is a well-formed XML Notes: Attributes vs elements: can be used at your discretion for describing data (using elements is more flexible for extending, but more verbose), but usually attributes are used for metadata.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/07/2011 for the course CIS 550 taught by Professor Yoon,d during the Spring '08 term at University of Michigan-Dearborn.

Page1 / 19

cis562f10_note5_XMLBasics1 - Chapter 3 XML Basics Reading...

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

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