Cs 311
Cs 311
All other elements must be nested within the root element. All elements can have sub
(children) elements.
Sub elements must be in pairs and correctly nested within their parent element
The XML declaration is case sensitive and must begin with "<?xml>" where "xml" is
written in lower-case.
The XML declaration strictly needs be the first statement in the XML document.
An HTTP protocol can override the value of encoding that you put in the XML
declaration
Attribute names in XML (unlike HTML) are case sensitive. That is, HREF and href are
considered two different XML attributes.
Same attribute cannot have two values in a syntax. The following example shows in
correct syntax because the attribute b is specified twice:
<a b="x" c="y" b="z">....</a>
Attribute names are defined without quotation marks, whereas attribute values must
always appear in quotation marks. Following example demonstrates incorrect xml syntax:
<a b=x>....</a>
To avoid character encoding problems, all XML files should be saved as Unicode UTF-8
or
UTF-16 files.
Whitespace characters like blanks, tabs and line-breaks between XML-elements and
between the XML-attributes will be ignored.
The purpose of a DTD (Document-Type-Information) is to define the legal building
blocks of an XML document.
DTD (Document-Type-Information) defines the document structure with a list of legal
elements.
A DTD can be declared inline in your XML document, or as an external reference.
!ELEMENT note (in line 2) defines the element "note" as having four elements:
"to,from,heading,body"
XML provides an application independent way of sharing data.
With a DTD, independent groups of people can agree to use a common DTD for
interchanging data. Your application can use a standard DTD to verify that data that you
receive from the outside world is valid. You can also use a DTD to verify your own data.
A lot of forums are emerging to define standard DTDs for almost everything in the areas
of data exchange.
XML Namespaces provide a method to avoid element name conflicts.
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.
conflict. Both contain a<table> element, but the elements have different content and
meaning.
Name conflicts in XML can easily be avoided using a name prefix
XML allows sets of documents which are all the same type to be created and handled
consistently and without structural errors
XML provides a common syntax for messaging systems for the exchange of information
between applications.
If everyone uses the same syntax it makes writing these systems much faster and more
reliable.
XML is free. It doesn't belong to anyone, so it can't be hijacked or pirated. And you don't
have to pay a fee to use it.
XML information can be manipulated programmatically so XML documents can be
pieced together from disparate sources, or taken apart and re-used in different ways. They
can be converted into any other format with no loss of information.
XML can also be used to store data in files or in databases. Applications can be written to
store and retrieve information from the store, and generic applications can be used to
display the data.
In many HTML applications, XML is used to store or transport data, while HTML is
used to format and display the same data.
When displaying data in HTML, you should not have to edit the HTML file when the
data changes.
With a few lines of JavaScript code, you can read an XML file and update the data
content of any HTML page.
XML documents are formed as element trees.
An XML tree starts at a root element and branches from the root to child elements.
All elements can have sub elements (child elements)
The terms parent, child, and sibling are used to describe the relationships between
elements.
Parent have children. Children have parents. Siblings are children on the same level
(brothers and sisters).
An XML element is everything from (including) the element's start tag to (including) the
element's end tag.
<title>, <author>, <year>, and <price> have text content because they contain text (like
29.99). <bookstore> and <book> have element contents, because they contain elements.
<book> has an attribute (category="children")
XML elements can be defined as building blocks of an XML. Elements can behave as
containers to hold text, elements, attributes, media objects or all of these.
Each XML document contains one or more elements, the scope of which are either
delimited by start and end tags, or for empty elements, by an empty-element tag.
An element with no content is said to be empty.
Browser Output:
Article - My Article
Authors:
- Mr. Foo
- Mr. Bar
XPath is used to navigate through elements and attributes in an XML document.
XPath is a syntax for defining parts of an XML document. It uses path expressions to
navigate in
XML documents.
XPath contains a library of standard functions.
XPath is a major element in XSLT.
XPath is a W3C recommendation
XPath uses path expressions to select nodes or node-sets in an XML document. These
path expressions look very much like the expressions you see when you work with a
traditional computer file system.
Without XPath knowledge you will not be able to create XSLT documents.
XPath is also used in XQuery, XPointer and XLink
Xml linking language, or xlink is an xml markup language and w3c specification that
provides methods for creating internal and external links within xml documents, and
associating metadata with those links.
xlink provides a framework for creating both basic unidirectional links and more
complex linking structures.
xlink is short for the xml linking language
xlink is a language for creating hyperlinks in xml documents
xlink is similar to html links - but it is a lot more powerful
xlink supports simple links(like html link system) and extended links (for linking
multiple"more then one" resources together)
with xlink, the links can be defined outside of the linked files
xlink is a 'w3c recommendation'
Use attributes only to provide information that is not relevant to the data
Entities are used to define shortcuts to special characters.
Entities can be declared internal or external
An entity has three parts: an ampersand (&), an entity name, and a semicolon (;).
An XML Schema describes the structure of an XML document.
The purpose of an XML Schema is to define the legal building blocks of an XML
document:
the elements and attributes that can appear in a document
the number of (and order of) child elements
data types for elements and attributes
default and fixed values for elements and attributes
The <schema> element is the root element of every XML Schema
The <schema> element may contain some attributes.
XML can easily be stored and generated by a standard web server.
XML files can be stored on an Internet server exactly the same way as HTML files
XML can be generated on a server without any installed XML software.
The content type of the response header must be set to "text/xml".
To generate an XML response from the server - simply write the following code and
save it as an ASP file on the web server
XML can be generated from a database without any installed XML software.
To generate an XML database response from the server, simply write the following
code and save it as an ASP file on the web server