Itec102 - Midreviewer
Itec102 - Midreviewer
white-spaces
XML (eXtensible Markup Language) "WELL-FORMED" XML DOCUMENTS – documents that conform to the
– plays an important role in many different IT systems syntax rules
– often used for distributing data over the Internet
– software and hardware independent tool for storing and transporting XML ELEMENT – everything from the element's start tag to the
data element's end tag
IMPORTANT XML STANDARDS An element can contain:
• XML AJAX • XML XQuery – Text – Other elements
• XML DOM • XML DTD – Attributes – Mix of the above
• XML XPath • XML Schema
• XML XSLT • XML Services EMPTY XML ELEMENTS – Empty elements can have attributes
XML Does Not DO Anything – XML is just information wrapped in tags XML NAMING RULES
XML Does Not Use Predefined Tags • Element names are case-sensitive
– The XML language has no predefined tags • Element names must start with a letter or underscore
– The tags (like <to> and <from>) are not defined in any XML standard. • Element names cannot start with the letters xml
These tags are "invented" by the author of the XML document • Element names can contain letters, digits, hyphens, underscores, and
– HTML works with predefined tags like <p>, <h1>, <table>, etc. periods
XML Simplifies Things • Element names cannot contain spaces
• XML simplifies data sharing
• XML simplifies data transport BEST NAMING PRACTICES
• XML simplifies platform changes • Create descriptive names
• XML simplifies data availability • Create short and simple names
XML is Extensible – most XML applications will work as expected even • Avoid "-"
if new data is added (or removed) • Avoid "."
XML is a W3C Recommendation – early as in February 1998 • Avoid ":" Colons are reserved for namespaces
XML Separates Data from Presentation – XML does not carry any • Non-English letters like éòá are perfectly legal in XML
information about how to be displayed
XML is Often a Complement to HTML – XML is used to store or transport NAMING CONVERSIONS
data, while HTML is used to format and display the same data • LOWER CASE – all letters lower case
XML Separates Data from HTML – when displaying data in HTML, you • UPPER CASE – all letters upper case
should not have to edit the HTML file when the data changes • SNAKE CASE – underscore separates word
• PASCAL CASE – uppercase first letter each word (C Programmers)
TRANSACTION DATA – thousands of XML formats exist, in many • CAMEL CASE – uppercase first letter each word except the first
different industries, to describe day-to-day data transactions (JavaScript)
• Stocks and Shares • Scientific measurements
• Financial transactions • News information XML NAMESPACES – provide a method to avoid element name conflicts
• Medical data • Weather services RAW XML FILES – can be viewed in all major browsers.
• Mathematical data XMLHttpRequest – can be used to request data from a web server
– XMLHttpRequest object is a developers dream
XML TREE STRUCTURE – XML documents are as element trees XML PARSER – all major browsers have a built-in XML parser to access
• XML TREE – starts at a root element and branches from the root to and manipulate XML
child elements HTML DOM – defines a standard way for accessing and manipulating
– All elements can have sub elements (child elements) HTML documents
SELF DESCRIBING SYNTAX – prolong defines the XML version/character XML DOM – defines a standard way for accessing and manipulating
encoding XML documents
XML SYNTAX RULES – very simple and logical, easy to learn/use XPATH – a major element in the XSLT standard
– can be used to navigate through elements and attributes in an XML
XML DOCUMENTS – contain 1 root element that is the parent of all document
other elements XPATH KNOWLEDGE – you will be able to take great advantage of XSL
XML PROLOG – optional, must come first in the document, contain
international characters
UTF-8 – default encoding for HTML5, CSS, JavaScript, PHP, and SQL