Showing posts with label well-formed. Show all posts
Showing posts with label well-formed. Show all posts

Monday, October 23, 2006

XML declaration

One thing I forgot about a well-formed document, is that it should have an XML declaration.
  • An XML declaration is not mandatory
  • It have 3 attributes that have a specific order
    • version - Must always be included, currently the only possible value is "1.0"
    • encoding - Specifies the character set use in the document, defaults to "UTF-8"
    • standalone - Specifies if the document relys on extanal documents, such as a DTD or XML schema. Defaults to "no"
  • Must start at the first character of the XML document

Example of XML declaration
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>

Saturday, October 21, 2006

Valid

A XML document is valid when it
  • conforms to a DTD or a XML Schema
  • is well-formed

Friday, October 20, 2006

Well-formed

A well-formed document conforms to XML's syntax rules.
  • XML tags is case sensitive
  • All XML elements need a matching end tag
  • All XML elements need to be correctly nested
  • An XML document needs a root element
  • All attributes should be qouted

Wednesday, October 18, 2006

Well-formed and valid

A XML document should be well-formed and valid.
  • A well-formed document is syntactically correct
  • A valid document is well-formed
    and needs
    • a DTD (document type definition)
      or
    • a XML Schema