CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting XML.

Slides:



Advertisements
Similar presentations
CSCI N241: Fundamentals of Web Design Copyright ©2004 Department of Computer & Information Science Introducing XHTML: Module B: HTML to XHTML.
Advertisements

SPECIAL TOPIC XML. Introducing XML XML (eXtensible Markup Language) ◦A language used to create structured documents XML vs HTML ◦XML is designed to transport.
History Leading to XHTML
Extensible Markup Language Natawut Nupairoj, Ph.D. Department of Computer Engineering Chulalongkorn University.
Extensible Markup Language XML MIS 520 – Database Theory Fall 2001 (Day) Lecture 14.
Thayer School of Engineering Dartmouth Lecture 2 Overview Web Services concept XML introduction Visual Studio.net.
26-Jun-15 XML. 2 HTML and XML, I XML stands for eXtensible Markup Language HTML is used to mark up text so it can be displayed to users XML is used to.
XML Primer. 2 History: SGML vs. HTML vs. XML SGML (1960) XML(1996) HTML(1990) XHTML(2000)
CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting RSS.
Introducing XHTML: Module B: HTML to XHTML. Goals Understand how XHTML evolved as a language for Web delivery Understand the importance of DTDs Understand.
XHTML, XML and XSLT. XHTML – EXtensible HyperText Markup Language is HTML defined as an XML application is a stricter and cleaner HTML is compatible to.
Introducing HTML & XHTML:. Goals  Understand hyperlinking  Understand how tags are formed and used.  Understand HTML as a markup language  Understand.
Topics The "bigger picture" –The "XML sales pitch" –XML/XHTML vs. SGML/HTML –XML in electronic publishing –XML and the future, web 2.0 XML basics: –Building.
XML introduction to Ahmed I. Deeb Dr. Anwar Mousa  presenter  instructor University Of Palestine-2009.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
XML eXtensible Markup Language by Darrell Payne. Experience Logicon / Sterling Federal C, C++, JavaScript/Jscript, Shell Script, Perl XML Training XML.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
XML eXtensible Markup Language w3c standard Why? Store and transport data Easy data exchange Create more languages WSDL (Web Service Description Language)
Introduction to XML Eugenia Fernandez IUPUI. What is XML? From the World Wide Web Consortium (W3C) The Extensible Markup Language (XML) is the universal.
XML What is XML? XML v.s. HTML XML Components Well-formed and Valid Document Type Definition (DTD) Extensible Style Language (XSL) SAX and DOM.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.
CIT 383: Administrative Scripting
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
1 XHTML محمد احمدی نیا 2 Of 19 HTML vs XHTML  XHTML is a stricter and cleaner version of HTML.  by combining the strengths of HTML.
XHTML. Introduction to XHTML What Is XHTML? – XHTML stands for EXtensible HyperText Markup Language – XHTML is almost identical to HTML 4.01 – XHTML is.
XML Extensible Markup Language. What is XML? An infrastructure for describing text and data Developed by W3C(the World Wide Web Consortium)
 XML is designed to describe data and to focus on what data is. HTML is designed to display data and to focus on how data looks.  XML is created to structure,
XML About XML Things to be known Related Technologies XML DOC Structure Exploring XML.
1 Chapter 10: XML What is XML What is XML Basic Components of XML Basic Components of XML XPath XPath XQuery XQuery.
CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting Writing Methods.
XML Extensible Markup Language
XML – An Introduction Structured Data Mark-up James McCartney CSCE 590, Cluster and Grid Computing.
Softsmith Infotech XML. Softsmith Infotech XML EXtensible Markup Language XML is a markup language much like HTML Designed to carry data, not to display.
XML 2nd EDITION Tutorial 1 Creating An Xml Document.
XML Documents Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Elements Attributes Comments PI Document.
Introduction to XML This presentation covers introductory features of XML. What XML is and what it is not? What does it do? Put different related technologies.
XML Instructor: Charles Moen CSCI/CINF XML  Extensible Markup Language  A set of rules that allow you to create your own markup language  Designed.
17 Apr 2002 XML Syntax: Documents Andy Clark. Basic Document Structure Element tags – Elements have associated attributes Text content Miscellaneous –
Lecture 16 Introduction to XML Boriana Koleva Room: C54
XML EXtensible Markup Language. Agenda Introduction to XML XML Rules XML Elements XML Attributes XML Validation XML Exercises XML Namespaces XML CDATA.
XML Introduction. What is XML? XML stands for eXtensible Markup Language XML stands for eXtensible Markup Language XML is a markup language much like.
The eXtensible Markup Language (XML). Presentation Outline Part 1: The basics of creating an XML document Part 2: Developing constraints for a well formed.
XML for Text Markup An introduction to XML markup.
An Introduction to XML Paul Donohue May 8th 2002 Hotel Senator Zürich.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting Regular Expressions.
Web Technologies Lecture 4 XML and XHTML. XML Extensible Markup Language Set of rules for encoding a document in a format readable – By humans, and –
Well Formed XML The basics. A Simple XML Document Smith Alice.
CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting Numbers.
What is XML? eXtensible Markup Language eXtensible Markup Language A subset of SGML (Standard Generalized Markup Language) A subset of SGML (Standard Generalized.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
XP Tutorial 9New Perspectives on HTML and XHTML, Comprehensive 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting Directories.
CIT 383: Administrative Scripting
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
Introduction to XML Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
XML Notes taken from w3schools. What is XML? XML stands for EXtensible Markup Language. XML was designed to store and transport data. XML was designed.
1 Introduction to XML Babak Esfandiari. 2 What is XML? introduced by W3C in 98 Stands for eXtensible Markup Language it is more general than HTML, but.
XML BASICS and more…. What is XML? In common:  XML is a standard, simple, self-describing way of encoding both text and data so that content can be processed.
Unit 4 Representing Web Data: XML
CIT 383: Administrative Scripting
XML in Web Technologies
Chapter 7 Representing Web Data: XML
CIT 383: Administrative Scripting
CIT 383: Administrative Scripting
CIT 383: Administrative Scripting
Allyson Falkner Spokane County ISD
Presentation transcript:

CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting XML

CIT 383: Administrative Scripting Topics 1.What is XML? 2.XML Structure 3.REXML

CIT 383: Administrative Scripting eXtensible Markup Language Extensible descriptive markup language framework –Began as subset of Standard Generalized Markup Language (SGML). –To ensure that data remains available after programs that originally created/read it become obsolete or unusable. Chris Pine Learn to Program

CIT 383: Administrative Scripting Descriptive vs Presentational Presentational describe how documents should look text turns on boldface for text What if you want to change book titles from bold to italics? Replace won’t work if items other than books are bold. Descriptive languages focus on the meaning xml and you Stylesheets describe how to present logical items. Can just be used for data storage, interchange. A/K/A logical or structural markup languages.

CIT 383: Administrative Scripting XML-based Languages Ant Atom CML MathML MML MusicXML ODF OPML RDF SAML SOAP SVG VoiceXML WML XHTML XUL

CIT 383: Administrative Scripting Evolution of XML 1986 SGML standard published as ISO Unicode proposal published 1991 First volume of Unicode standard 1996 XML work started 1998 XML 1.0 released as a W3C standard 2001 XML Schema language 2004 XML 1.1 released (not widely used) 2007 Unicode 5.0 published

CIT 383: Administrative Scripting XML Tree Structure Monday’s List Study for midterm Scripting Class Bathe cat todo title Tuesday’s List item Study for midterm item Scripting Class priority 10 item Bathe Cat

CIT 383: Administrative Scripting Elements and Attributes An element consists of tags and contents Learn to Program Begin and end tags are mandatory. Attributes number=“ ” Elements may have zero or more attributes. Attribute values must always be quoted.

CIT 383: Administrative Scripting Text XML declaration specifies character encoding Encodings Unicode: universal character set, UTF-8, UTF-32 ISO-8859: 8-bit encodings, is West Europe Entities &#nnnn; encodes specified Unicode character &name; are named character entities, such as < is < > is > & is & currency symbols, fractions, Greek letters, math symbols, etc.

CIT 383: Administrative Scripting XML Syntax Rules 1.There is one and only one root tag. 2.Begin tags must be matched by an end tag. 3.XML tags must be properly nested. 4.XML tags are case sensitive. 5.All attribute values must be quoted. 6.Whitespace within tags is part of text. 7.Newlines are always stored as LF. 8.HTML-style comments:

CIT 383: Administrative Scripting Correctness Well-formed –Conforms to XML syntax rules. –A conforming parser will not parse documents that are not well-formed. Valid –Conforms to XML semantics rules as defined in Document Type Definition (DTD) XML Schema –A validating parser will not parse invalid documents.

CIT 383: Administrative Scripting XML Schema Languages Document Type Definitions Inherited from SGML. No support for all XML. XML Schema Most commonly used. Schemas are XML docs. A/K/A WXS, XSD RELAX NG REgular LAnguage for XML Next Generation XML and non-XML forms.

CIT 383: Administrative Scripting Ruby XML Parsers REXML: Ruby Electric XML –Standard with the ruby language. –Slow on large documents. libxml-ruby –Ruby bindings for Gnome libxml2 XML toolkit. –Very fast (30X as fast as REXML). HPricot –Parses XML as well as HTML. –Fast (3-4X as fast as REXML). –Does not check for well-formedness or validity.

CIT 383: Administrative Scripting Types of Parsing Tree Parsing (DOM-like) –Good for small documents. –Loads entire document into memory. –Simple API Stream Parsing (SAX-like) –Good for large documents. –User defines callback methods, passes to API. –Parser runs callback methods on pattern match.

CIT 383: Administrative Scripting Tree Parsing Loads entire XML doc into memory. require ‘rexml/document’ include REXML input = File.new(‘data.xml’) doc = Document.new(input) root = doc.root Search document as a tree using XPath doc.elements.each(“ch/section”) do |e| puts e.attributes[“title”] end

CIT 383: Administrative Scripting Stream Parsing Define listener class. class MyListener include REXML::StreamListener def tag_start(*args) puts “start: #{args.map {|x| x.inspect}.join(‘,’” end Invoke parser require ‘rexml/document’ require ‘rexml/streamlistener’ include REXML listen = MyListener.new source = File.new(‘data.xml’) Document.parse_stream(source, listen)

CIT 383: Administrative Scripting XPath Searches h.search("p") Find all paragraph tags in document. doc.search("/html/body//p") Find all paragraph tags within the body tag. Find all anchor tags with a src attribute. Find all a tags with a src attribute of google.com.

CIT 383: Administrative ScriptingSlide #18 References 1.Michael Fitzgerald, Learning Ruby, O’Reilly, David Flanagan and Yukihiro Matsumoto, The Ruby Programming Language, O’Reilly, Hal Fulton, The Ruby Way, 2 nd edition, Addison- Wesley, Robert C. Martin, Clean Code, Prentice Hall, Dave Thomas with Chad Fowler and Andy Hunt, Programming Ruby, 2 nd edition, Pragmatic Programmers, 2005.