XLM Flashcards
describe meta-markup languages
- A more flexible approach: Define your own tags!
- Makes machine-independent data (able to run on a variety of computers)
- Data can be used for different purposes
- Any set of tags is an “application”
- Descriptive markup — make meaning explicit
differences between XHTML and HTML5
XHTML
- superseded by HTML5
- Part of the family of XML markup languages
- compared to HTML, it is more rigid and strict, you cannot deviate from the syntax; this allows for well-structured, non-erroneous documents
- not easy to use for other purposes HTML5
- Able to define new elements (not tags)
- Still mostly intended for display of documents and objects on the Web
- Its descriptive properties are still rather limited
characteristics of XLM (Extensible Markup Language)
- XML files are plain text files just like HTML files
- Hence, can be easily, cheapily, and widely accessibly distributed eletronically
What is XML?
- XML stands for eXtensible Markup Language
- XML is a markup language much like HTML
- XML was designed to store and transport data
- XML was designed to be self-descriptive
- XML is a W3C Recommendation
- XML is both human-readable and machine-readable.
- XML keeps it in a structured format when sending because the elements in files are defined.
- separates style from content
- supporting validation
The Difference Between XML and HTML
XML and HTML were designed with different goals:
- XML was designed to carry data - with focus on what data is
- HTML was designed to display data - with focus on how data looks
- XML tags are not predefined like HTML tags are
how is XLM extensible?
Most XML applications will work as expected even if new data is added or removed.
is XLM seperate from presentation?
Yes, hence many different presentation styles can be applied using CSS
How is XLM related to HTML? When do they work together?
In many HTML applications, XML is used to store or transport data, while HTML is used to format and display the same data.
How can HTML data be edited through XLM?
XML Separates Data from HTML
When displaying data in HTML, data can be stored in separate XML files.
With a few lines of JavaScript code, you can read an XML file and update the data content of any HTML page.
How is XLM used in the industry?
Thousands of XML formats exists, in many different industries, to describe day-to-day data transactions:
- stocks and shares
- fianncial transactions
- scientific measurements
What makes XLM valid?
valid means
- well-formed (correct syntax)
- correct document structure (DTD)
What is the high-level structure of XLM?
tree structure
one root”
All elements can have sub elements (child elements):
root > child > sub-child

what is the prolog of an XLM document
` < ?xml version=”1.0” encoding=”UTF-8”? > `
XLM syntax rules
- a XML documents must have ONE root Element per document
- optional: the XLM prolog
- all XML elements must have a closing tag
- tags are case sensitive
- attribute values must be quoted < p id=”…
- Element names must start with a letter or underscore (except “xlm”)
- Element names can contain letters, digits, hyphens, underscores, and periods
- Element names cannot contain spaces
- proper nesting
- don’t use < and & inside elements, use < instead
What is an XML Element?
Everything from (including) the element’s start tag to (including) the element’s end tag.
may contain:
- text
- attributes
- other elements
- or a mix of the above
what is an empty XLM element?
what are the two ways to write one?
an element with no content
< element > < /element >
< element / >
use of XLM namespaces
XML Namespaces provide a method to avoid element name conflicts using prefix.
In XML, element names are defined by the developer. This often results in a conflict when trying to mix XML documents from different XML applications.

what is XSLT?
XSLT is a language that can be used to transform XML documents into other formats using using templates (e.g. XLM to HTML).
- Capable of using any text file as an input
- Display sub-sets of the elements
- The recommeded stylesheet language for XLM (far more sophistcated than CSS)
- Add text to the content of an element
- Analyse content and take action dependent on what is found
- Extensible Stylesheet Language Transformations
What is the recommeded way to format and style XLM?
How to link a CSS stylesheet to an XML document
Using JavaScript or XSLT (better than CSS)
< ?xml-stylesheet type=”text/css”href=”cd_catalog.css”? >
``
what is XMLHttpRequest and why is it useful
used to request data from a web server
useful because:
- Update a web page without reloading the page
- Request data from a server - after the page has loaded
- Receive data from a server - after the page has loaded
- Send data to a server - in the background
what is an XLM parser
- Before any work can be done with an XML document it needs to be parsed; that is, broken down into its constituent parts with some sort of internal model built up.
- The XML DOM (Document Object Model) defines the properties and methods for accessing and editing XML.
- However, before an XML document can be accessed, it must be loaded into an XML DOM object.
- All modern browsers have a built-in XML parser that can convert text into an XML DOM object.
What is the DOM?
The DOM defines a standard for accessing and manipulating documents:
- a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document via a tree-structure
- DOM created after XML parser finished
- DOM is widely supported, especially across browsers
- Alternatives to DOM have been developed because it tends to take up a lot of memory, an issue when dealing with large files
What is XPath
- a major element in the XSLT standard
- enables you to target specific elements and attributes in an XLM document
- works similar to how paths in a filesystem work (starting with the root…) – called path expressions
What is XQuery
(NOT NEEDED FOR EXAM)
XQuery finds and extracts elements and attributes from XML documents
- build on XPath expressions
XQuery can be used to:
- Extract information to use in a Web Service
- Generate summary reports
- Transform XML data to XHTML
- Search Web documents for relevant information

