XML מבוא כללי פרק ב' MCSD Doron Amir www.doronamir.com.

Slides:



Advertisements
Similar presentations
Defining XML The Document Type Definition. Document Type Definition text syntax for defining –elements of XML –attributes (and possibly default values)
Advertisements

XML Document Type Definitions ( DTD ). 1.Introduction to DTD An XML document may have an optional DTD, which defines the document’s grammar. Since the.
3 November 2008CIS 340 # 1 Topics To define XML as a technology To place XML in the context of system architectures.
Tutorial 9 Working with XHTML
XML Study-Session: Part II Validating XML Documents.
An Introduction to XML Schema CSCI 7818 by Ming Rutar.
Document Type Definition DTDs CS-328. What is a DTD Defines the structure of an XML document Only the elements defined in a DTD can be used in an XML.
1 XML: Document Type Definitions 2 Road Map  Introduction to DTDs  What’s a DTD?  Why are they important?  What will we cover?  Our First DTD 
A Technical Introduction to XML Transparency No. 1 XML quick References.
 2002 Prentice Hall, Inc. All rights reserved. ISQA 407 XML/WML Winter 2002 Dr. Sergio Davalos.
XML Namespaces Andrey Smirnov CSCI 7818 September 21, 2000.
Semi-structured Data. Facts about the Web Growing fast Popular Semi-structured data –Data is presented for ‘human’-processing –Data is often ‘self-describing’
XML Verification Well-formed XML document  conforms to basic XML syntax  contains only built-in character entities Validated XML document  conforms.
XML Basics Hope Greenberg Center for Teaching & Learning.
XP New Perspectives on XML Tutorial 3 1 DTD Tutorial – Carey ISBN
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Document Type Definition.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
Copyright © 2003 Pearson Education, Inc. Slide 3-1 Created by Cheryl M. Hughes, Harvard University Extension School — Cambridge, MA The Web Wizard’s Guide.
Why XML ? Problems with HTML HTML design - HTML is intended for presentation of information as Web pages. - HTML contains a fixed set of markup tags. This.
Chapter 4: Document Type Definitions. Chapter 4 Objectives Learn to create DTDs Validate an XML document against a DTD Use DTDs to create XML documents.
XML CPSC 315 – Programming Studio Fall 2008 Project 3, Lecture 1.
Document Type Definitions Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
XML - DTD. The building blocks of XML documents Elements, Tags, Attributes, Entities, PCDATA, and CDATA.
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.
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
Introduction to XML. What is XML? Extensible Markup Language XML Easier-to-use subset of SGML (Standard Generalized Markup Language) XML is a.
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
XML Syntax - Writing XML and Designing DTD's
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorial 9: Working With XHTML.
XP 1 DECLARING A DTD A DTD can be used to: –Ensure all required elements are present in the document –Prevent undefined elements from being used –Enforce.
Example Write the DTD rules for the following XML fragment. Kim 34 South Street NY USA Vice President $175,000 1.
Tutorial 1: XML Creating an XML Document. 2 Introducing XML XML stands for Extensible Markup Language. A markup language specifies the structure and content.
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
 2002 Prentice Hall, Inc. All rights reserved. Chapter 6 – Document Type Definition (DTD) Outline 6.1Introduction 6.2Parsers, Well-formed and Valid XML.
Lecture 6 XML DTD Content of.xml fileContent of.dtd file.
1 Chapter 10: XML What is XML What is XML Basic Components of XML Basic Components of XML XPath XPath XQuery XQuery.
XML - DTD Week 4 Anthony Borquez. What can XML do? provides an application independent way of sharing data. independent groups of people can agree to.
CIS 451: XML DTDs Dr. Ralph D. Westfall February, 2009.
3. Document Type Definitions(DTDs) Data Warehousing Lab. 윤 혜 정.
XML Documents Chao-Hsien Chu, Ph.D. School of Information Sciences and Technology The Pennsylvania State University Elements Attributes Comments PI Document.
XML Instructor: Charles Moen CSCI/CINF XML  Extensible Markup Language  A set of rules that allow you to create your own markup language  Designed.
Lecture 16 Introduction to XML Boriana Koleva Room: C54
1 Introduction to XML XML stands for Extensible Markup Language. Because it is extensible, XML has been used to create a wide variety of different markup.
An Introduction to XML Sandeep Bhattaram
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Understanding How XML Works Ellen Pearlman Eileen Mullin Programming the.
XML Introduction. What is XML? XML stands for eXtensible Markup Language XML stands for eXtensible Markup Language XML is a markup language much like.
1 Dr Alexiei Dingli XML Technologies DTD. 2 Document Type Definition Defines –the legal building blocks of an XML document –the document structure –The.
1/11 ITApplications XML Module Session 3: Document Type Definition (DTD) Part 1.
CSE3201 Information Retrieval Systems DTD Document Type Definition.
XML Design Goals 1.XML must be easily usable over the Internet 2.XML must support a wide variety of applications 3.XML must be compatible with SGML 4.It.
Document Type Definitions (DTD) A Document Type Definition (DTD) defines the structure and the legal elements and attributes of an XML document. A DTD.
Beginning XML 3 rd Edition. Chapter 4: Document Type Definitions.
INFSY 547: WEB-Based Technologies Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Well Formed XML The basics. A Simple XML Document Smith Alice.
Applications of XML Oz OceanAtlas Software and NOAA/PMEL.
What is XML? eXtensible Markup Language eXtensible Markup Language A subset of SGML (Standard Generalized Markup Language) A subset of SGML (Standard Generalized.
XML DTD. XML Validation XML with correct syntax is "Well Formed" XML. XML validated against a DTD is "Valid" XML.
DTD Document Type Definition. Agenda Introduction to DTD DTD Building Blocks DTD Elements DTD Attributes DTD Entities DTD Exercises DTD Q&A.
Introduction to XML Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Copyrighted material John Tullis 3/18/2016 page 1 04/29/00 XML Part 4 John Tullis DePaul Instructor
Extensible Markup Language (XML) Pat Morin COMP 2405.
XML Technologies DTD.
Tutorial 9 Working with XHTML
Extensible Markup Language XML
Document Type Definition DTDs
The XML Language.
دانشكده مهندسي كامپيوتر
New Perspectives on XML
Document Type Definition (DTD)
Presentation transcript:

XML מבוא כללי פרק ב' MCSD Doron Amir www.doronamir.com

מצגת מס' 2 Prolog XML Processor \ Parser Debug Document Element CSS XML Document Valid DTD \ !DOCTYPE

Prolog פתיחה הצהרת XML + גרסה <?xml version=“1.0”? Comment הערה ( מעבד ה-XML מתעלם) <! - - File Name : my Page - - > DTD : הגדרת מבנה המסמך Processing Instruction : הנחיות למעבד ( קישור מסמך)

XML Processor XML Parser קורא את המסמך ומספק גישה לתוכן המסמך

Debug  Parser

Document Element החלק העיקרי של מסמך XML נקרא גם Root Element <?xml version="1.0"?> <!-- File Name: Inventory01.xml --> <?xml-stylesheet type="text/css" href="Inventory01.css"?> <INVENTORY> <BOOK> <TITLE>Lead The Public </TITLE> <AUTHOR>Doron Amir</AUTHOR> <BINDING>Soft</BINDING> <PAGES>120</PAGES> <PRICE>$10</PRICE> </BOOK> <TITLE>Leaves </TITLE> <AUTHOR>Avi Care </AUTHOR> <BINDING>hardcover</BINDING> <PAGES>222</PAGES> <PRICE>$22</PRICE> </INVENTORY> החלק העיקרי של מסמך XML נקרא גם Root Element רכיב בודד המכיל קינון רכיבים בתוכו סוג הרכיב רכיב \ Element מקונן רכיב \ Element מקונן רכיב \ Element מקונן

XML Document כללים בסיסיים ליצירת מסמך XML רכיב אחד בלבד של הרמה העליונה Root Element קינון בצורה מותאמת לכל רכיב תגית פתיחה + סגירה התאמה מלאה בין תגית פתיחה לתגית סגירה כל טקסט הנמצא בתגיות הנו : Case Sensitive

CSS

XML Document Valid עמידה בסטנדרט לעיצוב מסמך XML הצהרת מבנה המסמך ע"י DTD יצירת המסמך תוך שמירה על הגדרות ה DTD מבטיח אחידות של קבוצת מסמכים דומים הכללת ההצהרה בכל מסמך מגבילה את עורכי הדף לכללים המוסכמים

DTD - !DOCTYPE <!DOCTYPE INVENTORY [ <!ELEMENT SIMPLE ANY> ] Document Type Definition הצהרות סוג – רכיב הצהרות רשימת מאפיינים הצהרות על ישויות הצהרות פורמט ותבניות נתונים הנחיות עיבוד הערות <!DOCTYPE INVENTORY [ <!ELEMENT SIMPLE ANY> ] > הצהרה כי הרכיב INVENTORY יכול להכיל רכיב צאצא SIMPLE בלבד ANY : הרכיב יכול להכיל כל סוג של תוכן

Parsed Character Data נתונים תווים מנותחים DOCTYPE <! DOCTYPE MyElement [ <!ELEMENT MyElement (X|Y|Z)> <!ELEMENT X(#PCDATA)> <!ELEMENT Y(#PCDATA)> <!ELEMENT Z(#PCDATA)> < הרכיב MyElement כול להכיל רכיב צאצא אחד בלבד או X או Y או Z המכילים ערך תווי PCDATA# <MyElement> <X>Hello</X> </MyElement> Parsed Character Data נתונים תווים מנותחים

רכיב צאצא אחד או יותר <! DOCTYPE MyElement [ <!ELEMENT MyElement (X+,Y?,Z,t*)> <!ELEMENT X(#PCDATA)> <!ELEMENT Y(#PCDATA)> <!ELEMENT Z(#PCDATA)> < X+ אחד או יותר ?Y אופציונלי (1 או 0 ) Z רכיב אחד בלבד *t 0 רכיבים או יותר ( 0 או n ) אפשרי הגדרה כללית MyElement (X,Y,Z,t)+>

מודל בחירה <!ELEMENT MyElement (X,Y,(a|b|c))> Sequence \ Choice ניתן לציין את רצף קינון התגיות <!ELEMENT MyElement (X,Y,(a|b|c))> <MyElement> <x> <y> <a>Hello</a> </y> </x> </MyElement>

Attribute Definitions <!ELEMENT MyElement(TITLE,(a,b,c)> <!ATTLIST MyElement Att1 CDATA #REQUIRED> שם המאפיין עבור הרכיב MyElement סוג המאפיין ברירת המחדל = חובה לאתחול <MyElement Att1=“Hell”> </MYelement> <a>World</a>

כללי מאפיינים REQUIRED # : חובה לציין ערך עבור המאפיין IMPLIED # : המעבד לא יקצה ערך ברירת מחדל ברירת מחדל <!ATTLIST MyE Att1 CDATA “Hello”> אם לא אותחל בערך יושם ערך ברירת המחדל <!ATTLIST MyE Att1 CDATA #FIXED “Hello”>

יבוא DTD חיצוני <!DOCTYPE MYELEMENT SYSTEM “X.dtd”> מילה שמורה מקשרת את הקובץ הכולל את הצהרת ה DTD אל הקובץ הנוכחי <!DOCTYPE MYELEMENT SYSTEM “http://......../X.dtd> כך ניתן לכלול הצהרה משותפת למספר דפים + תחזוקה מהירה

IGNORE \ INCLUDE מאפשר להתעלם או להתייחס ל DTD החיצוני להתייחס שוב <![IGNORE[ <!ATTLIST….. <!ELEMENT… ]]> <![INCLUDE[ <!ATTLIST….. <!ELEMENT… ]]>

!DOCTYPE PCDATA נתון תווי <!DOCTYPE INVENTORY [ <!ELEMENT INVENTORY (BOOK)*> <!ELEMENT BOOK (TITLE, AUTHOR, BINDING, PAGES, PRICE)> <!ATTLIST BOOK InStock (yes|no) #REQUIRED> <!ELEMENT TITLE (#PCDATA | SUBTITLE)*> <!ELEMENT SUBTITLE (#PCDATA)> <!ELEMENT AUTHOR (#PCDATA)> <!ATTLIST AUTHOR Born CDATA #IMPLIED> <!ELEMENT BINDING (#PCDATA)> <!ELEMENT PAGES (#PCDATA)> <!ELEMENT PRICE (#PCDATA)> ] > רכיבי צאצא מאפיין המקבל ערך YES או NO + חובה לשים ערך 0 או יותר Elements רכייב זה יכול להכיל 0 או יותר רכיבים מסוג SUBTITLE PCDATA נתון תווי שיוך ערך למאפיין זה הנו אופציונלי ואין עבורו ברירת מחדל הצהרה על רכיב בשם PRICE המורשה להכיל רק נתוני תווים

XML  DTD

סיכום Prolog XML Processor \ Parser Debug Document Element CSS XML Document Valid DTD \ !DOCTYPE Attribute Definitions

XML מבוא כללי פרק ב' MCSD Doron Amir www.doronamir.com