17 Apr 2002 XML Namespaces Andy Clark. The Problem Documents use different vocabularies – Example 1: CD music collection – Example 2: online order transaction.

Slides:



Advertisements
Similar presentations
XML/RDF 2 RDF/XML Resource Description Framework Resource Property Value c:semanticweb c:author c:corby Syntaxe XML.
Advertisements

Copyright © 2003 Pearson Education, Inc. Slide 5-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide.
Transforming XML XMLNamespaces, XSLT. XML Namespaces Sometimes it is necessary to mix XML elements –Different types of content –Use of markup to convey.
XML Examples. Bank Information Basic structure: A-101 Downtown 500 … Johnson Alma Surrey … A-101 Johnson …
XML Schema Heewon Lee. Contents 1. Introduction 2. Concepts 3. Example 4. Conclusion.
What is XML? a meta language that allows you to create and format your own document markups a method for putting structured data into a text file; these.
17 Apr 2002 XML Syntax: DTDs Andy Clark. Validation of XML Documents XML documents must be well-formed XML documents may be valid – Validation verifies.
Chapter 3: XML Namespaces. Chapter 3 Objectives Why you need namespaces What namespaces are, conceptually and how they solve the problem of naming clashes.
The Semantic Web – WEEK 4: RDF
Managing XML and Semistructured Data Lecture 12: XML Schema Prof. Dan Suciu Spring 2001.
Namespace in XML Transparency No. 1 Namespace in XML Cheng-Chia Chen.
XML Namespaces Each schema file associated with a URL to uniquely identify where elements come from – Like packages in Java
1 RDF Tutorial. C. Abela RDF Tutorial2 What is RDF? RDF stands for Resource Description Framework It is used for describing resources on the web Makes.
CIS 375—Web App Dev II SOAP.
ISO DSDL ISO – Document Schema Definition Languages (DSDL) Martin Bryan Convenor, JTC1/SC18 WG1.
SOAP SOAP is a protocol for accessing a Web Service. SOAP stands for Simple Object Access Protocol * SOAP is a communication protocol * SOAP is for communication.
RDF – RESOURCE DESCRIPTION FRAMEWORK Antonio Bucchiarone FBK-IRST Trento, Italy 20 Novembre 2009.
1 Web Data Management XML Schema. 2 In this lecture XML Schemas Elements v. Types Regular expressions Expressive power Resources W3C Draft:
XML: Styling and Transformation Dr Andy Evans. Multiple views Nice thing is that this data can be styled in lots of different ways using stylesheets.
XML Namespaces Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
SPECIAL TOPIC XML. Introducing XML XML (eXtensible Markup Language) ◦A language used to create structured documents XML vs HTML ◦XML is designed to transport.
ESDSWG2011 – Semantic Web session Semantic Web Sub-group Session ESDSWG 2011 Meeting – Semantic Web sub-group session Wednesday, November 2, 2011 Norfolk,
RDF Tutorial.
An Introduction to XML Based on the W3C XML Recommendations.
Tutorial 9 Working with XHTML
Introduction to XLink Transparency No. 1 XML Information Set W3C Recommendation 24 October 2001 (1stEdition) 4 February 2004 (2ndEdition) Cheng-Chia Chen.
More XML namespaces, DTDs CS 431 – February 16, 2005 Carl Lagoze – Cornell University.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic XML.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
XML Verification Well-formed XML document  conforms to basic XML syntax  contains only built-in character entities Validated XML document  conforms.
XP New Perspectives on XML, 2nd Edition Tutorial 2 1 TUTORIAL 2 WORKING WITH NAMESPACES.
Unit 4 – XML Schema XML - Level I Basic.
Tutorial 2: XML Working with Namespaces. COMBINING XML VOCABULARIES IN A COMPOUND DOCUMENT Section 2.1.
1 understanding xml namespaces. 2 understanding namespaces Namespaces are the source of much confusion in XML, especially for those new to the technology.
17 Apr 2002 XML Schema Andy Clark. What is it? A grammar definition language – Like DTDs but better Uses XML syntax – Defined by W3C Primary features.
Working with Namespaces Combining XML Vocabularies in a Compound Document.
XML 2nd EDITION Tutorial 2 Working With Namespaces.
WORKING WITH NAMESPACES
XP New Perspectives on XML Tutorial 4 1 XML Schema Tutorial – Carey ISBN Working with Namespaces and Schemas.
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.
Representing Web Data: XML CSI 3140 WWW Structures, Techniques and Standards.
Skip 2007 Current Issues in MIS The XML Language Foundation f - Clinton E. White, Jr Professor of Accounting & MIS Lerner College of B&E University.
Introduction to XML. What is XML? Extensible Markup Language XML Easier-to-use subset of SGML (Standard Generalized Markup Language) XML is a.
Representing Web Data: XML CSI 3140 WWW Structures, Techniques and Standards.
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
RDF and XML 인공지능 연구실 한기덕. 2 개요  1. Basic of RDF  2. Example of RDF  3. How XML Namespaces Work  4. The Abbreviated RDF Syntax  5. RDF Resource Collections.
An OO schema language for XML SOX W3C Note 30 July 1999.
XP New Perspectives on XML, 2nd Edition Tutorial 2 1 TUTORIAL 2 WORKING WITH NAMESPACES.
17 Apr 2002 XML Syntax: Documents Andy Clark. Basic Document Structure Element tags – Elements have associated attributes Text content Miscellaneous –
XML 2nd EDITION Tutorial 4 Working With Schemas. XP Schemas A schema is an XML document that defines the content and structure of one or more XML documents.
1 Tutorial 14 Validating Documents with Schemas Exploring the XML Schema Vocabulary.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2.
Working with XML Schemas ©NIITeXtensible Markup Language/Lesson 3/Slide 1 of 36 Objectives In this lesson, you will learn to: * Declare attributes in an.
XML Schema (W3C) Thanks to Jussi Pohjolainen TAMK University of Applied Sciences.
XML A Language Presentation. Outline 1. Introduction 2. XML 2.1 Background 2.2 Structure 2.3 Advantages 3. Related Technologies 3.1 DTD 3.2 Schemas and.
1 Compound Documents: Combining XML Vocabularies.
Tutorial 2: XML Working with Namespaces. 2 Name Collision This figure shows two documents each with a Name element.
XML Validation II Advanced DTDs + Schemas Robin Burke ECT 360.
Introduction to XML Namespaces Web Engineering, SS 2007 Tomáš Pitner.
 XML derives its strength from a variety of supporting technologies.  Structure and data types: When using XML to exchange data among clients, partners,
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
1 Extensible Stylesheet Language (XSL) Extensible Stylesheet Language (XSL)
XML Namespaces In this first lesson XML Namespaces, you will learn to:
1 Extensible Stylesheet Language (XSL) Extensible Stylesheet Language (XSL)
Unit 4 Representing Web Data: XML
Chapter 7 Representing Web Data: XML
Namespace Review 21-Nov-18.
Namespace Review 29-Dec-18.
Namespace Review 14-Oct-19.
Presentation transcript:

17 Apr 2002 XML Namespaces Andy Clark

The Problem Documents use different vocabularies – Example 1: CD music collection – Example 2: online order transaction Merging multiple documents together – Name collisions can occur Example 1: albums have a Example 2: customers have a – How do you differentiate between the two?

The Solution: Namespaces! What is a namespace? – A syntactic way to differentiate similar names in an XML document Binding namespaces – Uses Uniform Resource Identifier (URI) e.g. “ – Can bind to a named or “default” prefix

Namespace Binding Syntax Use “xmlns” attribute – Named prefix e.g. – Default prefix e.g. Element and attribute names are “qualified” – URI, local part (or “local name”) pair e.g. { “ “foo” }

Example Document (1 of 3) Namespace binding Care and Feeding of Wombats The best book ever written!

Example Document (2 of 3) Namespace scope Care and Feeding of Wombats The best book ever written!

Example Document (3 of 3) Bound elements Care and Feeding of Wombats The best book ever written!

Important Points Namespace “scope” is the element and descendents from point of binding Attributes are not in element’s namespace – Unless implicitly prefixed Can not unbind named prefixes – However, you can unbind default prefix

Using Namespaces with DTDs The problem – DTD syntax does not support namespaces The solution – Use a namespace-aware schema language – Use parameter entity “trick” to add simple namespace support to existing DTDs

Parameter Entity Trick: Step 1 Define parameter entities – Prefix, suffix, and xmlns parameter entity – Xmlns parameter entity

Parameter Entity Trick: Step 2 Define element name parameter entities – One for every element name in grammar

Parameter Entity Trick: Step 3 Modify all element declarations to reference element names by parameter entity

Parameter Entity Trick: Step 4 Declare namespace binding attribute for all possible root elements 12

Add Namespace Information to Existing, Un-prefixed Documents Existing documents gain namespace info Care and Feeding of Wombats

Use New Prefix with Same DTD Redefine prefix, suffix in DTD internal subset <!DOCTYPE a:order SYSTEM ‘grammar.dtd’ [ ]>

Useful Links XML 1.0 Specification – Namespaces in XML Specification – XHTML 1.0 Specification –

XML Namespaces Andy Clark