Given by Lukasz Beca at CPS714 Computational Science Information Track on June 9 99. Foils prepared July 6 99
Outside Index
Summary of Material
Motivation and Goals |
XML Overview |
XML Basic Concepts |
Document Type Definition (DTD) |
XML Schema |
Extensible Style Language (XSL) |
Languages Based on XML |
XML Tools |
Future |
XML Resources |
Outside Index Summary of Material
Lukasz Beca |
beca@npac.syr.edu |
3-287 CST |
NPAC, Syracuse University |
Motivation and Goals |
XML Overview |
XML Basic Concepts |
Document Type Definition (DTD) |
XML Schema |
Extensible Style Language (XSL) |
Languages Based on XML |
XML Tools |
Future |
XML Resources |
Better search results |
Presenting various views for the same data |
Integration of data from different sources |
Easy use over the Internet |
Easy application development that process documents |
Documents readable by humans |
Documents easy to create |
Interchange of data |
Extensible Markup Language - Subset of Standard Generalized Markup Language (SGML) |
Universal format for describing structured data on the Web |
Specification developed by World Wide Web Consortium (W3C) supervised by XML Working Group |
Elements |
Attributes |
Processing Instructions |
Documents |
Document Object Model |
Namespaces |
Data Islands |
Format: start tag, end tag, and data |
The tags describe the data contained between tags |
The data within the tags is the value of the element |
<title>The Fish Slapping Dance</title> |
<dance>The Fish Slapping Dance</dance> |
Attributes associate name-value pairs with elements |
Attributes may appear only within start-tags and empty-element tags |
<size unit="KB"</size> |
<?xml-stylesheet type="text/xsl" href="mystyle.xsl"?> |
Mechanism for by-passing the normal operation of an XML processor and delivering instructions directly to a process whose responsibility it is to interpret the instruction and act accordingly |
Document is an XML element that can (or not) contain other nested XML elements |
<clip> |
<title>The Fish Slapping Dance<title> |
<authors>Monty Python</authors> |
<format>avi</format> |
<size unit="KB"</size> |
<priceinfo> |
<regprice unit="US dollars"ᡇ</regprice> |
<ourpriceᡂ</ourprice> |
</priceinfo> |
</clip> |
Well-formed document: obeys the syntax of XML |
Valid documents: a well-formed document that contains a proper document type declaration and obeys the constraints of that declaration |
The example shows plain XML document displayed in Internet Explorer 5.0 |
URL: |
http://msdn.microsoft.com/xml/samples/transform-viewer/auction1.xml |
Programming API for XML documents |
Describes logical structure of document and the way a document is accessed and manipulated |
Defines naming convention for document components |
Enables straightforward access to the document components |
Implemented by the tools that enable manipulation of XML documents |
root = doc.getDocumentElement(); |
//print tag name |
System.out.println(root.getTagName()); |
//get first child element of the root |
docElem = (Node) root.getFirstChild(); |
//print tag name |
System.out.println(docElem.getTagName()); |
//print element type |
System.out.println(docElem.getNodeType()); |
//print node value |
docElem1 = (Text) docElem.getFirstChild(); |
System.out.println(docElem1.getNodeValue()); |
Collection of related XML elements and attributes identified by a URI reference |
Mechanism for solving elements and attributes name conflicts |
<title>The Fish Slapping Dance</title> |
<title>Mr</title> |
<ClipInfo:title>The Fish Slapping Dance</title> |
<PersonInfo:title>Mr</title> |
Default declaration |
<clip xmlns="urn:Clip.org:ClipInfo"> |
<title></title> |
</clip> |
Explicit declaration |
<cl:clip xmlns:cl="urn:Clip.org:ClipInfo" |
xmlns:money="urn:Finance:Money"> |
<cl:title>The Fish Slapping Dance</cl:title> |
<cl:price money:currency="US dollar"ᡆ.76</cl:price> |
</cl:clip> |
XML code embedded in an HTML page |
Enables integration of XML with HTML page (XML data can be accessed by scripts) |
Contains well-formed XML document within <XML> </XML> tags |
<XML ID="clipXML"> |
<clip> |
<title>The Fish Slapping Dance</title> |
<size unit="KB"</size> |
</clip> |
</XML> |
clipXML.documentElement.childNodes.item(0).text |
Grammar for tag language |
Defines the rules governing the relations between elements and attributes |
Used for:
|
Association with XML document: |
<!DOCTYPE clip SYSTEM "clipdef.dtd"> |
<!DOCTYPE clip [ |
<!ELEMENT clip (title,size)> |
<!ELEMENT title (#PCDATA)> |
<!ELEMENT size (#PCDATA)> |
<!ATTLIST size unit CDATA #REQUIRED> |
]> |
Provides nearly the same functionality as Document Type Definition |
Uses XML syntax |
Schema authors can add their own elements and attributes to XML Schema documents |
Enables element and attribute typing and assigning default values |
Association with XML document: |
<clip xmlns="x-schema:clipSchema.xml"> |
<Schema xmlns="urn:schemas-npac-edu:clip-data" |
xmlns:dt="urn:schemas-microsoft-com:datatypes"> |
<AttributeType name="unit" dt:type="string" required="yes"/> |
<ElementType name="title" content="textOnly" |
dt:type="string"/> |
<ElementType name="size" content="textOnly" dt:type="int"> |
<attribute type="unit"/> |
</ElementType> |
<ElementType name="clip" content="eltOnly"> |
<element type="title"/> |
<element type="size"/> |
</ElementType> |
</Schema> |
Enables display of XML by transforming XML into structure suitable for display, for example HTML |
XSL transformations can be executed on the server to provide HTML documents for older browsers |
Provides mechanisms for transformation of XML data from one schema to another |
Enables converting XML documents through querying, sorting, and filtering |
Association with XML document: |
<?xml-stylesheet type="text/xsl"href="mystyle.xsl"?> |
The example illustrates how the XSL document is applied to XML document and displayed in the Web browser |
The example must be viewed using Internet Explorer 5.0 |
URL: |
http://msdn.microsoft.com/xml/samples/transform-viewer/transform-viewer.htm |
Contain a template of the desired result structure |
Identify data in the source document to insert into the template |
Example: Fragments of XSL document define how elements of XML document should be transformed into HTML document |
Simple query language for identifying nodes in an XML document |
Identify nodes depending on:
|
|
The example shows how the parts of the XML document can be identified using XSL patterns |
The example must be displayed in Internet Explorer 5.0 |
URL: |
http://msdn.microsoft.com/xml/samples/authors/author-patterns.htm |
Resource Description Framework (RDF) standard for metadata exchange, enables better content searching on the Web |
Synchronized Multimedia Integration Language (SMIL) enables simple authoring of TV-like multimedia presentations such as training courses on the Web |
Scalable Vector Graphics (SVG) - a language for describing two-dimensional graphics in XML |
Synchronized Multimedia Integration Language - allows integrating a set of multimedia objects into a synchronized multimedia presentation |
SMIL provides mechanisms for
|
Layout: the layout of the visual clips can be defined, the clips can be assigned to the predefined separate regions |
Clip playback: the clips can be played from various sources and in different modes |
Clip temporal dependency: the clips can be played in parallel or sequential manner |
Hyperlinks: a clip can be connected to another clip or presentation |
<smil> |
<head> |
<layout> |
<root-layout background-color="blue" width="200" height="300"/> |
<region id="videoregion" top="10" left="10" width="180" height="180"/> |
</layout> |
</head> |
<body> |
<par repeat="3"> |
<video src="video.rm" region="videoregion"/> |
<audio src="audio.rm"/> |
</par> |
</body> |
</smil> |
The example shows a presentation created using SMIL |
The presentation is displayed using RealPlayer from RealNetworks |
The file with presentation is available from: |
http://www10.real.com/devzone/library/creating/smil/production.html |
Parsers, used for accessing, analyzing and transforming XML documents (Sun, Microsoft, IBM)
|
Editors, used for creating XML content (Microsoft, IBM) |
Java APIs for XML (Sun) |
The example demonstrates abilities of XML Notepad |
The XML Notepad is available from: |
http://msdn.microsoft.com/xml/notepad/download.asp |
Completion of XML-related specifications:
|
XML as a standard format for data storage and Internet delivery |
Proliferation of XML-based languages for various industry and research domains |
|
InternetExplorer 5.0 and XML/XSL tutorials: |
http://msdn.microsoft.com/xml/ |
Specifications: |
http://www.w3.org |
More tutorials and informations for developers: |
http://www.zdnet.com/devhead/filters/xml/ |
http://www.xml.com |
Resources at NPAC: |
http://www.npac.syr.edu/projects/tutorials/XML/ |