1 Compound Documents: Combining XML Vocabularies.

Slides:



Advertisements
Similar presentations
Copyright © 2003 Pearson Education, Inc. Slide 5-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide.
Advertisements

Chapter 3: XML Namespaces. Chapter 3 Objectives Why you need namespaces What namespaces are, conceptually and how they solve the problem of naming clashes.
17 Apr 2002 XML Namespaces Andy Clark. The Problem Documents use different vocabularies – Example 1: CD music collection – Example 2: online order transaction.
 Fundamentals of Web Design.  Describe the history and theory of XHTML  Understand the rules for creating valid XHTML documents  Apply a DTD to an.
CSS Statements, media queries, selectors, cascading Web Applications Martin Nečaský Department of Software Engineering, Faculty of Mathematics and Physics,
History Leading to XHTML
1 CP3024 Lecture 9 XML revisited, XSL, XSLT, XPath, XSL Formatting Objects.
Tutorial 9 Working with XHTML
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.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
Creating a Well-Formed Valid Document. 2 Objectives Introducing XHTML Creating a Well-Formed Document Creating a Valid Document Creating an XHTML Document.
Tutorial 11 Creating XML Document
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.
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.
Working with XHTML Creating a Well-Formed Valid Document.
XP Tutorial 9New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
XP The University of Akron Summit College Business Technology Department Computer Information Systems 2440: 140 Internet Tools Instructor: Enoch E. Damson.
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.
XHTML1 Building Document Structure Chapter 2. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML)
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorial 9: Working With XHTML.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
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.
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
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
XSLT Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
XP 1 TUTORIAL 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and.
XP Tutorial 9 1 Working with XHTML. XP SGML 2 Standard Generalized Markup Language (SGML) A standard for specifying markup languages. Large, complex standard.
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
XP New Perspectives on XML, 2nd Edition Tutorial 2 1 TUTORIAL 2 WORKING WITH NAMESPACES.
XML – Part III. The Element … This type of element either has the element content or the mixed content (child element and data) The attributes of the.
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.
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.
XML Basics A brief introduction to XML in general 1XML Basics.
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.
Tutorial 13 Validating Documents with Schemas
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.
XML Schema (W3C) Thanks to Jussi Pohjolainen TAMK University of Applied Sciences.
XP Tutorial 9New Perspectives on HTML and XHTML, Comprehensive 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
Tutorial 2: XML Working with Namespaces. 2 Name Collision This figure shows two documents each with a Name element.
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 14 This presentation © 2004, MacAvon Media Productions XML.
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.
Beginning XML 4th Edition. Chapter 3: XML Namespaces.
Getting Started with CSS
Creating a Well-Formed Valid Document
Tutorial 9 Working with XHTML
Tutorial 9 Working with XHTML
>> Introduction to CSS
WORKING WITH NAMESPACES
Website Design 3
Tutorial 9 Working with XHTML
Namespace Review 21-Nov-18.
Namespace Review 29-Dec-18.
The Internet 10/6/11 Cascading Style Sheets
Namespace Review 14-Oct-19.
New Perspectives on XML
Presentation transcript:

1 Compound Documents: Combining XML Vocabularies

Problems with Name Collision 2 Name collision occurs when elements from different XML vocabularies use the same name within a compound document Name collision is not a problem if you are not concerned with validation. The document content only needs to be well-formed. However, name collision will keep a document from being validated.

3 Namespaces: The Way to Resolve Name Collisions A namespace is a defined collection of element and attribute names. Names that belong to the same namespace must be unique. Elements can share the same name if they reside in different namespaces. To apply namespaces to compound XML documents you must: 1.Declare the namespace 2.Identify which elements in the document belong in the namespace

4 1. Declaring a Namespace Declaring a namespace consists of adding the attribute xmlns to an element as follows: xmlns:prefix=“URI” where URI is a Uniform Resource Identifier that assigns a unique name to the namespace, and prefix is a string of letters that associates each element or attribute in the document with the declared namespace. For example, declares a namespace with the prefix mod and the URI

5 2. Identifying Elements in the Namespace After you declare a namespace, you indicate which elements in the document belong to that namespace by attaching the namespace prefix: content Example: Laser4C (PR205) Printer color laser 320

6 Default Namespaces You can specify a default namespace by omitting the prefix in the namespace declaration. The element containing the namespace attribute and all of its child elements are assumed to be part of the default namespace. Example: Laser4C (PR205) Printer color laser 320

7 Adding Namespace Prefixes to Attributes Attributes, like elements, can become qualified by adding the namespace prefix to the attribute name: … Example: <mod:model xmlns:mod=" mod:id=“123”> This doesn’t happen very often except when an attribute in one namespace is used as an attribute in another namespace.

8 Using Namespaces in a Style Sheet To declare a namespace in a style sheet, you add the following rule to the style sheet prefix “uri”; mod “ Selectors are associated with that namespace using the syntax: prefix|selector {attribute1:value1; …} Example: mod|title {width:150 px}

9 Combining Standard Vocabularies Standard vocabularies may be combined within a single XML document. Some well-known XML vocabularies are:

10 Example 1: Combining XHTML and MathML

11 Example 2: Converting HTML to XHTML