Module 1-XML 1 INTRODUCTION. Browser s/w (Mozilla, IE, Netscape, etc)

Size: px
Start display at page:

Download "Module 1-XML 1 INTRODUCTION. Browser s/w (Mozilla, IE, Netscape, etc)"

Transcription

1 Module 1-XML 1 INTRODUCTION [HTML files and XML files cannot do anything. If we have a HTML file say f1.html we need browser software like Internet Explorer, mozilla etc to display that file. So to display an HTML file we need another program. So without this second program we cant use HTML file. Also in XML we need second software.] HTML files Browser s/w (Mozilla, IE, Netscape, etc) Display HTML files is used by Browser s/w only XML file Program 1 Program 2 Program 3 Output 1 Output 2 Output 3 XML file may fed to more than one program and get different outputs Program1 Output Program2 XML file Transfer Output Program 3 XML file is used to transfer output of one program from machine to another program in another machine Html file1 <HTML> <BODY> <B> Introduction to XML</B> XML focusses on structure of the XML documents</body> </HTML> Html file2 <HTML><BODY><TABLE> <TR> <TD> Shilpa </TD><TD>21</TD></TR> <TR> <TD> Varun </TD><TD>22</TD></TR> </TABLE></BODY></HTML>

2 Module 1-XML 2 Xml file f3.xml <XML> <CLASS> </CLASS> </XML> <STUDENT> <NAME> Shilpa </NAME> <AGE>21</AGE> </STUDENT> <STUDENT> <NAME> Varun </NAME> <AGE>22</AGE> </STUDENT> The HTML file1 and file2 are displayed in only one format by browser software. Displaying of first file is Introduction to XML XML focusses on structure of the XML documents Displaying of second file is Shilpa 21 Varun 22 The Xml file f3.xml can be displyed in different format. By creating different programs for each kind of output. Let, we created three programs P1, p2, P3 and this three progrms take the input xml file f3.xml. We can write programs p1, p2 and p3 using any language like C, C++, JAVA etc. P1 may generate output like Shilpa 21 Varun 22 P2 may generate output like Shilpa age 21 Varun age 22 P3 may generate output like Name Age Shilpa 21 Varun 22 Markup Language HTML (Hyper Text Markup Language), SGML (Standard Generalized Markup Language) and XML (EXtensible Markup Language) are examples for markup languages. The word Markup refers to the sequence of characters or other symbols that you insert at certain places in a text. Markup indicates how the file should look when it is displayed. Markup may also used to describe the document's structure. Markup is a text that is added to the data of a document (file) in order to convey information about it. The markup indicators are often called "tags.

3 Module 1-XML 3 By markup language we mean a set of markup conventions used together for encoding texts. A markup language must specify what markup is allowed, what markup is required, how markup is to be distinguished from text, and what the markup means. A markup language is a mechanism to identify the document structures. If you are familiar with HTML, you have some concept of markup language. If you write a plain text file, it is composed of simple ASCII characters. When a program (like notepad) is used to display the file, all characters in the text file will be displayed using the same font size, type, and boldness. There are no special characteristics to present such type of file. Markup languages, like HTML or XML, allow special markup to be embedded with the text of a given file. Markups or tags in HTML files will enable the program that displays the file to determine how to show the text. In this way, special text like paragraph may be justify, have a larger and bolder font, or specific display colors may be set. Also additional elements may be added to the file such as numbered lists and tables. Generalizing from that sense, we define markup, or (synonymously) encoding, as any means of making explicit an interpretation of a text. At a banal level, all printed texts are encoded in this sense: punctuation marks, use of capitalization, disposition of letters around the page, even the spaces between words, might be regarded as a kind of markup, the function of which is to help the human reader determine where one word ends and another begins, or how to identify gross structural features such as headings or simple syntactic units such as dependent clauses or sentences. Encoding a text for computer processing is in principle, like transcribing a manuscript from scriptio continua, a process of making explicit what is conjectural or implicit, a process of directing the user as to how the content of the text should be interpreted. STRUCTURE OF XML DOCUMENT Example of XML document <?xml version="1.0" encoding="iso "?> <!DOCTYPE book SYSTEM "/services/dtds/book.dtd"> <book class="h.3.3"> <author>john Smith</author> <title>xml Retrieval</title> <chapter> <heading>introduction</heading> This text explains all about XML and IR. </chapter> <chapter> <heading> XML Query Language XQL </heading> <section> <heading>examples</heading> </section> <section> <heading>syntax</heading> Now we describe the XQL syntax. </section> </chapter> </book>

4 Module 1-XML 4 An Example XML Document

5 Module 1-XML 5 Structure of XML document Prologue o XML Declaration o DTD Declaration Root Element (Document) o Elements (Nested Elements) Element Attributes and Values Data The Prologue The prologue, equivalent to the header in HTML, may include the following: An XML declaration (optional) such as: <?xml version="1.0"?>. The XML declaration states which version of XML you are using. A DTD or reference to one (optional). An example reference to an external DTD file: <!DOCTYPE LANGLIST SYSTEM "langlist.dtd"> DTD describes the rules your XML document must follow. Processing instructions - An example processing instruction that causes style to be determined by a style sheet: <?xml-stylesheet type="text/css" href="xmlstyle.css"?> The XML prolog is an optional piece of information that must become before the root element when used. XML Process Instructions XML process instructions are normally included in the XML document prolog, commonly thought of as the header in HTML. Processing instructions may be placed anywhere in the document so long as they are outside the element tags. The rules for the names of process instructions are similar to the rules for element names, however in the case of process instructions there are some reserved xml process instructions such as "xml-stylesheet". The process instruction syntax: <? target instruction?> The target is the application name the instruction is meant for. It can be a reserved value such as "xmlstylesheet" or the name of an external application such as a script program name. The prolog looks something like this: <?xml version= 1.0 standalone= yes encoding= UTF-8?> It tells you that your document follows XML version 1.0, is stand-alone (that is, not accompanied by a document type definition, or DTD), and uses Unicode Transformation Format 8-bit (UTF-8) encoding. The XML declaration The first line of an XML document is the XML declaration. It's a special kind of tag:

6 Module 1-XML 6 <?xml version="1.0"?> The version 1.0 is the actual version of XML. The XML declaration makes clear that we're talking XML and also which version is used. The version identification will become important after new versions of XML are used. The root element All XML documents must have a root element. All other elements in the same document are children of this root element. The root element is the top level of the structure in an XML document. Structure of an XML page <?xml version="1.0"?> <root> <element> <sub-element> content </sub-element> <sub-element> content </sub-element> </element> </root> The root element, also referred to as the "document". The root element must be the first element in an XML document and there can only be one root element per file! <?xml version="1.0" encoding="iso "?> <note> <from>jani</from> <heading>reminder</heading> <body>don't forget me this weekend!</body> The first line in the document - the XML declaration - defines the XML version and the character encoding used in the document. In this case the document conforms to the 1.0 specification of XML and uses the ISO (Latin-1/West European) character set. The next line describes the root element of the document (like it was saying: "this document is a note"): <note> The next 4 lines describe 4 child elements of the root (to, from, heading, and body): <from>jani</from> <heading>reminder</heading> <body>don't forget me this weekend!</body> And finally the last line defines the end of the root element:

7 Module 1-XML 7 PRESENTING OR VIEWING XML DOCUMENTS Showing XML documents XML is about defining data. With XML you can define documents that are understood by computers. But to make these documents understandable to humans, you need to show them. CSS Cascading Style sheets (CSS offer possibilities to show XML. It works just like adding styles to HTML elements. XSL The preferred solution is using XSL (extensible Style sheet Language). XSL can convert XML documents into HTML. It can be used client side but the best solution is to use XSL server side. You can convert your XML documents to HTML, thus making them visible to any browser. Notepad You can view the content of the xml file using notepad. TWO TYPES OF XML DOCUMENTS Well Formed XML Documents Valid XML Documents Well Formed XML Documents A "Well Formed" XML document has correct XML syntax. A well-formed XML document one that conforms to the XML syntax starts with a prolog and contains exactly one element. A "Well Formed" XML document is a document that conforms to the XML syntax rules those are given below: XML documents must have a root element [a] All other elements are children of the root element All elements are correctly paired [b] XML elements must have a closing tag [c] XML tags are case sensitive [d] XML attribute values must always be quoted [e] Attribute names are used only once within the same element [f] Explanation of rule [a] Consider file f1.xml given below, <?xml version="1.0" encoding="iso "?> <note date= 12/11/2002 > <from>jani</from> This file is well formed according to XML rule [a]. Because there is one root element note. Consider a file f2.xml given below <?xml version="1.0" encoding="iso "?> <note date= 12/11/2002 >

8 Module 1-XML 8 <from>jani</from> <book> <title>introducton to XML</title> <para>xml is used to represent document</para> </book> This file is not well formed according to XML rule [a]. Because there is no root element in file f2.xml, Book element is not member of root element. Example for rule [b] <?xml version="1.0" encoding="iso "?> <a> <b> <c> </b> </c> </a> in this file element b is closed before closing element c. So this is not a well formed XML document. Example for rule [c] <?xml version="1.0" encoding="iso "?> <a> <b> <c> </b> </a> in this file element c is not closed using </c> tag. Every element in the XML document must have a starting and closing TAG. Example for rule [d] <?xml version="1.0" encoding="iso "?> <note> <from>jani</from> <heading>reminder</heading> <body>don't forget me this weekend!</body> This is not a well formed XML document. Because from element not closed because <from> and<from> are different. Example for rule [e] <?xml version="1.0" encoding="iso "?> <book ref = ISBN 12.1 > <title>introducton to XML</title> <para>xml is used to represent document</para>

9 Module 1-XML 9 </book> is a well formed xml document. Example for rule [f] <?xml version="1.0" encoding="iso "?> <book ref = ISBN 12.1 ref = 123 > <title>introduction to XML</title> <para>xml is used to represent document</para> </book> is not a well formed xml document. Attribute ref used twice in element book. Valid XML Documents Valid XML document contains a DTD. Valid XML document obeys the rules specified in the DTD. To be of practical use, an XML document needs to be valid. A "Valid" XML document also conforms to a DTD. [ we can specify set of rules in DTD, that rules must be obeyed by the XML document]. A "Valid" XML document is a "Well Formed" XML document, which also conforms to the rules of a Document Type Definition (DTD). <?xml version="1.0" encoding="iso "?> <!DOCTYPE note SYSTEM "InternalNote.dtd"> <note> <from>jani</from> <heading>reminder</heading> <body>don't forget me this weekend!</body> If a document is valid, it's clearly defined what the data in the document really means. There's no possibility to use a tag that's not defined in the DTD. Valid XML document is an XML document with elements and attributes conforming to a grammar. This grammar can be described with a DTD, an XML Schema, or some other mean. 1) explain different types of XML documents?(valid and well-formed) 2) Write the rules for using tags or elements in XML document 3) Define Markup language and markup 4) write a note on structure of an XML document 5) explain prologue instructions 6) What is meant by XML document

10 Module 1-XML 10 XML is a Extensible markup language for documents containing structured information. Structured information contains any type of content (words, pictures, etc.) and some indication of what role that content plays (for example, content in a section heading has a different significance from content in a footnote, which means something different than content in a figure caption or content in a database table, etc.). XML was developed so that richly structured documents could be used over the web. WHAT IS XML? XML stands for EXtensible Markup Language [1] XML is a markup language much like HTML [2] XML was designed to describe data [3] XML is a universal format for structured documents and data on the Web [4] XML tags are not predefined. You must define your own tags [6] XML tags/elements/attributes are not predefined [6] XML is a cross-platform, software and hardware independent tool for transmitting information. XML is a meta-language. A meta-language is a language that's used to define other languages. [7] XML simplifies business-to business transactions on the web. [8] XML is used for Exchange of data. [8] XML was not designed to do anything. (XML does not do anything) [9] XML is free and extensible [1] [2] Markup language HTML (Hyper Text Markup Language), SGML (Standard Generalized Markup Language) and XML (EXtensible Markup Language) are examples for markup languages. The word Markup refers to the sequence of characters or other symbols that you insert at certain places in a text. Markup indicates how the file should look when it is displayed. Markup may also used to describe the document's logical structure. Markup is added to the data of a document in order to convey information about it. By markup language we mean a set of markup conventions used together for encoding texts. A markup language must specify what markup is allowed, what markup is required, how markup is to be distinguished from text, and what the markup means. [3][4] XML is used to define the structure of the document. XML is used to store the document in electronic form. XML is system-independent methods of representing texts in electronic form. XML is used for defining descriptions of the structure and content of different types of electronic documents in many fields of human activity, from transcription of ancient Sumerian tablets to the technical documentation for stealbombers, and from patient's clinical records to musical notations. XML is a language that publishers, technical writers and library automation personnel have been using to create documents such as museum catalogs, technical publications and product catalogs from manufacturing specifications. XML may be used to describe chemical structures, or other scientific or artistic data that cannot be readily displayed using HTML.

11 Module 1-XML 11 [6] XML tags are not predefined. You must "invent" your own tags. The tags used to mark up HTML documents and the structure of HTML documents is predefined. The author of HTML documents can only use tags that are defined in the HTML standard (like <p>, <h1>, etc.). XML allows the author to define his own tags and his own document structure. The tags in the example above (like <to> and <from>) are not defined in any XML standard. These tags are "invented" by the author of the XML document. <vehicle color = "green" type = bus >volvo</vehicle> In this above statement, attributes color and type are defined by the author of the document. User or author of the document can add or create any attribute (eg. T1, a1, att1, etc) to tag vehicle. But in the HTML document attribute used in a given tag is predefined. Author of the HTML document cannot add attribute to tag other than list of attributes assigned for that tag. In html attributes predefined for tag <table> are align, valign, width, border, cellpadding, cellspacing, colspan and rowspan, so we cannot use attributes other than this. Attributes like t1, a1, att1 cannot use in tag <table> in html file. [7] XML is a meta-language XML is a meta-language. A meta-language is a language that's used to define other languages. You can use XML to define a language like WML. By utilizing their own DTD (Document Type Definition) there are many implementations of XML. Many have different purposes such as math formulas, writing technical documentation, sheet music, and so forth. The biggest drawback to these various implementations of XML is that in order to use it you will need to read the DTD or read documentation about the XML implementation. Therefore without having to learn each implementation there should be supporting programs that allow users to use XML implementations. XML is the mother of WML & WAP. [8] Data Interchange: XML is used to aid the exchange of data. It makes it possible to define data in a clear way. Both the sending and the receiving party will use XML to understand the kind of data that's been sent. By using XML everybody knows that the same interpretation of the data is used. EDI (Electronic Data Interchange) has been for several years the way to exchange data between businesses. EDI is expensive, it uses a dedicated communication infrastructure. And the definitions used are far from flexible. XML is a good replacement for EDI. It uses the Internet for the data exchange. And it's very flexible. XML's strongest point is its ability to do data interchange. Because different organizations (or even different parts of the same organization) rarely standardize on a single set of tools, it takes a significant amount of work for two groups to communicate. XML makes it easy to send structured data across the web so that nothing gets lost in translation. [9] XML Does not DO Anything XML was not designed to DO anything. Maybe it is a little hard to understand, but XML does not DO anything. XML was created to structure, store and to send information. The following example is a note to Tove from Jani, stored as XML: <note>

12 Module 1-XML 12 <from>jani</from> <heading>reminder</heading> <body>don't forget me this weekend!</body> The note has a header and a message body. It also has sender and receiver information. But still, this XML document does not DO anything. It is just pure information wrapped in XML tags. Someone must write a piece of software to send, receive or display it. There is nothing special about XML. It is just plain text with the addition of some XML tags enclosed in angle brackets. XML: What it can do With XML you can: Define data structures Make these structures platform independent Process XML defined data automatically Define your own tags With XML you cannot Define how your data is shown. To show data, you need other techniques. THE MAIN DIFFERENCE BETWEEN XML AND HTML XML was developed so that richly structured documents could be used over the web. The only alternatives like HTML and SGML are not practical for this purpose. XML is not a replacement for HTML. In future Web development it is most likely that XML will be used to describe the data, while HTML will be used to format and display the same data. XML and HTML were designed with different goals: XML was designed to describe data and to focus on what data is. HTML was designed to display data and to focus on how data looks. HTML is about displaying information. XML is fundamentally a language to manage resources, whether those resources are documents, data, graphics, programs or concepts. It has evolved out of the realization that we are becoming adrift in a sea of too much data and too little information. XML is used to aid the exchange of data. It makes it possible to define data in a clear way. Both the sending and the receiving party will use XML to understand the kind of data that's been sent. By using XML everybody knows that the same interpretation of the data is used. The tags used to mark up HTML documents and the structure of HTML documents is predefined. The author of HTML documents can only use tags that are defined in the HTML standard (like <p>, <h1>, etc.). XML tags are not predefined. You must define your own tags. With XML, White Space is Preserved With XML, the white space in your document is not truncated. This is unlike HTML. With HTML, a sentence like this: Hello my name is Tove, Will be displayed like this: Hello my name is Tove,

13 Module 1-XML 13 Because HTML reduces multiple, consecutive white space characters to a single white space. Explain the difference between HTML and XML What is meta language? XML is metalanguage. Why? XML does not do anything, justify this statement XML can be used for data exchange,why? Write an essay about XML XML Tags XML tags are created like HTML tags. There's a start tag and a closing tag. <TAG>content</TAG> The closing tag uses a slash after the opening bracket, just like in HTML. Syntax The following rules are used for using XML tags: Tags are c<travel> differs from the tags <Travel> and <travel>. (XML is case sensitive) <!-- Comments --> between th<amount>135</amount> is a valid tag for an element amount that has the content 135. Empty tags Besides a starting tag and a closing tag, you can use an empty tag. An empty tag does not have a content. The syntax differs from HTML: <TAG/> <tag></tag> is also an empty tag. Examples <car color = "green"></car> <car color = "green"/> XML elements must follow these naming rules:(naming rules for tags) Names can contain letters, numbers, and other characters Names must not start with a number or punctuation character Names must not start with the letters xml (or XML, or Xml, etc). Elements beginning with "XML" whether capitalized or not are reserved. Names cannot contain spaces Any name can be used, no words are reserved, but the idea is to make names descriptive. Names with an underscore separator are nice. Examples: <first_name>, <last_name>. Avoid "-" and "." in names. For example, if you name something "first-name," it could be a mess if your software tries to subtract name from first. Or if you name something "first.name," your software may think that "name" is a property of the object "first." Element names can be as long as you like, but don't exaggerate. Names should be short and simple, like this: <book_title> not like this: <the_title_of_the_book>. XML documents often have a corresponding database, in which fields exist corresponding to elements in the XML document. A good practice is to use the naming rules of your database for the elements in the XML documents.

14 Module 1-XML 14 The characters that are excluded from element names in XML are &, <, ", and >, which are used by XML to indicate markup. The ":" should not be used in element names because it is reserved to be used for something called namespaces. XML Attributes Elements in XML can use attributes. The syntax is: <element attribute-name = "attribute-value">...</element> The value of an attribute needs to be quoted, even if it contains only numbers. An example <car color = "green">volvo</car> The same information can also be defined without using attributes: <car> <brand>volvo</brand> <color>green</color> </car> Use of Elements vs. Attributes Data can be stored in child elements or in attributes. Take a look at these examples: <person sex="female"> <firstname>anna</firstname> <lastname>smith</lastname> </person> <person> <sex>female</sex> <firstname>anna</firstname> <lastname>smith</lastname> </person> In the first example sex is an attribute. In the last, sex is a child element. Both examples provide the same information. There are no rules about when to use attributes, and when to use child elements. Avoid attributes When possible try to avoid attributes. Data structures are more easy described in XML tags. Software that checks XML-documents can do a better job with tags than with attributes.processing value of attribute is more complex than processing value of elements. From HTML you will remember this: <IMG SRC="computer.gif">. The SRC attribute provides additional information about the IMG element. In HTML (and in XML) attributes provide additional information about elements: <img src="computer.gif"> <a href="demo.asp"> Attributes often provide information that is not a part of the data. In the example below, the file type is irrelevant to the data, but important to the software that wants to manipulate the element:

15 Module 1-XML 15 <file type="gif">computer.gif</file> Quote Styles, "female" or 'female'? Attribute values must always be enclosed in quotes, but either single or double quotes can be used. For a person's sex, the person tag can be written like this: <person sex="female"> or like this: <person sex='female'> Note: If the attribute value itself contains double quotes it is necessary to use single quotes, like in this example: <gangster name='george "Shotgun" Ziegler'> Note: If the attribute value itself contains single quotes it is necessary to use double quotes, like in this example: <gangster name="george 'Shotgun' Ziegler"> Try to store data in child elements. The following three XML documents contain exactly the same information: A date attribute is used in the first example: <note date="12/11/2002"> <from>jani</from> <heading>reminder</heading> <body>don't forget me this weekend!</body> A date element is used in the second example: <note> <date>12/11/2002</date> <from>jani</from> <heading>reminder</heading> <body>don't forget me this weekend!</body> An expanded date element is used in the third: <note> <date> <day>12</day> <month>11</month> <year>2002</year> </date> <from>jani</from> <heading>reminder</heading> <body>don't forget me this weekend!</body>

16 Module 1-XML 16 Avoid using attributes? Some of the problems with using attributes are: attributes cannot contain multiple values (child elements can) attributes are not easily expandable (for future changes) attributes cannot describe structures (child elements can) attributes are more difficult to manipulate by program code attribute values are not easy to test against a Document Type Definition (DTD) - which is used to define the legal elements of an XML document If you use attributes as containers for data, you end up with documents that are difficult to read and maintain. Try to use elements to describe data. Use attributes only to provide information that is not relevant to the data. Don't end up like this (this is not how XML should be used): <note day="12" month="11" year="2002" to="tove" from="jani" heading="reminder" body="don't forget me this weekend!"> We can assign ID references to elements. These ID references can be used to access XML elements in much the same way as the NAME or ID attributes in HTML. This example demonstrates this: <messages> <note id="p501"> <from>jani</from> <heading>reminder</heading> <body>don't forget me this weekend!</body> <note id="p502"> <to>jani</to> <from>tove</from> <heading>re: Reminder</heading> <body>i will not!</body> </messages> The ID in these examples is just a counter, or a unique identifier, to identify the different notes in the XML file, and not a part of the note data. What I am trying to say here is that metadata (data about data) should be stored as attributes, and that data itself should be stored as elements. 1) Write the naming rules for creating elements name or tags name.

17 Module 1-XML 17 2) Identify valid and invalid names from a given set of element's names 3) What is Tag? Write about starting tags and ending tags 4) What is attribute? Write the rules related to using attributes in an element 5) What is empty tag? Whether empty tag may have attributes XML Elements To create an XML document, it must contain elements. Lets assume that I want to create a document with the elements LAND, FOREST, TREE, MEADOW, GRASS. Here is how I would use these elements: <LAND> <FOREST> <TREE>Oak</TREE> <TREE>Pine</TREE> <TREE>Maple</TREE> </FOREST> <MEADOW> <GRASS>Bluegrass</GRASS> <GRASS>Fescue</GRASS> <GRASS>Rye</GRASS> </MEADOW> </LAND> Each element is enclosed in <> brackets. The ending element has the '/' character before its name. As you can see, there is one element that contains all others, <LAND>. XML requires one element that contains all others. This single element, which in this case is "LAND", is called the root element. The FOREST element contains several TREE elements, and the MEADOW likewise contains several elements of GRASS. Each element that is contained in another ends in that same element and therefore each element is properly nested. Elements that are included in another element are considered nested. The TREE elements in the above example are nested in the FOREST element. The FOREST element is the parent element to the TREE element and the TREE element is also called the sub-element to the FOREST element. These relationships hold true as you move up and down the element hierarchy. The FOREST and MEADOW elements are sub-elements to the LAND root element. To understand XML terminology, you have to know how relationships between XML elements are named, and how element content is described. Imagine that this is a description of a book: My First XML Introduction to XML What is HTML What is XML XML Syntax Elements must have a closing tag

18 Module 1-XML 18 Elements must be properly nested Imagine that this XML document describes the book: <book> <title>my First XML</title> <prod id="33-657" media="paper"></prod> <chapter>introduction to XML <para>what is HTML</para> <para>what is XML</para> </chapter> <chapter>xml Syntax <para>elements must have a closing tag</para> <para>elements must be properly nested</para> </chapter> </book> Book is the root element. Title, prod, and chapter are child elements of book. Book is the parent element of title, prod, and chapter. Title, prod, and chapter are siblings (or sister elements) because they have the same parent. Types of Elements Elements can have different content types. An XML element is everything from (including) the element's start tag to (including) the element's end tag. An element can have element content, mixed content, simple content, or empty content. An element can also have attributes. In the example above, book has element content, because it contains other elements. Chapter has mixed content because it contains both text and other elements. Para has simple content (or text content) because it contains only text. Prod has empty content, because it carries no information. In the example above only the prod element has attributes. The attribute named id has the value "33-657". The attribute named media has the value "paper". Classification of Elements based on its content Elements may contain: Nested elements Processing instructions CDATA sections - it consist special characters which is not displayed normally by the browser such as less than or greater than sign. These signs are used to enclose tags and are special characters. An example CDATA section <![CDATA[ The < and > characters are displayed normally here. ]]> (Details in later section) Normal text. Entity references - An entity reference is not allowed by a & sign. (Details in later section)

19 Module 1-XML 19 Character references - Character References are not displayed normally in XML such as the ( or * characters. These characters are represented as &#40 and &#42 respectively and will be presented on the browser as the less than or greater than character they represent. Comments - Comments are shown below and may be placed anywhere. (Details in later section). <!-- comment not display by browser --> [1] XML Elements are free and Extensible: XML tags are not predefined. You must "invent" your own tags. XML allows the author to define his own tags and his own document structure. The tags in the example (like <to> and <from>) are not defined in any XML standard. These tags are "invented" by the author of the XML document. XML documents can be extended to carry more information. Look at the following XML NOTE example: <note> <from>jani</from> <body>don't forget me this weekend!</body> Let's imagine that we created an application that extracted the <to>, <from>, and <body> elements from the XML document to produce this output: MESSAGE To: Tove From: Jani Don't forget me this weekend! Imagine that the author of the XML document added some extra information to it: <note> <date> </date> <from>jani</from> <heading>reminder</heading> <body>don't forget me this weekend!</body> Should the application break or crash? No. The application should still be able to find the <to>, <from>, and <body> elements in the XML document and produce the same output. XML documents are Extensible. Define XML element?

20 Module 1-XML 20 How XML elements are classified based on its content Justify the statement XML elements are free and extensible XML Entity [almost same as symbolic constants in C] An entity is a symbolic representation of information. With symbolic representation of information, a lot of text, such as, "Hello my name is Tizag.com and I am an artificial intelligence that teaches the general public how to program in web languages for free" can be represented by an entity symbol. Creating an XML Entity An entity must be created in the Document Type Definition (DTD). When you know where to place the entity, the rest is easy. Here is the syntax for creating your own XML entities. <!ENTITY entityname "The text you want to appear when the entity is used"> Below we have created an entity for the default introduction we want to include on all of our documents. <!ENTITY intro "Hello my name is Tizag.com and I am an artificial intelligence that teaches the general public how to program in web languages for free"> Using Your Entity After the entity has been created in the DTD it can then be referenced. An example XML document that uses such an entity would look like: <!ENTITY intro "Hello my name is Tizag.com and I am an artificial intelligence that teaches the general public how to program in web languages for free"> < > <to>a. Nony Mouse</to> <body>&intro;</body> </ > Entity Syntax You may have used entities in the HTML. The format of an entity in XML is an ampersand(&), followed by the name of the symbol, and concluded with a semicolon. Generic Entity - &name; Entities are divided into two group built in entity and user defined entity HTML is another markup language that supports entities. Below are some example entities for built in entities and the information they represent. < = < > = > & =& " =

21 Module 1-XML 21 Entities are great for many situations. Especially if you... use something a lot. If you have a default introduction, signature, or something else that is commonly used, you should use an entity. change something often. If you have a relatively static document that has one or two pieces of information, that are used throughout the document, that change frequently replace them with entities. You only need to change the value of the entity to change hundreds or maybe even thousands of references that are in your XML document. are using complex ascii characters that don't occur on your keyboard: and are easy when you use entities. Comments in XML A comment is used to leave a note or to temporarily edit out a portion of XML code. Although XML is a supposed to be self-describing data, you may still come across some instances where an XML comment might be necessary. For many different reasons, sometimes you might want to temporarily remove some XML code from your XML document. XML Comments let you do this easily, as this example below shows. XML Code: <?xml version="1.0" encoding="iso "?> <!-- Students grades are updated bi-monthly --> <class_list> <student> <name>robert</name> <grade>a+</grade> </student> <!-- <student> <name>lenard</name> <grade>a-</grade> </student> --> </class_list> In this xml file contains only one students details CDATA The parser will parse all text in an XML document. The parser will ignore only text inside a CDATA section. Parsed Data When an XML element is parsed, the text between the XML tags is also parsed: <message>this text is also parsed</message>

22 Module 1-XML 22 The parser does this because XML elements can contain other elements, as in this example, where the <name> element contains two other elements (first and last): <name><first>bill</first><last>gates</last></name> and the parser will break it up into sub-elements like this: <name> <first>bill</first> <last>gates</last> </name> Illegal XML characters have to be replaced by 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. You cannot write something like this: <message>if salary < 1000 then</message> To avoid this, you have to replace the "<" character with an entity reference, like this: <message>if salary < 1000 then</message> There are 5 predefined entity references in XML: < < less than > > greater than & & ampersand &apos; ' apostrophe " " quotation mark Note: Only the characters "<" and "&" are strictly illegal in XML. Apostrophes, quotation marks and greater than signs are legal, but it is a good habit to replace them. CDATA Everything inside a CDATA section is ignored by the parser. If your text contains a lot of "<" or "&" characters - as program code often does - the XML element can be defined as a CDATA section. The less than sign (<) would automatically interpreted as being the start of an XML tag. With the CDATA section in place, this won t happen. A CDATA section starts with "<![CDATA[" and ends with "]]>": <script> <![CDATA[ function matchwo(a,b) { if (a < b && a < 0) then { return 1 } else { return 0 } } ]]> </script> In the example above, everything inside the CDATA section is ignored by the parser.

23 Module 1-XML 23 There are no spaces or line breaks inside the "]]>" string. <div> <img src= visual basic.jpg > </div> If you wanted to save the above HTML code within an XML block, you would find tat parser complains that the img tag is not closed. <skill> <name> visual basis</name> <htmltext> <div> <img src= visual basic.jpg > </div> </htmltext> </skill> The HTML could be safely protected in the preceding sample by enclosing in a CDATA section, as the following example demonstrates: <skill> <name> visual basis</name> <htmltext><![cdata[ <div> <img src= visual basic.jpg > </div>]]> </htmltext> </skill> CDATA sections preserve white space as well as XML special characters, so using CDATA makes sense when you want to be able to save script text and HTML text within an XML document, as in the above example. Because contain large number of symbols like <, > and. ***Comments is just like removing part of file from the XML document. Portion inside the CDATA section in the XML document is part of the document****

24 Module 1-XML 24 B.Tech degree examination November 2005 WEB TECHNOLOGIES (RT) F3822 PART A (10 X 4=40 Marks) 7) Write the features of SGML? 8) What is an HTML? 9) Write the attribute types? 10) Mention few applications of XML? 11) Enumerate the features of javabeans? 12) State the advantages of GUI? 13) List the properties of java beans 14) What is a scriptlets? Explain 15) What is an entity bean? Explain 16) List the step for developing entity beans PART B (5X12=60 Mark) 17) (a) (i) Compare XML with HTML (ii) Explain the views of an XML document. OR (b) (i) Explain in detail about starting and ending of tags (ii) Give an account on CDATA section 18) (a) Describe in detail the principles of displaying XML Data in HTML browser as HTML tables. OR (b) Explain the process of converting XML to HTML with XSL minimalist 19) (a) Explain in detail about bound and constrained properties of java beans OR (b) Give a detailed account on GUI interfaces 20) (a) Explain in detail the creation of simple JSP pages with examples OR (b) Explain in detail the properties of java beans 21) (a) Explain in detail the detail the development of session beans OR (b) Write technical notes on: 1. Development of stateful session beam 2. Basic features of Entity Beans

25 Module 1-XML 25 B.Tech degree examination January 2007 WEB TECHNOLOGIES (RT) F3822 PART A (10 X 4=40 Marks) 1. Compare XML with HTML. 2. Explain XML parser. Explain how XML documents are parsed and send to an application. 3. Briefly explain XSL style sheets. 4. Explain how XML documents can be embedded into HTML document. 5. Briefly explain advantages of javabeans? 6. Explain different methods defined by BeanInfo interface. 7. Briefly explain how to create simple JSP pages. 8. What do you mean by scriptlets? How to access Beans via Scriptlets? 9. With a neat schematic, explain the interaction of different parties in EJB. 10. Distinguish between Session beans and entity beans. PART B (5X12=60 Mark) 11. (a) (i) Explain the views of an XML document a. (ii). What are the uses tags in XML? Explain starting and ending tags OR 12. (b) (i) Explain the use of tag CDATA. a. What are the common programming errors while using XML? 13. (a) Explain Document Type Definitions (DTD). Explain DTD help to type check XML documents? OR 14. (b) (i) Write an XML document that stores some tabular data. a. (ii) Write on HTML page that displays the above XML data 15. (a) With a suitable example, illustrate various aspect of Bean programming including introspection and usage of bean class OR 16. (b) Explain how java beans functionality is provided by jaba.beans package. Briefly explain classes and interfaces in that package. 17. (a) Explain with suitable example the advantages of JSP over CGI programs OR 18. (b) Explain in detail the use of java beans in JSPs 19. (a) With a neat schematic, explain how clients are interfaced with EJB component system OR 20. (b) Briefly explain the steps involved in developing an EJB component

EXtensible Markup Language XML

EXtensible Markup Language XML EXtensible Markup Language XML 1 What is XML? XML stands for EXtensible Markup Language XML is a markup language much like HTML XML was designed to carry data, not to display data XML tags are not predefined.

More information

markup language carry data define your own tags self-descriptive W3C Recommendation

markup language carry data define your own tags self-descriptive W3C Recommendation XML intro What is XML? XML stands for EXtensible Markup Language XML is a markup language much like HTML XML was designed to carry data, not to display data XML tags are not predefined. You must define

More information

INTERNET PROGRAMMING XML

INTERNET PROGRAMMING XML INTERNET PROGRAMMING XML Software Engineering Branch / 4 th Class Computer Engineering Department University of Technology OUTLINES XML Basic XML Advanced 2 HTML & CSS & JAVASCRIPT & XML DOCUMENTS HTML

More information

Web Services Part I. XML Web Services. Instructor: Dr. Wei Ding Fall 2009

Web Services Part I. XML Web Services. Instructor: Dr. Wei Ding Fall 2009 Web Services Part I Instructor: Dr. Wei Ding Fall 2009 CS 437/637 Database-Backed Web Sites and Web Services 1 XML Web Services XML Web Services = Web Services A Web service is a different kind of Web

More information

XML (Extensible Markup Language)

XML (Extensible Markup Language) Basics of XML: What is XML? XML (Extensible Markup Language) XML stands for Extensible Markup Language XML was designed to carry data, not to display data XML tags are not predefined. You must define your

More information

EXtensible Markup Language XML

EXtensible Markup Language XML EXtensible Markup Language XML Main source: W3C School tutorials 1 Mark-up Languages A way of describing information in a document. Standard Generalized Mark-Up Language (SGML) - a specification for a

More information

XML: Introduction. !important Declaration... 9:11 #FIXED... 7:5 #IMPLIED... 7:5 #REQUIRED... Directive... 9:11

XML: Introduction. !important Declaration... 9:11 #FIXED... 7:5 #IMPLIED... 7:5 #REQUIRED... Directive... 9:11 !important Declaration... 9:11 #FIXED... 7:5 #IMPLIED... 7:5 #REQUIRED... 7:4 @import Directive... 9:11 A Absolute Units of Length... 9:14 Addressing the First Line... 9:6 Assigning Meaning to XML Tags...

More information

What is XML? XML is designed to transport and store data.

What is XML? XML is designed to transport and store data. What is XML? XML stands for extensible Markup Language. XML is designed to transport and store data. HTML was designed to display data. XML is a markup language much like HTML XML was designed to carry

More information

Introduction to XML. An Example XML Document. The following is a very simple XML document.

Introduction to XML. An Example XML Document. The following is a very simple XML document. Introduction to XML Extensible Markup Language (XML) was standardized in 1998 after 2 years of work. However, it developed out of SGML (Standard Generalized Markup Language), a product of the 1970s and

More information

XML 2 APPLICATION. Chapter SYS-ED/ COMPUTER EDUCATION TECHNIQUES, INC.

XML 2 APPLICATION. Chapter SYS-ED/ COMPUTER EDUCATION TECHNIQUES, INC. XML 2 APPLIATION hapter SYS-ED/ OMPUTER EDUATION TEHNIQUES, IN. Objectives You will learn: How to create an XML document. The role of the document map, prolog, and XML declarations. Standalone declarations.

More information

XML. XML Syntax. An example of XML:

XML. XML Syntax. An example of XML: XML Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. Defined in the XML 1.0 Specification

More information

XML (Extensible Markup Language

XML (Extensible Markup Language XML (Extensible Markup Language 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 self describing

More information

Introduction to XML. Chapter 133

Introduction to XML. Chapter 133 Chapter 133 Introduction to XML A. Multiple choice questions: 1. Attributes in XML should be enclosed within. a. single quotes b. double quotes c. both a and b d. none of these c. both a and b 2. Which

More information

1. Please, please, please look at the style sheets job aid that I sent to you some time ago in conjunction with this document.

1. Please, please, please look at the style sheets job aid that I sent to you some time ago in conjunction with this document. 1. Please, please, please look at the style sheets job aid that I sent to you some time ago in conjunction with this document. 2. W3Schools has a lovely html tutorial here (it s worth the time): http://www.w3schools.com/html/default.asp

More information

Start learning XML! Learn by examples! With our editor, you can edit XML and click on a test button to view the result.

Start learning XML! Learn by examples! With our editor, you can edit XML and click on a test button to view the result. file://i:\dokume~1\admini~1\lokale~1\temp\bczz0emh.htm Seite 1 von 3 HOME XML Basic XML HOME XML Introduction XML How to use XML Syntax XML Elements XML Attributes XML Validation XML Browsers XML Viewing

More information

Introduction to XML. M2 MIA, Grenoble Université. François Faure

Introduction to XML. M2 MIA, Grenoble Université. François Faure M2 MIA, Grenoble Université Example tove jani reminder dont forget me this weekend!

More information

XML 2 APPLICATION. Chapter SYS-ED/ COMPUTER EDUCATION TECHNIQUES, INC.

XML 2 APPLICATION. Chapter SYS-ED/ COMPUTER EDUCATION TECHNIQUES, INC. XML 2 APPLIATION hapter SYS-ED/ OMPUTER EDUATION TEHNIQUES, IN. Objectives You will learn: How to create an XML document. The role of the document map, prolog, and XML declarations. Standalone declarations.

More information

11. EXTENSIBLE MARKUP LANGUAGE (XML)

11. EXTENSIBLE MARKUP LANGUAGE (XML) 11. EXTENSIBLE MARKUP LANGUAGE (XML) Introduction Extensible Markup Language is a Meta language that describes the contents of the document. So these tags can be called as self-describing data tags. XML

More information

The components of a basic XML system.

The components of a basic XML system. XML XML stands for EXtensible Markup Language. XML is a markup language much like HTML XML is a software- and hardware-independent tool for carrying information. XML is easy to learn. XML was designed

More information

XML Introduction 1. XML Stands for EXtensible Mark-up Language (XML). 2. SGML Electronic Publishing challenges -1986 3. HTML Web Presentation challenges -1991 4. XML Data Representation challenges -1996

More information

W3C XML XML Overview

W3C XML XML Overview Overview Jaroslav Porubän 2008 References Tutorials, http://www.w3schools.com Specifications, World Wide Web Consortium, http://www.w3.org David Hunter, et al.: Beginning, 4th Edition, Wrox, 2007, 1080

More information

Comp 336/436 - Markup Languages. Fall Semester Week 4. Dr Nick Hayward

Comp 336/436 - Markup Languages. Fall Semester Week 4. Dr Nick Hayward Comp 336/436 - Markup Languages Fall Semester 2017 - Week 4 Dr Nick Hayward XML - recap first version of XML became a W3C Recommendation in 1998 a useful format for data storage and exchange config files,

More information

Overview. Introduction. Introduction XML XML. Lecture 16 Introduction to XML. Boriana Koleva Room: C54

Overview. Introduction. Introduction XML XML. Lecture 16 Introduction to XML. Boriana Koleva Room: C54 Overview Lecture 16 Introduction to XML Boriana Koleva Room: C54 Email: bnk@cs.nott.ac.uk Introduction The Syntax of XML XML Document Structure Document Type Definitions Introduction Introduction SGML

More information

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0 WEB TECHNOLOGIES A COMPUTER SCIENCE PERSPECTIVE CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0 Modified by Ahmed Sallam Based on original slides by Jeffrey C. Jackson reserved. 0-13-185603-0 HTML HELLO WORLD! Document

More information

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1 Make a Website A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1 Overview Course outcome: You'll build four simple websites using web

More information

Chapter 1: Getting Started. You will learn:

Chapter 1: Getting Started. You will learn: Chapter 1: Getting Started SGML and SGML document components. What XML is. XML as compared to SGML and HTML. XML format. XML specifications. XML architecture. Data structure namespaces. Data delivery,

More information

User Interaction: XML and JSON

User Interaction: XML and JSON User Interaction: XML and JSON Asst. Professor Donald J. Patterson INF 133 Fall 2011 1 What might a design notebook be like? Cooler What does a design notebook entry look like? HTML and XML 1989: Tim Berners-Lee

More information

COMP9321 Web Application Engineering. Extensible Markup Language (XML)

COMP9321 Web Application Engineering. Extensible Markup Language (XML) COMP9321 Web Application Engineering Extensible Markup Language (XML) Dr. Basem Suleiman Service Oriented Computing Group, CSE, UNSW Australia Semester 1, 2016, Week 4 http://webapps.cse.unsw.edu.au/webcms2/course/index.php?cid=2442

More information

Comp 336/436 - Markup Languages. Fall Semester Week 4. Dr Nick Hayward

Comp 336/436 - Markup Languages. Fall Semester Week 4. Dr Nick Hayward Comp 336/436 - Markup Languages Fall Semester 2018 - Week 4 Dr Nick Hayward XML - recap first version of XML became a W3C Recommendation in 1998 a useful format for data storage and exchange config files,

More information

Introduction to XML. XML: basic elements

Introduction to XML. XML: basic elements Introduction to XML XML: basic elements XML Trying to wrap your brain around XML is sort of like trying to put an octopus in a bottle. Every time you think you have it under control, a new tentacle shows

More information

Solutions. a. Yes b. No c. Cannot be determined without the DTD. d. Schema. 9. Explain the term extensible. 10. What is an attribute?

Solutions. a. Yes b. No c. Cannot be determined without the DTD. d. Schema. 9. Explain the term extensible. 10. What is an attribute? Chapter 7: Information Representation Method XML Solutions Summative Assessment Multiple-Choice Questions (MCQs) 1. XML was developed to overcome the limitations of the markup language. a. EDI b. SGML

More information

From (Copyright Refsnes Data) XML stands for EXtensible Markup Language.

From  (Copyright Refsnes Data) XML stands for EXtensible Markup Language. of 4 10/05/2007 03:09 A XML Tutorial http://www.w3schools.com/xml/default.asp?output=pr XML Tutorial XML Tutorial XML stands for EXtensible Markup Language. XML is designed to describe data and to focus

More information

Html basics Course Outline

Html basics Course Outline Html basics Course Outline Description Learn the essential skills you will need to create your web pages with HTML. Topics include: adding text any hyperlinks, images and backgrounds, lists, tables, and

More information

HTML. Mohammed Alhessi M.Sc. Geomatics Engineering. Internet GIS Technologies كلية اآلداب - قسم الجغرافيا نظم المعلومات الجغرافية

HTML. Mohammed Alhessi M.Sc. Geomatics Engineering. Internet GIS Technologies كلية اآلداب - قسم الجغرافيا نظم المعلومات الجغرافية HTML Mohammed Alhessi M.Sc. Geomatics Engineering Wednesday, February 18, 2015 Eng. Mohammed Alhessi 1 W3Schools Main Reference: http://www.w3schools.com/ 2 What is HTML? HTML is a markup language for

More information

- What we actually mean by documents (the FRBR hierarchy) - What are the components of documents

- What we actually mean by documents (the FRBR hierarchy) - What are the components of documents Purpose of these slides Introduction to XML for parliamentary documents (and all other kinds of documents, actually) Prof. Fabio Vitali University of Bologna Part 1 Introduce the principal aspects of electronic

More information

CSS, Cascading Style Sheets

CSS, Cascading Style Sheets CSS, Cascading Style Sheets HTML was intended to define the content of a document This is a heading This is a paragraph This is a table element Not how they look (aka style)

More information

Structured documents

Structured documents Structured documents An overview of XML Structured documents Michael Houghton 15/11/2000 Unstructured documents Broadly speaking, text and multimedia document formats can be structured or unstructured.

More information

2009 Martin v. Löwis. Data-centric XML. XML Syntax

2009 Martin v. Löwis. Data-centric XML. XML Syntax Data-centric XML XML Syntax 2 What Is XML? Extensible Markup Language Derived from SGML (Standard Generalized Markup Language) Two goals: large-scale electronic publishing exchange of wide variety of data

More information

The main Topics in this lecture are:

The main Topics in this lecture are: Lecture 15: Working with Extensible Markup Language (XML) The main Topics in this lecture are: - Brief introduction to XML - Some advantages of XML - XML Structure: elements, attributes, entities - What

More information

Data Presentation and Markup Languages

Data Presentation and Markup Languages Data Presentation and Markup Languages MIE456 Tutorial Acknowledgements Some contents of this presentation are borrowed from a tutorial given at VLDB 2000, Cairo, Agypte (www.vldb.org) by D. Florescu &.

More information

Information Systems. XML Essentials. Nikolaj Popov

Information Systems. XML Essentials. Nikolaj Popov Information Systems XML Essentials Nikolaj Popov Research Institute for Symbolic Computation Johannes Kepler University of Linz, Austria popov@risc.uni-linz.ac.at Outline Introduction Basic Syntax Well-Formed

More information

AIM. 10 September

AIM. 10 September AIM These two courses are aimed at introducing you to the World of Web Programming. These courses does NOT make you Master all the skills of a Web Programmer. You must learn and work MORE in this area

More information

Outline. XML vs. HTML and Well Formed vs. Valid. XML Overview. CSC309 Tutorial --XML 4. Edward Xia

Outline. XML vs. HTML and Well Formed vs. Valid. XML Overview. CSC309 Tutorial --XML 4. Edward Xia CSC309 Tutorial XML Edward Xia November 7, 2003 Outline XML Overview XML DOCTYPE Element Declarations Attribute List Declarations Entity Declarations CDATA Stylesheet PI XML Namespaces A Complete Example

More information

extensible Markup Language

extensible Markup Language extensible Markup Language XML is rapidly becoming a widespread method of creating, controlling and managing data on the Web. XML Orientation XML is a method for putting structured data in a text file.

More information

COMSC-030 Web Site Development- Part 1. Part-Time Instructor: Joenil Mistal

COMSC-030 Web Site Development- Part 1. Part-Time Instructor: Joenil Mistal COMSC-030 Web Site Development- Part 1 Part-Time Instructor: Joenil Mistal Chapter 1 1 HTML and Web Page Basics Are you interested in building your own Web pages? This chapter introduces you to basic HTML

More information

Introduction to XML. When talking about XML, here are some terms that would be helpful:

Introduction to XML. When talking about XML, here are some terms that would be helpful: Introduction to XML XML stands for the extensible Markup Language. It is a new markup language, developed by the W3C (World Wide Web Consortium), mainly to overcome limitations in HTML. HTML is an immensely

More information

Copyright 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 7 XML

Copyright 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 7 XML Chapter 7 XML 7.1 Introduction extensible Markup Language Developed from SGML A meta-markup language Deficiencies of HTML and SGML Lax syntactical rules Many complex features that are rarely used HTML

More information

Java EE 7: Back-end Server Application Development 4-2

Java EE 7: Back-end Server Application Development 4-2 Java EE 7: Back-end Server Application Development 4-2 XML describes data objects called XML documents that: Are composed of markup language for structuring the document data Support custom tags for data

More information

Hypertext Markup Language, or HTML, is a markup

Hypertext Markup Language, or HTML, is a markup Introduction to HTML Hypertext Markup Language, or HTML, is a markup language that enables you to structure and display content such as text, images, and links in Web pages. HTML is a very fast and efficient

More information

Chapter 10: Understanding the Standards

Chapter 10: Understanding the Standards Disclaimer: All words, pictures are adopted from Learning Web Design (3 rd eds.) by Jennifer Niederst Robbins, published by O Reilly 2007. Chapter 10: Understanding the Standards CSc2320 In this chapter

More information

SRI VIDYA COLLEGE OF ENGINEERING & TECHNOLOGY- VIRUDHUNAGAR

SRI VIDYA COLLEGE OF ENGINEERING & TECHNOLOGY- VIRUDHUNAGAR UNIT IV Part A 1. WHAT IS THE USE OF XML NAMESPACE? XML allows document authors to create custom elements. This extensibility can result in naming collisions (i.e. different elements that have the same

More information

CSI 3140 WWW Structures, Techniques and Standards. Markup Languages: XHTML 1.0

CSI 3140 WWW Structures, Techniques and Standards. Markup Languages: XHTML 1.0 CSI 3140 WWW Structures, Techniques and Standards Markup Languages: XHTML 1.0 HTML Hello World! Document Type Declaration Document Instance Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson

More information

7.1 Introduction. extensible Markup Language Developed from SGML A meta-markup language Deficiencies of HTML and SGML

7.1 Introduction. extensible Markup Language Developed from SGML A meta-markup language Deficiencies of HTML and SGML 7.1 Introduction extensible Markup Language Developed from SGML A meta-markup language Deficiencies of HTML and SGML Lax syntactical rules Many complex features that are rarely used HTML is a markup language,

More information

but XML goes far beyond HTML: it describes data

but XML goes far beyond HTML: it describes data The XML Meta-Language 1 Introduction to XML The father of markup languages: XML = EXtensible Markup Language is a simplified version of SGML Originally created to overcome the limitations of HTML the HTML

More information

Web scraping and crawling, open data, markup languages and data shaping. Paolo Boldi Dipartimento di Informatica Università degli Studi di Milano

Web scraping and crawling, open data, markup languages and data shaping. Paolo Boldi Dipartimento di Informatica Università degli Studi di Milano Web scraping and crawling, open data, markup languages and data shaping Paolo Boldi Dipartimento di Informatica Università degli Studi di Milano Data Analysis Three steps Data Analysis Three steps In every

More information

Markup Languages SGML, HTML, XML, XHTML. CS 431 February 13, 2006 Carl Lagoze Cornell University

Markup Languages SGML, HTML, XML, XHTML. CS 431 February 13, 2006 Carl Lagoze Cornell University Markup Languages SGML, HTML, XML, XHTML CS 431 February 13, 2006 Carl Lagoze Cornell University Problem Richness of text Elements: letters, numbers, symbols, case Structure: words, sentences, paragraphs,

More information

Well-formed XML Documents

Well-formed XML Documents Well-formed XML Documents Asst. Prof. Dr. Kanda Runapongsa Saikaew (krunapon@kku.ac.th) Dept. of Computer Engineering Khon Kaen University 1 Agenda Types of XML documents Why Well-formed XML Documents

More information

XML. extensible Markup Language. ... and its usefulness for linguists

XML. extensible Markup Language. ... and its usefulness for linguists XML extensible Markup Language... and its usefulness for linguists Thomas Mayer thomas.mayer@uni-konstanz.de Fachbereich Sprachwissenschaft, Universität Konstanz Seminar Computerlinguistik II (Miriam Butt)

More information

XML & Related Languages

XML & Related Languages Unit 1 1 Introduction: XML XML = extensible Markup Language the universal format for structured documents and data on the Web. www.w3c.org/xml simple, very flexible text format derived from SGML (ISO 8879).

More information

EMERGING TECHNOLOGIES. XML Documents and Schemas for XML documents

EMERGING TECHNOLOGIES. XML Documents and Schemas for XML documents EMERGING TECHNOLOGIES XML Documents and Schemas for XML documents Outline 1. Introduction 2. Structure of XML data 3. XML Document Schema 3.1. Document Type Definition (DTD) 3.2. XMLSchema 4. Data Model

More information

Web Programming Pre-01A Web Programming Technologies. Aryo Pinandito, ST, M.MT

Web Programming Pre-01A Web Programming Technologies. Aryo Pinandito, ST, M.MT Web Programming Pre-01A Web Programming Technologies Aryo Pinandito, ST, M.MT Document Formats: The evolution of HTML HTML HyperText Markup Language Primary document type for the web Transmitted using

More information

Introduction to XML. National University of Computer and Emerging Sciences, Lahore. Shafiq Ur Rahman. Center for Research in Urdu Language Processing

Introduction to XML. National University of Computer and Emerging Sciences, Lahore. Shafiq Ur Rahman. Center for Research in Urdu Language Processing Introduction to XML Shafiq Ur Rahman Center for Research in Urdu Language Processing National University of Computer and Emerging Sciences, Lahore XMLXML DTDDTD Related Related Standards Overview What

More information

Extensible Markup Language (XML) Hamid Zarrabi-Zadeh Web Programming Fall 2013

Extensible Markup Language (XML) Hamid Zarrabi-Zadeh Web Programming Fall 2013 Extensible Markup Language (XML) Hamid Zarrabi-Zadeh Web Programming Fall 2013 2 Outline Introduction XML Structure Document Type Definition (DTD) XHMTL Formatting XML CSS Formatting XSLT Transformations

More information

Introduction to XML Zdeněk Žabokrtský, Rudolf Rosa

Introduction to XML Zdeněk Žabokrtský, Rudolf Rosa NPFL092 Technology for Natural Language Processing Introduction to XML Zdeněk Žabokrtský, Rudolf Rosa November 28, 2018 Charles Univeristy in Prague Faculty of Mathematics and Physics Institute of Formal

More information

CSC Web Technologies, Spring Web Data Exchange Formats

CSC Web Technologies, Spring Web Data Exchange Formats CSC 342 - Web Technologies, Spring 2017 Web Data Exchange Formats Web Data Exchange Data exchange is the process of transforming structured data from one format to another to facilitate data sharing between

More information

Author: Irena Holubová Lecturer: Martin Svoboda

Author: Irena Holubová Lecturer: Martin Svoboda NPRG036 XML Technologies Lecture 1 Introduction, XML, DTD 19. 2. 2018 Author: Irena Holubová Lecturer: Martin Svoboda http://www.ksi.mff.cuni.cz/~svoboda/courses/172-nprg036/ Lecture Outline Introduction

More information

avenue.quark TUTORIAL

avenue.quark TUTORIAL avenue.quark TUTORIAL Table of Contents Table of Contents Introduction 3 Preparing to Use avenue.quark 5 Using Rule-Based Tagging 6 Viewing Extracted XML Content 12 Adding a Rule to a Tagging Rule Set

More information

Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel

Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel Introduction: PHP (Hypertext Preprocessor) was invented by Rasmus Lerdorf in 1994. First it was known as Personal Home Page. Later

More information

XML. Marie Dubremetz Uppsala, April 2014

XML. Marie Dubremetz Uppsala, April 2014 XML Marie Dubremetz marie.dubremetz@lingfil.uu.se Uppsala, April 2014 Presentation Plan 1 Introduction 2 XML Specificities and Motivations 3 XML: Vocabulary and Techniques Uppsala May 2015 2/37 Table of

More information

BEGINNER PHP Table of Contents

BEGINNER PHP Table of Contents Table of Contents 4 5 6 7 8 9 0 Introduction Getting Setup Your first PHP webpage Working with text Talking to the user Comparison & If statements If & Else Cleaning up the game Remembering values Finishing

More information

By Ryan Stevenson. Guidebook #2 HTML

By Ryan Stevenson. Guidebook #2 HTML By Ryan Stevenson Guidebook #2 HTML Table of Contents 1. HTML Terminology & Links 2. HTML Image Tags 3. HTML Lists 4. Text Styling 5. Inline & Block Elements 6. HTML Tables 7. HTML Forms HTML Terminology

More information

Part A: Getting started 1. Open the <oxygen/> editor (with a blue icon, not the author mode with a red icon).

Part A: Getting started 1. Open the <oxygen/> editor (with a blue icon, not the author mode with a red icon). DIGITAL PUBLISHING AND PRESERVATION USING TEI http://www.lib.umich.edu/digital-publishing-production/digital-publishing-and-preservation-using-tei-november-13-2010 Introductory TEI encoding 1 This exercise

More information

Full file at New Perspectives on HTML and CSS 6 th Edition Instructor s Manual 1 of 13. HTML and CSS

Full file at   New Perspectives on HTML and CSS 6 th Edition Instructor s Manual 1 of 13. HTML and CSS New Perspectives on HTML and CSS 6 th Edition Instructor s Manual 1 of 13 HTML and CSS Tutorial One: Getting Started with HTML 5 A Guide to this Instructor s Manual: We have designed this Instructor s

More information

COMP9321 Web Application Engineering

COMP9321 Web Application Engineering COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 http://webapps.cse.unsw.edu.au/webcms2/course/index.php?cid=2411 1 Extensible

More information

Bridges To Computing

Bridges To Computing Bridges To Computing General Information: This document was created for use in the "Bridges to Computing" project of Brooklyn College. You are invited and encouraged to use this presentation to promote

More information

XML for Java Developers G Session 2 - Sub-Topic 1 Beginning XML. Dr. Jean-Claude Franchitti

XML for Java Developers G Session 2 - Sub-Topic 1 Beginning XML. Dr. Jean-Claude Franchitti XML for Java Developers G22.3033-002 Session 2 - Sub-Topic 1 Beginning XML Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences Objectives

More information

CSI 3140 WWW Structures, Techniques and Standards. Representing Web Data: XML

CSI 3140 WWW Structures, Techniques and Standards. Representing Web Data: XML CSI 3140 WWW Structures, Techniques and Standards Representing Web Data: XML XML Example XML document: An XML document is one that follows certain syntax rules (most of which we followed for XHTML) Guy-Vincent

More information

M359 Block5 - Lecture12 Eng/ Waleed Omar

M359 Block5 - Lecture12 Eng/ Waleed Omar Documents and markup languages The term XML stands for extensible Markup Language. Used to label the different parts of documents. Labeling helps in: Displaying the documents in a formatted way Querying

More information

Review of HTML. Chapter Pearson. Fundamentals of Web Development. Randy Connolly and Ricardo Hoar

Review of HTML. Chapter Pearson. Fundamentals of Web Development. Randy Connolly and Ricardo Hoar Review of HTML Chapter 3 Fundamentals of Web Development 2017 Pearson Fundamentals of Web Development http://www.funwebdev.com - 2 nd Ed. What Is HTML and Where Did It Come from? HTML HTML is defined as

More information

Comp 336/436 - Markup Languages. Fall Semester Week 2. Dr Nick Hayward

Comp 336/436 - Markup Languages. Fall Semester Week 2. Dr Nick Hayward Comp 336/436 - Markup Languages Fall Semester 2017 - Week 2 Dr Nick Hayward Digitisation - textual considerations comparable concerns with music in textual digitisation density of data is still a concern

More information

Chapter 1. Creating XML Documents

Chapter 1. Creating XML Documents 4033ch01.qxd 9/11/01 9:18 AM Page 3 Chapter 1 Creating XML Documents The extensible Markup Language (XML) is a text- and data-formatting language that, like HTML, has a tagbased syntax. At first glance,

More information

Data formats. { "firstname": "John", "lastname" : "Smith", "age" : 25, "address" : { "streetaddress": "21 2nd Street",

Data formats. { firstname: John, lastname : Smith, age : 25, address : { streetaddress: 21 2nd Street, Data formats { "firstname": "John", "lastname" : "Smith", "age" : 25, "address" : { "streetaddress": "21 2nd Street", "city" : "New York", "state" : "NY", "postalcode" : "10021" }, CSCI 470: Web Science

More information

XML. Presented by : Guerreiro João Thanh Truong Cong

XML. Presented by : Guerreiro João Thanh Truong Cong XML Presented by : Guerreiro João Thanh Truong Cong XML : Definitions XML = Extensible Markup Language. Other Markup Language : HTML. XML HTML XML describes a Markup Language. XML is a Meta-Language. Users

More information

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 27-1

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 27-1 Slide 27-1 Chapter 27 XML: Extensible Markup Language Chapter Outline Introduction Structured, Semi structured, and Unstructured Data. XML Hierarchical (Tree) Data Model. XML Documents, DTD, and XML Schema.

More information

Chapter 2 XML, XML Schema, XSLT, and XPath

Chapter 2 XML, XML Schema, XSLT, and XPath Summary Chapter 2 XML, XML Schema, XSLT, and XPath Ryan McAlister XML stands for Extensible Markup Language, meaning it uses tags to denote data much like HTML. Unlike HTML though it was designed to carry

More information

The concept of DTD. DTD(Document Type Definition) Why we need DTD

The concept of DTD. DTD(Document Type Definition) Why we need DTD Contents Topics The concept of DTD Why we need DTD The basic grammar of DTD The practice which apply DTD in XML document How to write DTD for valid XML document The concept of DTD DTD(Document Type Definition)

More information

INTRODUCTION TO WEB USING HTML What is HTML?

INTRODUCTION TO WEB USING HTML What is HTML? Geoinformation and Sectoral Statistics Section (GiSS) INTRODUCTION TO WEB USING HTML What is HTML? HTML is the standard markup language for creating Web pages. HTML stands for Hyper Text Markup Language

More information

Semistructured data, XML, DTDs

Semistructured data, XML, DTDs Semistructured data, XML, DTDs Introduction to Databases Manos Papagelis Thanks to Ryan Johnson, John Mylopoulos, Arnold Rosenbloom and Renee Miller for material in these slides Structured vs. unstructured

More information

XML. extensible Markup Language. Overview. Overview. Overview XML Components Document Type Definition (DTD) Attributes and Tags An XML schema

XML. extensible Markup Language. Overview. Overview. Overview XML Components Document Type Definition (DTD) Attributes and Tags An XML schema XML extensible Markup Language An introduction in XML and parsing XML Overview XML Components Document Type Definition (DTD) Attributes and Tags An XML schema 3011 Compiler Construction 2 Overview Overview

More information

Certified HTML5 Developer VS-1029

Certified HTML5 Developer VS-1029 VS-1029 Certified HTML5 Developer Certification Code VS-1029 HTML5 Developer Certification enables candidates to develop websites and web based applications which are having an increased demand in the

More information

XML: and related technologies

XML: and related technologies XML" XML: and related technologies extensible Markup Language (XML) Is a meta-language that describes the content of the document (self-describing data) XML does not specify the tag set or grammar of the

More information

XML extensible Markup Language

XML extensible Markup Language extensible Markup Language Eshcar Hillel Sources: http://www.w3schools.com http://java.sun.com/webservices/jaxp/ learning/tutorial/index.html Tutorial Outline What is? syntax rules Schema Document Object

More information

Software Engineering Methods, XML extensible Markup Language. Tutorial Outline. An Example File: Note.xml XML 1

Software Engineering Methods, XML extensible Markup Language. Tutorial Outline. An Example File: Note.xml XML 1 extensible Markup Language Eshcar Hillel Sources: http://www.w3schools.com http://java.sun.com/webservices/jaxp/ learning/tutorial/index.html Tutorial Outline What is? syntax rules Schema Document Object

More information

Bioinforma)cs Resources XML / Web Access

Bioinforma)cs Resources XML / Web Access Bioinforma)cs Resources XML / Web Access Lecture & Exercises Prof. B. Rost, Dr. L. Richter, J. Reeb Ins)tut für Informa)k I12 XML Infusion (in 10 sec) compila)on from hkp://www.w3schools.com/xml/default.asp

More information

11. HTML5 and Future Web Application

11. HTML5 and Future Web Application 11. HTML5 and Future Web Application 1. Where to learn? http://www.w3schools.com/html/html5_intro.asp 2. Where to start: http://www.w3schools.com/html/html_intro.asp 3. easy to start with an example code

More information

extensible Markup Language (XML) Basic Concepts

extensible Markup Language (XML) Basic Concepts (XML) Basic Concepts Giuseppe Della Penna Università degli Studi di L Aquila dellapenna@univaq.it http://www.di.univaq.it/gdellape This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike

More information

XML. Rodrigo García Carmona Universidad San Pablo-CEU Escuela Politécnica Superior

XML. Rodrigo García Carmona Universidad San Pablo-CEU Escuela Politécnica Superior XML Rodrigo García Carmona Universidad San Pablo-CEU Escuela Politécnica Superior XML INTRODUCTION 2 THE XML LANGUAGE XML: Extensible Markup Language Standard for the presentation and transmission of information.

More information

2. Write style rules for how you d like certain elements to look.

2. Write style rules for how you d like certain elements to look. CSS for presentation Cascading Style Sheet Orientation CSS Cascading Style Sheet is a language that allows the user to change the appearance or presentation of elements on the page: the size, style, and

More information

User Interaction: XML and JSON

User Interaction: XML and JSON User Interaction: XML and JSON Assoc. Professor Donald J. Patterson INF 133 Fall 2012 1 XML w3schools.com bookstore book book book title author year price title author year price title author year price

More information

SDPL : XML Basics 2. SDPL : XML Basics 1. SDPL : XML Basics 4. SDPL : XML Basics 3. SDPL : XML Basics 5

SDPL : XML Basics 2. SDPL : XML Basics 1. SDPL : XML Basics 4. SDPL : XML Basics 3. SDPL : XML Basics 5 2 Basics of XML and XML documents 2.1 XML and XML documents Survivor's Guide to XML, or XML for Computer Scientists / Dummies 2.1 XML and XML documents 2.2 Basics of XML DTDs 2.3 XML Namespaces XML 1.0

More information