|
Network Programming This website demonstrates using wikis as teaching and learning tool. The course instructor is happy to share the teaching materials here with those who find it readable. |
Lecture /
XML Basics and OverviewA Network Programming Lecture by Steven Choy Overview: What is XML? - Well-formed XML document - Valid XML document - XML DTD and XML Schema Extensible Markup Language
<?xml version="1.0" standalone="yes" ?> <customers> <customer> <customerno>1</customerno> <first>Peter</first> <last>Chan</last> <telephone>12345678</telephone> </customer> <customer> <customerno>2</customerno> <first>David</first> <last>Lau</last> <telephone>87654321</telephone> </customer> </customers> Well-formed XML document
Valid XML document
XML DTD and XML Schema
More XML Example
XML with internal DTD<?xml version="1.0" standalone="yes"?> <!DOCTYPE customer [ <!ELEMENT customer (first, last)> <!ELEMENT first (#PCDATA)> <!ELEMENT last (#PCDATA)> ]> <customer> <first>Peter</first> <last>Chan</last> </customer> XML with external DTD<?xml version="1.0" standalone="yes"?> <!DOCTYPE customer SYSTEM “customer_dtd2.dtd”> <customer> <first>Peter</first> <last>Chan</last> </customer> <!ELEMENT customer (first, last)> <!ELEMENT first (#PCDATA)> <!ELEMENT last (#PCDATA)> XML with XSD<?xml version="1.0"?> <customer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="customer_xsd1.xsd"> <first>Peter</first> <last>Chan</last> </customer>
<?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="customer"> <xs:complexType> <xs:sequence> <xs:element name="first" type="xs:string"/> <xs:element name="last" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> More about XSD
XML Scheme or DTD?
The Document Type Definition (DTD) defines the valid syntax of a class of XML documents. (The Document Type Definition (DTD) is the method used to define all markup languages. The purpose of DTD is to define the legal building blocks of an XML document.)
A schema is used to describe the possible data content of a document in a very rigorous and formal way. (XML Schema language (often called XSD) is used to describe both the structure and the content of an XML document.)
The limitations of a DTD: DTD does not have XML syntax and offers only limited support for types or namespaces. DTDs call for elements to consist of one of three things: (1) A text string; (2) A text string with other child elements mixed together; (3) A set of child elements.
How to validate a XML document
Do you really know what is XML?
W3Schools XML Quiz - 20 Quiz
Other similar names related to XML
Extra Materials for Probing FurtherLearn more about XML
XML Editorsa complete cross platform XML editor providing the tools for XML authoring, XML conversion, XML Schema, DTD, Relax NG and Schematron development, XPath, XSLT, XQuery debugging, SOAP and WSDL testing
allows to edit large, complex, modular, XML documents. It makes it easy mastering XML vocabularies such as DocBook or DITA.
The "visual" part comes from the fact that Vex hides the raw XML tags from the user, providing instead a wordprocessor-like interface. Because of this, Vex is best suited for "document-style" XML documents such as XHTML and DocBook rather than "data-style" XML documents.
XMLSpy - XML editor for modeling, editing, transforming, and debugging XML technologies
It is a free and Windows-based XML editor and development environment for XML, DTD, and XSLT documents
XML Copy Editor is a fast, free, validating XML editor. It has both Windows and Linux versions.
Thanks for ReadingIf you would rather like to have this lecture note in printed format, please click the print action link in the top right corner. If you find any problem in this lecture note, please feel free to tell Steven via steven@findaway.hk. |