XML Syntax

From Free Knowledge Base- The DUCK Project: information for everyone
Revision as of 20:29, 17 November 2010 by Atekysepiko (Talk | contribs)

Jump to: navigation, search

Extensible Markup Language (XML) A simple, very flexible text format derived from SGML (ISO 8879).

The XML Document Object Model (DOM) defines a standard set of commands that parsers should expose so you can access HTML and XML document content from your programs. A DOM for XML is an object model that exposes the contents of an XML document. The W3C's Document Object Model (DOM) Level 1 Specification currently defines what a DOM should expose as properties, methods, and events.

Rules:

  • In XML, it is illegal to omit the closing tag.
  • XML tags are case sensitive.
  • Elements must be properly nested.
  • One element per page must be the parent of all other elements, the "root" element.
  • Some characters have a special meaning in XML.
  • An XML element is everything from (including) the element's start tag to (including) the element's end tag.
  • An element can contain other elements, simple text or a mixture of both.
  • Elements can also have attributes.
  • XML Names can contain letters, numbers, and other characters
  • XML Names must not start with a number or punctuation character
  • XML Names must not start with the letters xml (or XML, or Xml, etc)
  • XML Names cannot contain spaces

 

>=== Sample XML from Sims 2 Storybook Viewer ===

 <nowiki><?xml version="1.0" encoding="UTF-8"?></nowiki>
 <nowiki><StoryCreator></nowiki>
 <nowiki>  <ClientEnvironment></nowiki>
 <nowiki>    <AppVersion>1.0.0.971</AppVersion></nowiki>
 <nowiki>    <LanguageCode>en-us</LanguageCode></nowiki>
 <nowiki>    <LanguageId>1</LanguageId></nowiki>
 <nowiki>    <SKU>14726</SKU></nowiki>
 <nowiki>    <GameVersion>2141707388.153.1</GameVersion></nowiki>
 <nowiki>  </ClientEnvironment></nowiki>
 <nowiki>  <ExchangeMetadata></nowiki>
 <nowiki>    <Album></nowiki>
 <nowiki>      <ID>0x00000001</ID></nowiki>
 <nowiki>      <FamilyName><![CDATA[]]></FamilyName></nowiki>
 <nowiki>      <FamilyId>0</FamilyId></nowiki>
 <nowiki>      <LinkName></LinkName></nowiki>
 <nowiki>      <NeighborhoodName><![CDATA[Pleasantview]]></NeighborhoodName></nowiki>
 <nowiki>      <LotID>0x00000000</LotID></nowiki>
 <nowiki>      <LotName><![CDATA[]]></LotName></nowiki>
 <nowiki>      <Title><![CDATA[]]></Title></nowiki>
 <nowiki>      <Style>Blog</Style></nowiki>
 <nowiki>      <Entry></nowiki>
 <nowiki>        <Title><![CDATA[]]></Title></nowiki>
 <nowiki>        <ThumbnailFilename>thumbnail_6ef1c7e8_af7830ec.jpg</ThumbnailFilename></nowiki>
 <nowiki>        <Snapshot>snapshot_6ef1c7e8_af7830ec.jpg</Snapshot></nowiki>
 <nowiki>        <Text><![CDATA[Little shrimp grows up.  Now will he be able to get Daisy Jane to take him seriously?]]></Text></nowiki>
 <nowiki>        <TextResourceId>0x00000001</TextResourceId></nowiki>
 <nowiki>        <TimeStamp>4/25/2005 19:37:34</TimeStamp></nowiki>
 <nowiki>      </Entry></nowiki>
 <nowiki>      <Entry></nowiki>
 <nowiki>        <Title><![CDATA[]]></Title></nowiki>
 <nowiki>        <ThumbnailFilename>thumbnail_af781efb_2f782402.jpg</ThumbnailFilename></nowiki>
 <nowiki>        <Snapshot>snapshot_af781efb_2f782402.jpg</Snapshot></nowiki>
 <nowiki>        <Text><![CDATA[The boys were equally upset about the loss of their father. ]]></Text></nowiki>
 <nowiki>        <TextResourceId>0x00000001</TextResourceId></nowiki>
 <nowiki>        <TimeStamp>4/25/2005 19:37:17</TimeStamp></nowiki>
 <nowiki>      </Entry></nowiki>
 <nowiki>      <KeywordList></nowiki>
 <nowiki>        <Keyword>Sims Life Stories</Keyword></nowiki>
 <nowiki>      </KeywordList></nowiki>
 <nowiki>      <UploadDescription><![CDATA[Pleasantview story Chapter I - not just another boring simtail.  Updated Feb 7, 2005.]]></UploadDescription></nowiki>
 <nowiki>    </Album></nowiki>
 <nowiki>  </ExchangeMetadata></nowiki>
 <nowiki></StoryCreator></nowiki>


&nbsp;

&nbsp;