Tutorial.02

Tutorial.02 - TUTORIAL 2 XP WORKING WITH NAMESPACES New...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
New Perspectives on XML, 2nd Edition Tutorial 2 1 XP TUTORIAL 2 WORKING WITH NAMESPACES
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
New Perspectives on XML, 2nd Edition Tutorial 2 2 XP COMBINING XML VOCABULARIES A document that combines several vocabularies is known as a compound document
Background image of page 2
New Perspectives on XML, 2nd Edition Tutorial 2 3 XP WORKING WITH NAMESPACES Name collision occurs when elements from two or more documents share the same name. 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.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
New Perspectives on XML, 2nd Edition Tutorial 2 4 XP NAME COLLISION This figure shows name collision
Background image of page 4
New Perspectives on XML, 2nd Edition Tutorial 2 5 XP DECLARING A NAMESPACE 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. Namespaces must be declared before they can be used.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
New Perspectives on XML, 2nd Edition Tutorial 2 6 XP DECLARING A NAMESPACE A namespace can be declared in the prolog or as an element attribute. The syntax for an attribute used to declare a namespace in the prolog is: 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.
Background image of page 6
New Perspectives on XML, 2nd Edition Tutorial 2 7 XP DECLARING A NAMESPACE For example, <mode1 xmlns:mod=http://jacksonelect.com/models>> Declares a namespace with the prefix “mod” and the URI http://jacksonelect.com/models The URI is not a Web address. A URI identifies a physical or an abstract resource.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
New Perspectives on XML, 2nd Edition Tutorial 2 8 XP URIs, URLs, AND URNs A physical resource is a resource one can access and work with such as a file, a Web page, or an e- mail address. A URL is one type of URI. An abstract resource is one that doesn’t have any physical existence, the URI is used as an identifier or an ID.
Background image of page 8
Tutorial 2 9 XP URIs, URLs, AND URNs A proposed type of URI is the URN or Universal Resource Name. A URN is a persistent resource identifier, meaning the user need only know the name of a resource. An agency would then retrieve a copy of the resource independent of its location. URNs take the form:
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 33

Tutorial.02 - TUTORIAL 2 XP WORKING WITH NAMESPACES New...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online