Docstoc

XML

Document Sample
XML Powered By Docstoc
					                      XML
   About XML
   Things to be known
   Related Technologies
   XML DOC Structure
   Exploring XML
                   About………..
   XML – eXtensible Markup Language is a
    technology for creating structured documents that can
    be exchanged b/w systems
   It allows us to store information in a structured and
    semi-structured way, and accessing it using a variety of
    techniques (Websphere, DB2..)
   XML is a set of rules for defining semantic (meaningful)
    tags that break a document into parts and identify the
    different parts of the document.
   It makes easy many web development tasks that are
    extremely difficult with HTML
               Things to be Known
   W3C’s (World Wide Web Consortium) Mobile Access
    Activity is working to ensure that the protocols and
    data formats of the web provide and effective fit for all
    mobile devices and web based applications. To support
    those and also multiple disparate (different) types of
    clients; it provides the standards, proposals of XML.
   XSLT – XML Stylesheet Language provides techniques
    for transforming the structure or content of XML
    documents into WML or anything else.
   XHTML – eXtensible Hypertext Markup Language defines
    a document format that XML(ized) ;will display in a
    traditional browser.
                                                         XML
               SGML

                        Application


               HTML                                 WML
                                                               Application




   XML DOCUMENT LIFE CYCLE


                                      Xerces

 Txpad . exe   Tempest.xml

Editor writes Document is read by Parser sends Browser displays User
                                               data to          page to
           Related Technologies
 Using XML as more than a data format involves several related
  technologies and standards, including the following:
 HTML for backward compatibility with browsers.
 The CSS and XSL style sheet languages to define the appearance
  of XML documents.
 URL’s and URI’s (Uniform Resource Identifier) to specify the
  locations of XML documents. (URI – more on resources, less on
  location.)
 Xlinks to connect XML documents to each other.
 The Unicode character set to encode the text of an XML
  document. (OS-appln. s/w to understand character set. –
  scripts.)
      CSS- Cascading Style Sheets
   To tell the browser how to format the tags
    you’ve used. (user-send-style sheet must-
    browser).
   CSS, initially invented for HTML, define
    formatting properties such as font size, font
    family, font weight, paragraph indentation,
    paragraph alignment and other styles that can be
    applied to particular elements.
   For Ex: specifying all H1 elements in 32 points.
          XSL – Extensible Stylesheet
                  Language
    It is a more powerful style language designed specifically for
     XML documents.
    It is actually 2 different XML applications.
    i) XSL Transformations (XSLT)
    ii) XSL Formatting Objects (XSL-FO)
    XSLT stylesheet contains templates that match particular
     patterns of XML elements.
    A CSS style sheet can only change the format of a particular
     element. But XSLT can rearrange, reorder, hide or display
     elements.
    XSL-FO is an XML application that describes the layout of the
     page. Specifies where the particular text is placed on the page
     with other elements (relation) on the page.
     XLinks&Xpointers, Unicode
   XLinks use normal URL’s to identify the site to
    which they’re linking.
   Xpointers allow liknks to point not just to a
    particular document but to a particular part of a
    particular document at a particular location.
            XML Document Structure
   Documents should contain the <?xml….?> prolog that identifies
                                     XML documents
    them as being XML                must follow a set of
                                     rules.
    <?xml version=“1.0” encoding=“UTF-8”?>
   Documents must be well-formed, with no ‘overlapping’ elements.
<b>This is some<i>Bold</b>text</i> --- Wrong
<b>This is some<i>Bold</i></b><i>text</i> --- correct.
 All element and attribute names should be in lower case with
  attributes always in single or double quotes – even for numeric
<card id =“18” title=“Rox Book Details”>
 All elements must have a closing tag or equivalent shorthand
  syntax
<img src=“myp.jpg” alt=“mypic” />
<br/>
 Use an id or name attributes with unique value
  for the document. This will allow XPath and
  XPointer to access elements and content more
  accurately.
 If the device supports stylesheets, use the
  <link> element to attach the stylesheet, so
  clients that don’t support styling do not have to
  download the style sheet information
<link rel=“stylesheet” href=“mystyle.css”
  type=“text/css” />
 Only comments and doc type definitions can
  appear outside the root element.
             EXPLORE - XML
   Markup can indicate three kinds of meaning:
    structural, semantic, or stylistic.
   Structure specifies the relation b/w the different
    elements in the document. It merely expresses
    the form of the document, without regard for
    differences b/w individual tags & elements.
   Semantic relates the individual elements to the
    real world outside the document itself.
   Style specifies how an element is displayed.
                 Example
 EX1: greeting . xml
 <?xml version=“1.0”?>
 <GREETING> Hello XML ! </GREETING>
 EX2: paragraph . xml

 <?xml version=“1.0”?>
 <P> Hello XML ! </P>  Und’s HTML, not XML
 EX3: document . xml

<?xml version=“1.0”?>
 <DOCUMENT> Hello XML ! </DOCUMENT>
          Writing a Style Sheet
XML allows you to create any tags that you
 need. You also need to write a style sheet for the
 XML document that tells browser how to
 display particular tags.
Example for greeting . xml :
GREETING {display: block; font-size: 24pt;
 font-weight: bold}
 Save this file as greeting . css

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:35
posted:8/20/2012
language:English
pages:13