Www.monash.edu.au CSE3201 XML Namespace. www.monash.edu.au 2 What is a namespace? An XML namespace is a collection of element type and attribute names.

Slides:



Advertisements
Similar presentations
XML Schema Heewon Lee. Contents 1. Introduction 2. Concepts 3. Example 4. Conclusion.
Advertisements

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 Namespaces Andy Clark. The Problem Documents use different vocabularies – Example 1: CD music collection – Example 2: online order transaction.
1 Hide (Localize) Namespaces versus Expose Namespaces XML Schemas: Best Practices A set of guidelines for designing XML Schemas Created by discussions.
XML Namespaces Each schema file associated with a URL to uniquely identify where elements come from – Like packages in Java
XML Namespaces Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
XML Name spaces. Different people may invent similar tag names Here is an XML element describing a piece of furniture: table99 dining table Here.
XML Schemas Lecture 10, 07/10/02. Acknowledgements A great portion of this presentation has been borrowed from Roger Costello’s excellent presentation.
XML Namespaces Andrey Smirnov CSCI 7818 September 21, 2000.
DECO 3002 Advanced Technology Integrated Design Computing Studio Tutorial 6 – XML Schema School of Architecture, Design Science and Planning Faculty of.
XP New Perspectives on XML, 2nd Edition Tutorial 2 1 TUTORIAL 2 WORKING WITH NAMESPACES.
Unit 4 – XML Schema XML - Level I Basic.
Introduction to XML This material is based heavily on the tutorial by the same name at
1 understanding xml namespaces. 2 understanding namespaces Namespaces are the source of much confusion in XML, especially for those new to the technology.
ACG 4401 XML Schemas XML Namespaces XLink. + The XML Foundation Many participants – an extended family! XML Instance documents – carry data in context.
ACG 4401 XML Schemas XML Namespaces XMLink. + The XML Foundation Many participants – an extended family! XML Instance documents – carry data in context.
Processing of structured documents Spring 2003, Part 3 Helena Ahonen-Myka.
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.
1 XML Schemas. 2 Useful Links Schema tutorial links:
Neminath Simmachandran
XML Language Family Detailed Examples Most information contained in these slide comes from: These slides are intended.
An Introduction to XML Presented by Scott Nemec at the UniForum Chicago meeting on 7/25/2006.
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.
What is XML?  XML stands for EXtensible Markup Language  XML is a markup language much like HTML  XML was designed to carry data, not to display data.
Session IV Chapter 9 – XML Schemas
1 Dr Alexiei Dingli XML Technologies XML Advanced.
1 herbert van de sompel CS 502 Computing Methods for Digital Libraries Cornell University – Computer Science Herbert Van de Sompel
Default Namespace - targetNamespace or XMLSchema? XML Schemas: Best Practices A set of guidelines for designing XML Schemas Created by discussions on xml-dev.
IVOA Registry videocon 2004/05/13-14 Gerard Lemson1 Model based schema.
Beginning XML 4th Edition. Chapter 5: XML Schemas.
New Perspectives on XML, 2nd Edition
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.
XML Schema. Why Schema? To define a class of XML documents Serve same purpose as DTD “Instance document" used for XML document conforming to schema.
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.
ACG 4401 XML Schemas XML Namespaces XLink. + The XML Foundation Many participants – an extended family! XML Instance documents – carry data in context.
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.
1 Tutorial 12 Working with Namespaces Combining XML Vocabularies in a Compound Document.
Processing of structured documents Spring 2003, Part 3 Helena Ahonen-Myka.
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.
1 Compound Documents: Combining XML Vocabularies.
XML Schema Definition (XSD). Definition of a Schema It is a model for describing the structure and content of data The XML Schema was developed as a content.
Friday, September 4 th, 2009 The Systems Group at ETH Zurich XML and Databases Exercise Session 5 courtesy of Ghislain Fourny/ETH © Department of Computer.
Tutorial 2: XML Working with Namespaces. 2 Name Collision This figure shows two documents each with a Name element.
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,
ACG 6415 XML Schemas XML Namespaces XMLink. The XML Foundation  Many participants – an extended family! XML documents – carry data in context  Each.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
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.
XML Namespaces In this first lesson XML Namespaces, you will learn to:
1 Extensible Stylesheet Language (XSL) Extensible Stylesheet Language (XSL)
CITA 330 Section 4 XML Schema. XML Schema (XSD) An alternative industry standard for defining XML dialects More expressive than DTD Using XML syntax Promoting.
1 XML and XML in DLESE Katy Ginger November 2003.
The Purpose of XML Namespaces
ACG 4401 XML Schemas XML Namespaces XLink.
ACG 4401 XML Schemas XML Namespaces XLink.
XML QUESTIONS AND ANSWERS
Namespace Review 21-Nov-18.
Namespaces.
Namespace Review 29-Dec-18.
CMP 051 XML Introduction Session IV Chapter 12 – XML Namespaces
Quiz Points 2 Rules Raise your hand if you know the question
CMP 051 XML Introduction Session IV Chapter 12 – XML Namespaces
Namespace Review 14-Oct-19.
New Perspectives on XML
Presentation transcript:

CSE3201 XML Namespace

2 What is a namespace? An XML namespace is a collection of element type and attribute names. It defines a way to distinguish between duplicate element type and attribute names.

3 Example Dandenong Rd Caulfield East Victoria Australia 3145 aWebServer

4 Example Computer Science Dandenong Rd Caulfield East Victoria Australia aWebServer

5 The Purpose of Namespace Combine fragments from different document without naming conflict. Write reusable code modules that can be invoked for specific elements and attributes. Universally unique names guarantee that such modules are invoked only for the correct elements and attributes. Define elements and attributes that can be re-used in a number of different schema or instance document without naming conflict XML Namespace FAQ (

6 Declaring a Namespace A namespace is declared using the xmlns attribute. The value of the attribute is the name of the namespace being declared. Default namespace xmlns=URI or URL Target namespace xmlns:prefix=URI or URL Namespace can be used in XML instance, DTD, Schema, XSLT.

7 Namespace in XML Schema <schema xmlns=“ xlmns:addr=“ targetNamespace:=“ elementFormDefault=“unqualified” attributeFormDefault=“unqualified”>

8 XML Instance <adept:department xsi:schemaLocation=" file:namespaceUnqualified.xsd" xmlns:adept=" xmlns:xsi=" CSSE 900 Dandenong Rd Caulfield East Victoria Australia The prefix “adept” is applied only to the global element as the schema is declared with unqualified elements and attributes.

9 Qualified Elements/Attributes <schema xmlns=“ xlmns:addr=“ targetNamespace:=“ elementFormDefault=“qualified” attributeFormDefault=“unqualified”>

10 Qualified – XML Instance Explicit used of namespace. <adept:department xsi:schemaLocation=" file:namespaceQualified.xsd" xmlns:adept=" xmlns:xsi=" Computer Science 900 Dandenong Rd Caulfield East Victoria Australia

11 Qualified – XML Instance Implicit used of namespace => default namespace <department xsi:schemaLocation=" file:namespaceQualified.xsd" xmlns=" xmlns:xsi=" CSSE 900 Dandenong Rd Caulfield East Victoria Australia

12 Multiple Schemas It is sometime desirable to divide the schema into a number of small parts when a schema is large. The division will help: –Maintenance –Readability –Access control

13 Include Two or more schemas from the same namespace can be combined using the include declaration. All the included parts of the schema have to declared with the same target namespace.

14 Examples Check the bottom.xsd, department.xsd, server.xsd and faculty.xsd.

15 Import The import declaration can be used to combine two or more schemas from different namespaces. Only global elements and named Types can be imported.

16 Example See the newFaculty.xsd