XML - Michigan State University

XML - Michigan State University

XML eXtensible Markup Language Extensible Markup Language XML is another format (similar to JSON) that is meant to convey semistructured data. HTML (used in webpages) is a subset of XML. Heavily used in web services and interdatabase communications. Often used for text document formatting Microsoft Office OpenOffice.org /

LibreOffice Apple's iWork Also often used in configuration files. XML Tags and Elements Tags come in 3 types: 1. start-tags (e.g.

) 2. end-tags (e.g.

) 3. empty-element tags (e.g.

) An element consist of a start-tag, optional content (which may be text or other elements), and a matching end-tag. Or, an element is just a empty-element tag.

Example elements: Hi

XML Attributes Attributes are name/value pairs within a start-tag or empty-element tag. There can be only one value in each pair, so multiple values are combined (often as a

space-delimited string). Example attributes: Well-Formed XML The document contains only properly encoded legal Unicode characters None of the special syntax characters such as < and & appear except when performing their markupdelineation roles The begin, end, and emptyelement tags that delimit the elements are correctly nested, with none missing and none

overlapping The element tags are casesensitive; the beginning and end tags must match exactly. Tag names cannot contain any of the characters !"#$ %&'()*+,/;<=>[email protected][\]^`{|}~, nor a space character, and cannot start with -,., or a numeric digit. A single "root" element contains all the other elements. XML Internal Representation What data structures would you use to represent an XML document: Graph Tree Hash table List DTD - Document Type Definition

A DTD defines what is "valid" XML data for a particular purpose. It defines what are allowable tags and the grammar for how they can be used. Details can be found here: http://www.w3schools.com/x ml/xml_dtd_intro.asp Special DTD components: (#PCDATA) - Parsed character data - Text content that has special characters(<&) escaped. CDATA - Unparsed character data

EMPTY - empty-element tag, no content allowed. Valid XML Josh's Store XML Josh's Guide To DTD's and XML Schemas Josh Document Type Definition

XML Schemas Schemas are a much more powerful way to describe an XML documents structure and limitations. They are written in XML and can even have DTDs and XML schemas of their own. They provide a basic set of types that are more descriptive than PCDATA / CDATA. Detail can be found here: http://www.w3schools.com/xml/xml_sc hema.asp Basic types (integer, byte, string, floating-point

number) can be combined into complex types that are used to define an element. Let's build an XML schema to match our previous bookstore example. Valid XML Josh's Store XML Josh's Guide To DTD's and XML Schemas Josh XML Schema

XML Schema for a Bookstore as an example. Valid XML Josh's Store XML Josh's Guide To DTD's and XML Schemas Josh

XML Schema ... Valid XML Josh's Store XML Josh's Guide To <!--page-separator--></p> <p>DTD's and XML Schemas Josh XML Schema ... ... Valid XML Josh's Store XML

Josh's Guide To DTD's and XML Schemas Josh XML Schema ... ... ...

Schema versus DTD When should you use an XML Schema instead of an XML DTD? Data Typing Validation Speed Occurrence Contraints Always

Recently Viewed Presentations

  • EXISTENTIALISM Because nothing says holiday spirt like questioning

    EXISTENTIALISM Because nothing says holiday spirt like questioning

    Acceptable: synonyms, rephrasing, direct re-use of words, denotative use. I went to the doctor five days ago; yes, last week I went to the hospital. ... Absurd Hero: "Sisyphus is the epitome of the absurd hero because he is able...
  • Overview of Pediatric trauma

    Overview of Pediatric trauma

    * Currey and Butler found immature bone to be weaker in bending strength but to absorb more energy before fracture PD-due to the complex nature of the molecular and histologic aspects of pediatric bone Pediatric cortical bone has lower mineral...
  • Learning &amp; Curriculum - Bradford

    Learning & Curriculum - Bradford

    Internal & external tutors including Karen Ardley, Carol Satterthwaite and Jason Bangbala. Highlight:- NQT conference 22 November Valley Parade. "Ofsted Reviewed" July course was fully booked, the November course is fully booked so we are repeating this again on 18...
  • Slides Supporting Implementation of the 2017 Frameworks

    Slides Supporting Implementation of the 2017 Frameworks

    Balance knowledge, understanding, application. Explain and argue coherently and convincingly. Analyze and evaluate claims and evidence. Notice patterns and underlying structures. Interpret qualitative and quantitative data. Define questions and structure inquiry.
  • Importance of Vocabulary Instruction

    Importance of Vocabulary Instruction

    (Carlo, et al., 2004) * Importance of Vocabulary Instruction - Conclusion To close the vocabulary gap, vocabulary acquisition must be accelerated through intentional instruction. Vocabulary instruction must be a focus in all classes in all grades.
  • Rotational state preparation of symmetric-top molecules: Rotational and

    Rotational state preparation of symmetric-top molecules: Rotational and

    Sisyphus cooling manipulates M-sublevels. Image: Rosa Glöckner, Alexander Prehn, Barbara G. U. Englert, Gerhard Rempe, and Martin Zeppenfeld, Phys. Rev. Lett. 115, 233001 The microwave frequency (used for addressing a pure rotational transition) is modulated by the frequency of the...
  • Tao Te Ching and The Analects

    Tao Te Ching and The Analects

    Tao Te Ching and The Analects By: Lao Tzu and Confucius Lao Tzu Chinese Author of Tao Te Ching Believed in "The Way" - force that controls the universe Tao - natural order with which people should not interfere Aphorism...
  • Interventions for Promoting Early Child Development for ...

    Interventions for Promoting Early Child Development for ...

    Reducing Health Inequality: ... Delivery Population CONTINUUM OF CARE Pregnancy 0-12 months 12-36 months 36-48+ months Highest risk of develop-mental and/or attachment disorder Medium risk Universal Children Enrichment of home environment e.g. [email protected] Nurturing of holistic child development ...