The Purpose of XML Namespaces

Slides:



Advertisements
Similar presentations
XML-XSL Introduction SHIJU RAJAN SHIJU RAJAN Outline Brief Overview Brief Overview What is XML? What is XML? Well Formed XML Well Formed XML Tag Name.
Advertisements

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.
XML Namespaces Each schema file associated with a URL to uniquely identify where elements come from – Like packages in Java
An Introduction to XML Based on the W3C XML Recommendations.
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
CS 898N – Advanced World Wide Web Technologies Lecture 21: XML Chin-Chih Chang
XHTML1 Building Document Structure. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML) documents.
XML Namespaces Andrey Smirnov CSCI 7818 September 21, 2000.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic XML.
Unit 4 – XML Schema XML - Level I Basic.
Jennifer Widom XML Data XML Schema. Jennifer Widom XML Schema “Valid” XML Adheres to basic structural requirements  Also adheres to content-specific.
1 understanding xml namespaces. 2 understanding namespaces Namespaces are the source of much confusion in XML, especially for those new to the technology.
Introducing HTML & XHTML:. Goals  Understand hyperlinking  Understand how tags are formed and used.  Understand HTML as a markup language  Understand.
ECA 228 Internet/Intranet Design I Intro to XML. ECA 228 Internet/Intranet Design I HTML markup language very loose standards browsers adjust for non-standard.
Working with Namespaces Combining XML Vocabularies in a Compound Document.
SDPL 2002Notes 2: Document Instances and Grammars1 2.5 XML Schemas n A quick introduction to XML Schema –W3C Recommendation, May 2, 2001: »XML Schema Part.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
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.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation XML Schema 1 Lecturer.
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
 2008 Pearson Education, Inc. All rights reserved XML and RSS.
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.
XHTML1 Building Document Structure Chapter 2. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML)
These Questions are copied from
 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,
Session IV Chapter 9 – XML Schemas
XML TUTORIAL Portions from w3 schools By Dr. John Abraham.
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
Web Architecture: Extensible Language Tim Berners-Lee, Dan Connolly World Wide Web Consortium 元智資工所 系統實驗室 楊錫謦 1999/9/15.
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.
Accessing Data Using XML CHAPTER NINE Matakuliah: T0063 – Pemrograman Visual Tahun: 2009.
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.
1 Credits Prepared by: Rajendra P. Srivastava Ernst & Young Professor University of Kansas Sponsored by: Ernst & Young, LLP (August 2005) XBRL Module Part.
1 Tutorial 12 Working with Namespaces Combining XML Vocabularies in a Compound Document.
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.
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 –
Unit 3 — Advanced Internet Technologies Lesson 11 — Introduction to XSL.
C Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Introduction to XML Standards.
CIS 228 The Internet 9/20/11 XHTML 1.0. “Quirks” Mode Today, all browsers support standards Compliant pages are displayed similarly There are multiple.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
CHAPTER NINE Accessing Data Using XML. McGraw Hill/Irwin ©2002 by The McGraw-Hill Companies, Inc. All rights reserved Introduction The eXtensible.
PART 1 XML Basics. Slide 2 Why XML Here? You need to understand the basics of XML to do much with Android All of they layout and configuration files are.
1 Extensible Stylesheet Language (XSL) Extensible Stylesheet Language (XSL)
XML Schemas Dr. Awad Khalil Computer Science Department AUC.
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
CIS 228 The Internet 9/20/11 XHTML 1.0.
Tutorial 9 Working with XHTML
XML Related Technologies
Extensible Markup Language XML
WORKING WITH NAMESPACES
eXtensible Markup Language
Extensible Markup Language XML
Database Processing with XML
Introduction to XML Mr. Majed Bouchahma
XML Technologies and Related Applications
Chapter 7 Representing Web Data: XML
Tutorial 9 Working with XHTML
TOSCA Namespaces Explained
Namespace Review 21-Nov-18.
XML Data Introduction, Well-formed XML.
Namespaces.
Introduction to XML Mr. Majed Bouchahma
Namespace Review 29-Dec-18.
eXtensible Markup Language
Quiz Points 2 Rules Raise your hand if you know the question
Namespace Review 14-Oct-19.
New Perspectives on XML
Presentation transcript:

The Purpose of XML Namespaces

Namespace Caveats XML namespaces are the source of criticism and confusion XML namespaces are the source of many myths .NET namespaces and XML namespaces are not the same thing In fact, they have nothing to do with each other

The Problem of Name Ambiguity Names can be ambiguous When we say “Las Vegas” do we mean “Las Vegas, Nevada” or “Las Vegas, New Mexico” How many cities have the name “Springfield”? When we say address, do we mean street address or Internet address Name ambiguity occurs when two XML documents have elements of the same name but with different meanings

The Problem of Name Ambiguity (Example) <?xml version="1.0" encoding="utf-8" ?> <office> <address>123 Oak street</address> <address>121.216.39.3</address> </office> The meaning of <address> differs between the two contexts

The Purpose of XML Namespaces (1) They eliminate name ambiguity in element names between documents Namespaces answer the question “Are we talking about the same thing?” XML namespaces were released about 1 year after XML itself was released They don’t quite work right with DTDs Namespaces are the reason why we don’t use the colon (:) in element names

The Implementation of XML Namespaces (1) XML namespaces use URIs (IRIs) to qualify element names This allows us to use the same element name with a different URI thereby qualifying the element name The URI is just a globally unique name Formally, XML namespaces define a vocabulary or universe of names

Namespaces (Quotable Quotes) What Does a Namespace URL Locate? There is nothing at all at the end of a namespace URI, except perhaps a 404 Not Found error

IT’S JUST A NAME Namespaces (Myths) IT’S NOT NECESSARILY A WEB SITE IT’S NOT A REFERENCE TO A PROGRAM ON THE WEB IT’S NOT A POINTER TO A RESOURCE IT’S JUST A NAME

Applications using XML namespaces XML namespaces are widely used in The Schema Definition Language (XSDL) The Extensible Stylesheet Language (XSL) To describe the schema of an Office 2007 document A .NET DataSet

Namespaces (Illustration) Namespace (vocabulary) XSD Parser Namespace (vocabulary) XSLT Namespace (vocabulary) Other Your document

Characteristics of Namespace URIs You should control the URI that you use or you can’t control the name It can be any URI whether or not the URI exists on the Web Thus, the URI has no relevance URIs are case sensitive URIs are identical only if the strings are identical No %-escaping is done

Characteristics of Namespace URIs (Example) The following URIs ARE different: http://www.example.org/foo http://www.Example.org/foo http://www.example.org/Foo And so are the following: http://www.example.org/~foo http://www.example.org/%7efoo

The XML Namespace Now it should be clear what xml:lang is The prefix xml is always bound to the namespace name http://www.w3.org/XML/1998/namespace OK – this one points to a URI but it does not have to! You can declare this namespace but it is not necessary If declared, you cannot bind xml: to another namespace URI

The Implementation of Namespaces (1) Namespace names are defined through ‘special’ attributes Any attribute starting with the prefix xmlns: is considered a prefix defining attribute The prefix following the attribute is the local abbreviation for the namespace The prefix name has no relevance although there are common naming conventions The attribute value is a unique URI

The Implementation of Namespaces (Example 1) The following shows three namespace declarations The prefix off is associated with the namespace http://coba.unr.edu/faculty/ekedahl/office <off:office xmlns:off="http://coba.unr.edu/faculty/ekedahl/office" xmlns:phys="http://coba.unr.edu/faculty/ekedahl/physical" xmlns:net="http://coba.unr.edu/faculty/ekedahl/network"> </off:office> Qualified name <off/office>

Applying Namespaces to Attributes Attributes can apply to a namespace The default namespace does NOT apply to attribute names