Difference between revisions of "XML Syntax"
From Free Knowledge Base- The DUCK Project: information for everyone
(New page: <big>Extensible Markup Language (XML)</big> A simple, very flexible text format derived from SGML (ISO 8879). Rules: * In XML, it is illegal to omit the closing tag. * XML tags are case s...) |
|||
Line 7: | Line 7: | ||
* One element per page must be the parent of all other elements, the "root" element. | * One element per page must be the parent of all other elements, the "root" element. | ||
* Some characters have a special meaning in XML. | * 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> | ||
+ | |||
| |
Revision as of 17:02, 6 February 2008
Extensible Markup Language (XML) A simple, very flexible text format derived from SGML (ISO 8879).
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
<?xml version="1.0" encoding="UTF-8"?> <StoryCreator> <ClientEnvironment> <AppVersion>1.0.0.971</AppVersion> <LanguageCode>en-us</LanguageCode> <LanguageId>1</LanguageId> <SKU>14726</SKU> <GameVersion>2141707388.153.1</GameVersion> </ClientEnvironment> <ExchangeMetadata> <Album> <ID>0x00000001</ID> <FamilyName><![CDATA[]]></FamilyName> <FamilyId>0</FamilyId> <LinkName></LinkName> <NeighborhoodName><![CDATA[Pleasantview]]></NeighborhoodName> <LotID>0x00000000</LotID> <LotName><![CDATA[]]></LotName> <Title><![CDATA[]]></Title> <Style>Blog</Style> <Entry> <Title><![CDATA[]]></Title> <ThumbnailFilename>thumbnail_6ef1c7e8_af7830ec.jpg</ThumbnailFilename> <Snapshot>snapshot_6ef1c7e8_af7830ec.jpg</Snapshot> <Text><![CDATA[Little shrimp grows up. Now will he be able to get Daisy Jane to take him seriously?]]></Text> <TextResourceId>0x00000001</TextResourceId> <TimeStamp>4/25/2005 19:37:34</TimeStamp> </Entry> <Entry> <Title><![CDATA[]]></Title> <ThumbnailFilename>thumbnail_af781efb_2f782402.jpg</ThumbnailFilename> <Snapshot>snapshot_af781efb_2f782402.jpg</Snapshot> <Text><![CDATA[The boys were equally upset about the loss of their father. ]]></Text> <TextResourceId>0x00000001</TextResourceId> <TimeStamp>4/25/2005 19:37:17</TimeStamp> </Entry> <KeywordList> <Keyword>Sims Life Stories</Keyword> </KeywordList> <UploadDescription><![CDATA[Pleasantview story Chapter I - not just another boring simtail. Updated Feb 7, 2005.]]></UploadDescription> </Album> </ExchangeMetadata> </StoryCreator>