Click here to load reader
Upload
-
View
433
Download
2
Embed Size (px)
Citation preview
X M L
University of BenghaziFaculty of Information Technology
Department of Graduate Studies
عبدالغني : يونس عبدالغني االسم
The research paper titled
XMLXTENSIBLE MARKUP LANGUAGE
1
X M L
Table of Content
1 -Introduction …………………………………………………….. 3
2-What is befor xml ………………………………………………3
3-What is xml ……………………………………………………..…4
4-How can xml be used………………………………………....5
5-Xml document…………………………………………………....6
6-Xml document from a tree structure……………….….7
7-Xml elements……………………………………………………..8
8-Xml attributes………………………………………………..…..9
9-Xml syntax rules……………………….………………..……….9
10-Xml elements vs attributes…….……………….……….10
11-Valid xml document…………………………………………11
12-The difference between xml and html……………..13
13-Xml is used to create new internet language……15
14-Summary…………………………………………….…………..16
15-REFERENCES…………………………………..……………….172
X M L
INTRODUCTION
WHAT IS BEFORE XML?
Binary files: A series of bits is identified by the application was
designed .We note that in the inability to read a file only by the application for which they have made, that feature binary files easily
understand binary codes by Computer.
Text files : Text files are also similar binary files series of bits, but
working together with a standard manner, the only bad This type of file is that we can not modify the text written the way we want.
There are files that combines extensive interoperability
Information provided by text files in addition to effective and powerful storage capabilities provided by binary files (SGML)
STANDARD GENERALIZED MARKUP LANGUAGE: A scripting language used to encode the data you need to a lot of considerations for large data coding and as a result has become a very
complicated language, but of the power comes complexity.
HTML (Hyper Text Markup Language) : This language used to create
web pages and is not a programming language concept and shape known in the other programming languages such as c language
3
X M L
What is XML?
stands for EXtensible Markup LanguageYou can fully control the formation XML document can form data the way we want
EX:
OR
was designed to carry data, not to display data: <note>
<to>Tove</to><from>Jani</from> small database
<heading>Reminder</heading><body>Don't forget me this weekend!</body>
/<note>
is designed to be self-descriptive
is a W3C Recommendatio , February 10, 1998:
XML became a W3C Recommendation on February 10, 1998
4
X M L
How Can XML be Used
XML Separates Data from HTML : If you need to display dynamic
data in your HTML document, it will take a lot of work to edit the HTML each time the data changes , With XML, data can be stored in separate
XML files .
XML Simplifies Data Sharing : In the real world, computer systems and databases contain data in incompatible formats,XML data is stored in plain text format. This provides a software- and hardware-independent way of storing data, This makes it much easier to create data that can be shared by different applications
XML Simplifies Data Transport: One of the most time-consuming
challenges for developers is to exchange data between incompatible systems over the Internet, Exchanging data as XML greatly reduces this complexity, since the data can be read by different incompatible applications
XML Simplifies Platform Changes : Upgrading to new systems (hardware or software platforms), is always time consuming. Large amounts of data must be converted and incompatible data is often lost.
XML data is stored in text format. This makes it easier to expand or upgrade to new operating systems, new applications, or new browsers, without losing data
XML Makes Your Data More Available : Different applications can access your data, not only in HTML pages, but also from XML data sources.
With XML, your data can be available to all kinds of "reading machines" (Handheld computers, voice machines, news feeds, etc),
XML Document5
X M L
?>xml version="1.0" encoding="ISO-8859-1<?">note<
> to>Tove</to< > from>Jani</from<
> heading>Reminder</heading< > body>Don't forget me this weekend! </body <
/>note<
The first line is the XML declaration. It defines the XML version (1.0) and the encoding used (ISO-8859-1 = Latin-1/West European character set).
The next line describes the root element of the document (like saying: "this document is a note")
The next 4 lines describe 4 child elements of the root (to, from, heading, and body)
XML Documents Form a Tree Structure6
X M L
XML documents must contain a root element. This element is "the parent" of all other elements.
The elements in an XML document form a document tree. The tree starts at the root and branches to the lowest level of the tree.
>doc<
>parent> computer <em> 4 </em> arab </parent
/>doc<
XML Elements
7
<doc>
<parent>
computer
<em>
text
arab
X M L
An XML document contains XML Elements.
An element can contain:
Other elements , Text , Attributes , Mix
EX:
>bookstore< > book category="CHILDREN<"
> title>Harry Potter</title< > author>J K. Rowling</author<
> year>2005</year< > price>29.99</price<
/> book< > book category="WEB<"
> title>Learning XML</title< > author>Erik T. Ray</author<
> year>2003</year< > price>39.95</price<
/> book</>bookstore<
In the example above, <bookstore> and <book> have element contents, because they contain other elements. <book> also has an attribute (category="CHILDREN"). <title>, <author>, <year>, and <price> have text content because they contain text
XML elements must follow these naming rules:
Names can contain letters, numbers, and other characters Names cannot start with a number or punctuation character Names cannot start with the letters xml (or XML, or Xml, etc) Names cannot contain spaces
XML Attributesattributes provide additional information about elements
8
X M L
> person gender="female<"
XML Syntax Rules
:All XML Elements Must Have a Closing Tag>p>this is paragraph ( illegal )
>p>this is paragraph</p> ( legal )
XML Tags are Case Sensitive.
>Message>This is incorrect</message> ( illegal )
>message>This is correct</message> ( legal )
XML Elements Must be Properly Nested.
>b><i>hello</b></i> (illegal)
>b><i>hello</i></b> ( legal )
Entity References :
Some characters have a special meaning in XML.
<<less than
>>greater than
&&ersand
''apostrophe
""quotation mark
With XML, the white-space in a document is not truncatedWith XML, the white-space in a document is not truncated
9
X M L
Comments in XML : <!-- This is a comment <--
XML Elements vs. Attributes>person gender="female <"
> firstname>Anna</firstname< > lastname>Smith</lastname<
/>person<
>person< > gender>female</gender < > firstname>Anna</firstname <
> lastname>Smith</lastname</>person<
IN THE FIRST EXAMPLE GENDER IS AN ATTRIBUTE
IN THE LAST GENDER IS AN ELEMENT
Valid XML Documents
10
X M L
XML DTD : The purpose of a DTD is to define what elements,
attributes and entities is legal in an XML document.
XML Schema : XML Schema is an XML based
alternative to DTD.
EX : <?xml version="1.0" encoding="ISO-8859-1<?"
> note<> to>Tove</to<
> from>Jani</from<> heading>Reminder</heading<
> body>Don't forget me this weekend!</body</> note<
DTD <!DOCTYPE note
[ !> ELEMENT note (to,from,heading,body)<
!> ELEMENT to (#PCDATA)<!> ELEMENT from (#PCDATA)<
!> ELEMENT heading (#PCDATA)<!> ELEMENT body (#PCDATA)<
<]
SCHEMA <xs:element name="note<"
> xs:complexType< > xs:sequence<
> xs:element name="to" type="xs:string</" > xs:element name="from" type="xs:string</"
11
X M L
> xs:element name="heading" type="xs:string</" > xs:element name="body" type="xs:string</"
/> xs:sequence</> xs:complexType<
/>xs:element<
CDATA:
XML files contain data for use within computing applications. When applications make use of XML data, they use XML parsing functions to traverse the contained tree structures, elements and attributes. XML parsers can encounter problems when a section of content within an XML file contains particular characters. To avoid these problems, developers can enclose certain parts of the content in an XML file within a CDATA (character data) section.
The Difference Between XML and HTML
XML is not a replacement for HTML.
XML and HTML were designed with different goals:XML was designed to transport and store data, with focus on what data is
12
X M L
HTML was designed to display data, with focus on how data looks
HTML is about displaying information, while XML is about carrying information
XPATH : (XML Path Language) is a query language for
selecting nodes from an XML document. In addition, XPath may be used to compute values (e.g., strings, numbers, or Boolean values) from the content of an XML document. XPath was defined by the World Wide Web Consortium (W3C)
Xpointer , Xlink : XLink defines a standard way of creating hyperlinks
in XML documents , .
13
X M L
XPointer allows the hyperlinks to point to more specific parts (fragments) in the XML document .
XSLT: (Extensible Stylesheet Language Transformations) is a
language for transforming XML documents into other XML documents,]1[ or other objects such as HTML for web pages, plain text or into XSL Formatting Objects which can then be converted to PDF, PostScript and PNG
DOM (DOCUMENT OBJECT MODEL): A DOM (Document Object
Model) defines a standard way for accessing and manipulating
documents.
XML is Used to Create New Internet Languages
XHTML :RELATION BETWEEN XML ANDHTML .
WSDL : for describing available web services.
WML : as markup languages for handheld devices.14
X M L
RSS : languages for news feeds.
SMIL : for describing multimedia for the web.
summary
XML XML can be used to exchange, share, and store data.
XML documents form a tree structure that starts at "the root" and branches to "the leaves".
XML has very simple syntax rules. XML with correct syntax is "Well Formed". Valid XML also validates against a DTD.
XSLT is used to transform XML into other formats like HTML.
15
X M L
All modern browsers have a built-in XML parser that can read and manipulate XML.
The DOM (Document Object Model) defines a standard way for accessing XML.
The XMLHttpRequest object provides a way to communicate with a server after a web page has loaded.
Text inside a CDATA section is ignored by the parser.
XML DOM (Document Object Model)The XML DOM defines a standard way for accessing and manipulating XML documents.
The XML DOM is platform and language independent and can be used by any programming language like Java, JavaScript, and VBScript.
XSLT (XML Stylesheet Language Transformations)XSLT is the style sheet language for XML files.
With XSLT you can transform XML documents into other formats, like XHTML.
XML DTD (Document Type Definition)The purpose of a DTD is to define what elements, attributes and entities is legal in an XML document.
With DTD, each of your XML files can carry a description of its own format with it.
DTD can be used to verify that the data you receive, and your own data, is valid.
XML Schema : XML Schema is an XML based alternative to DTD.
Unlike DTD, XML Schemas has support for datatypes, and XML Schema use XML Syntax.
16
X M L
REFERENCES
WEB SITES:
HTTP://WWW.BOOSLA.COM
HTTP://WWW.W3SCHOOLS.COM
HTTP://WWW.C4ARAB.COM 17
X M L
HTTP://KUTUB.INFO.COM
http://wiki.answers.com
الكتب:
المختصر في اكس ام ال لالستاذ طالب العامريمن العراق
الطريق الئ اكس ام ال لالستاذ عماد عدلي
18