XML course notes
- XML course
- http://www.vtc.com/products/introtoxml.htm
- self describing markup language
- XSL - extensible stylesheet language
- XSLT
- translations
- query against original data
- XSL-FO
- formatting options
- will take over from css
- XPATH
- language on how to write the queries
- lets us parse through the documents
- XLINK
- link to a document
- link back to original doc
- link within current document
- XPOINTER
- link to a position in a file
- eg like a href # in html
- refer to www.w3.org to see specs on each of these + new developments
- XSLT
- XML basics
- <?xml version="1.0" ?>
- definition and spec version
- attributes such as:
- encoding="unicode"
- unicode is default if encoding character set is not specified
- standalone="no"
- means this doc cannot be viewed on it's own. a translation document is required also to interpret this doc
- standalone="yes"
- means the browser can display this document as is without requiring another document to translate it
- <? ?> is a processing statement, the application or browser will process this instruction
- definition and spec version
- <people>
- root element
- <husband>Mark</husband>
- </people>
- <?xml version="1.0" ?>
- xml editors
- notepad / text editor
- XML Spy
- www.altova.com
- XML Writer
- www.xmlwriter.com
- editiX
- www.editix.com
- morphon xml editor
- www.morphon.com
- emile (mac)
- www.in-progress.com/emile
- 5 basic rules to make a well formed document
- 1. tags are case sensitive
- 2. opening tags must have closing tags
- 3. tags must be properly nested
- 4. attribute values require quotes
- 5. root element required
- element
- an element is a complete description of a piece of data
- consists of the start tag, the data and the end tag
- empty element
- eg <br></br>
- or <br />
- attributes
- eg <husband employed="yes">
- could also represent this using elements rather than as an attribute:
<husband>
<name>Mark</name>
<age>45</age>
<employed>yes</employed>
</husband>
- values
- make each element represent one piece of data/value only
- special characters
- common symbols
- < <
- > >
- " "
- ' '
- & &
- use decimal values
- & = &
- CR, LF, TAB from version xml 1.0
- xml version 1.1 can use all the ascii codes except for NUL
- common symbols
- comments
- <!-- this is a comment -->
- comments may be displayed or dropped from the browser or application. this is correct as per the spec
- schema
- describes the structure of the document
- usually the schema is a separate document
- what data is allowed
- what data is required
- how data is organised
- checks the structure of the data not the actual value of the data
- DTD or XSD
- DTD - document type definition
- not XML based
- de facto standard
- defines the XML document structure
- defines what elements can/must appear
- defines what order the elements must be in
- information about the data the elements contain
- element attributes information / requirements
- DTD does not determine what the root element is
- DTD does not show the number of instances of elements
- DTD does not include the data types
- DTD does not include the symantic meaning of an element
- eg whether data is a name or a date
- can be defined inline or in a separate document (external)
- DTD elements
- elements are the allowed / required tags
- created with an element declaration
- <!ELEMENT ElementName Type>
- 4 types of elements
- empty tag - does not contain content
- element-only
- contains only child elements
- mixed
- combination of child elements and character data
- any
- any content allowed
- DTD element options
- * means can appear zero or more times
- + means one or more times
- ? means zero or one time
- | means or
- no symbol means the child element must appear only once
- XML Schema
- XSD - XML Schema Definition
- RELAX NG
- W3C XML Schema Language
- DTD - document type definition
Submitted by AliaK on Sat, 2006-11-25 02:47
- AliaK's blog
- Login or register to post comments
Printer-friendly version
Tags:





