XML
Download
1 / 15

XML - PowerPoint PPT Presentation


  • 130 Views
  • Uploaded on

XML. XML. XML – A tool that can be used to create markup languages Developers can create application specific markup languages Open standard. Benefits of XML. create “self describing” data create type rules style is separate from data. An XML Document. Runners profile.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' XML' - hachi


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

XML

  • XML – A tool that can be used to create markup languages

  • Developers can create application specific markup languages

  • Open standard


Benefits of xml
Benefits of XML

  • create “self describing” data

  • create type rules

  • style is separate from data


An XML Document

  • Runners profile

<?xml version = "1.0"?>

<runner-profile>

<name>Fred Bloggs</name>

<club>Napier Road Runners</club>

<description>Fred took up racing when he was ....</description>

<pb-list>

<distance>10 K</distance> <time>39:00</time>

<distance>Half Marathon</distance> <time>1:32:00</time>

<distance>Marathon</distance> <time>2:59:59</time>

</pb-list>

</runner-profile>


Xml content entities
XML – Content Entities

  • Similar idea to variables

<?xml version = "1.0"?>

<runner-profile>

<name>Fred Bloggs</name>

<club>Napier Road Runners</club>

<description>Fred took up racing when he was ....</description>

<pb-list>

<distance>10 K</distance> <time>39:00</time>

<distance>Half Marathon</distance> <time>1:32:00</time>

<distance>Marathon</distance> <time>2:59:59</time>

</pb-list>

<favourite-event>

<distance> Marathon </distance> <time> 2:59:59</time>

</favourite-event>

</runner-profile>


<?xml version = "1.0"?>

<!DOCTYPE runner-profile [

<!ENTITY marathonPB "2:59:59">

<!ENTITY bio SYSTEM "biography.txt">

]>

<runner-profile>

<name> Fred Bloggs </name>

<club> Napier Road Runners </club>

<description> &bio; </description>

<pb-list>

<distance> 10 K </distance> <time> 39:00 </time>

<distance> Half Marathon </distance> <time> 1:32:00 </time>

<distance> Marathon </distance> <time> &marathonPB; </time>

</pb-list>

<favourite-event>

<distance> Marathon </distance> <time> &marathonPB; </time>

</favourite-event>

</runner-profile>



An xml document
An XML Document

  • Entered as a plain text file

  • Save a .xml


An xml document1
An XML Document

  • Can be viewed in a web browser


Xml docs the declaration
XML Docs – The Declaration

  • Declaration always appears on the first line

  • Begins with …

<?xml

  • … and ends with

?>

  • To give …

<?xml ?>


Xml docs the declaration1
XML Docs – The Declaration

  • The XML declaration …

<?xml ?>

  • Can take three optional parameters

  • version – only 1 at the moment

  • encoding – defines the character set

  • standalone – value is “yes” or “no”. Determines whether all of the information required for validation is contained in this document or whether external document type definitions are required


Xml adding style
XML - Adding Style

  • Link to a style sheet …

<?xml-stylesheet type = "text/css" href = "runner.css" ?>

  • … and then specify the styles

* {

font-family: arial;

}

name {

font-size: 16pt;

color: red;

display: block;

}

club {

font-size: 12pt;

color: green;

display: block;

}


Xml adding style1
XML – Adding Style

  • Instead of this …


Xml adding style2
XML – Adding Style

  • You get this …


Lecture slides
Lecture Slides

  • www.dcs.napier.ac.uk/~owens/wpt/lectures/wptlecture7.ppt


ad