Alanname age 42age i am not too sure of the following

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 13 XML Elements CS480 Principles of Data Management Spring 2013 Mixing Elements and Text   A piece of text bounded by matching tags such as <person> and </person>   XML allows us to mix text data and subelements within an element   Inside an element, a document may have: –  “raw” text –  Another element –  Mixture of the two <Person> This is my best friend <Name> Alan</Name> <Age> 42</Age> I am not too sure of the following email <Email> adg@abc.com </Email> </Person> <person> <name> Alan </name> <age> 42 </age> <email> abc@abc.com </email> </person> CS480 Principles of Data Management Spring 2013 XML Attributes CS480 Principles of Data Management Spring 2013 Ambiguity in encoding data   Associated with elements   A given a�ribute may only occur once within a tag. –  Subelements with the same tag may be repeated <product> <name language=“French”>trompette six trous</name> <price currency=“Euro”> 420.12</price> </product>   In data exchange: –  A�ribute vs. element? <person> <name> Alan </name> <age> 42 </age> <email> abc@abc.com </email> </person> <person name=“Alan” age=“42” email=abc@abc.com/>   Type defini�on will be needed! CS480 Principles of Data Management Spring 2013 Character Data and Markup   Text consists of intermingled character data and markup –  Markup includes start-­‐tags, end-­‐tags, empty-­‐element tags, en�ty references, processing instruc�ons, XML declara�ons, comments, CDATA sec�ons, … –  All text that is not markup cons�tutes the Character data of the document   & and < MUST NOT appear in their literal form except in: CS480 Principles of Data Management Spring 2013 Comment   Comment may appear anywhere in a document outside markups   They are not part of the document’s character data   Double-­‐hyphens (“-­‐-­‐”) must not occur within the comments   Ending with “-­‐-­‐-­‐>” must not occur –  Comment, processing instruc�on, and CDATA sec�on...
View Full Document

This note was uploaded on 02/11/2014 for the course CS 480 taught by Professor Staff during the Spring '08 term at Colorado State.

Ask a homework question - tutors are online