Documente Academic
Documente Profesional
Documente Cultură
– XML is a markup language.
– XML stands for eXtensible Markup Language.
– The XML standard was created by W3C to provide an
easy to use and standardized way to store selfdescribing
data (selfdescribing data is data that describes both its
content and its structure).
●
Communication Between Application
XML is nothing by itself. XML is more of a "common ground"
standard. The main benefit of XML is that you can use it to take data
from a program like MSSQL (Microsoft SQL), convert it into XML,
then share that XML with a slough of other programs and platforms
Many individuals and corporations have put forth their hard work
to make XML interfaces for databases, programming, office
application, mobile phones and more.
Applications of XML
<class_list>
<student>
<name>Robert</name>
<grade>A+</grade>
</student>
<!--
<student>
<name>Lenard</name>
<grade>A-</grade>
</student>
-->
</class_list>
XML Prolog
The prolog is an optional component of the XML
document. If included, the prolog must be appear
before the root element. A prolog consists of two parts:
the XML declaration and the Document Type
Declaration (DTD). Depending on your needs, you can
choose to include both, either, or neither of these items
in your XML document.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
* !DOCTYPE - Tell the XML processor that this
piece of code defines the Document Type Definition
* html - Specifies the root element of the XML
document. Here our example is an HTML file, which has
<html> as the root element.
* PUBLIC - Specifies that this a publicly available
DTD.
* "-//W3C//D..." - The definition of the public
document. Describing this is beyond the scope of this
tutorial.
* "http://www.w3.org/..." - The physical location of
the DTD. Notice how this DTD resides on w3's servers.
XML Nesting
</phonebook>
All elements are closed in the order that they were
opened. Those elements which were opened first are
closed last.
Example B is what example A must look like to be a
well-formed XML document.
XML Namespaces
XML was designed to be a very robust markup language that could be used in many different
applications. However, with XML being able to communicate between so many different
<html>
<body>
</body>
<body>
<height>6ft</height>
<weight>155 lbs</weight>
</body>
Two very different elements that want to use the same name: body. The solution to this problem is
<root>
<child>
<subchild>.....</subchild>
</child>
</root>
Entity References
If you place a character like "<" inside an XML element,
it will generate an error because the parser interprets it as
the start of a new element.
<message>if salary < 1000 then</message>
<message>if salary < 1000 then</message>
SMIL documents look a lot like HTML. SMIL files need to be written according to
the following rules:
<body>
...
</body>
</smil>
Image to our presentation
<smil>
<head>
<layout>
<root-layout width="300" height="300"
background-color="white"/>
<region id="cows" top="0" left="0"
width="300" height="197"/>
</layout>
</head>
<body>
<img src="cows.jpg" region="cows"/>
</body>
</smil>
Copy and paste this URL,
"http://html.tucows.com/designer/basictut/example1.s
mil" into your SMIL parser, i.e., RealPlayer,
QuickTime, for an example of the SMIL presentation
created
Multiple Regions
We placed the new region, "text", 200 pixels from the top and 50 pixels from the left so that
it's centered in our presentation.
Below is a table with the possible values we can give to
the fit attribute.
We want to make the tucows.gif image fit perfectly
within the region, so we would add fit="fill" to the text
region. Below is an example.
Time Control
You can also control how long you want a certain piece of media to be display for by
using the "dur" attribute. This attribute takes a numerical value in seconds with the letter
"s" after the number. For example, lets say we want the cows to be displayed for 10
seconds and the rest of the images for only 5. We would add "dur="10s"" to the cow's img
tag and "dur="5s"" to the rest of the img tags. Below is what our code would look like.
This should display the TUCOWS text image, then the
HTML text image during a span of 10 seconds.
SMIL for phones
MMS uses SMIL to define the layout of multimedia
content.
SMIL was adopted because it was a well-defined,
standard language to describe the layout and timing of
the content inside MMS messages.