[xhtml]

Namespaces, Trees and Infosets, Base URI's, and Modular Documents

R. Alexander Milowski

milowski at sims.berkeley.edu

#1

Overview

#2

Namespace Declarations have Scope

#3

How it Works - An Example

The simplest thing is to default the namespace:

<order xmlns="urn:publicid:IDN+cde.berkeley.edu:example:order:en">
  <from>me</from>
  <to>you</to>
  <items>
    <item>A clue</item>
    <item>A better clue!</item>
  </items>
  <memo>
    <p>I need this order now!</p>
  </memo>
</order>

#4

How it Works - An Example - Part 2

But we can use a prefix and get the exact same names:

<o:order xmlns:o="urn:publicid:IDN+cde.berkeley.edu:example:order:en">
  <o:from>me</o:from>
  <o:to>you</o:to>
  <o:items>
    <o:item>A clue</o:item>
    <o:item>A better clue!</o:item>
  </o:items>
  <o:memo>
    <p>I need this order now!</p>
  </o:memo>
</o:order>

#5

How it Works - An Example - Part 3

If we change that prefix binding later on, we'll get different names:

<o:order xmlns:o="urn:publicid:IDN+cde.berkeley.edu:example:order:en">
  <o:from>me</o:from>
  <o:to>you</o:to>
  <o:items xmlns:o="urn:publicid:IDN+cde.berkeley.edu:example:order:items:en">
    <o:item>A clue</o:item>
    <o:item>A better clue!</o:item>
  </o:items>
  <o:memo>
    <p>I need this order now!</p>
  </o:memo>
</o:order>

#6

How it Works - An Example - Part 4

We can also mix in a default if we wish:

<o:order xmlns:o="urn:publicid:IDN+cde.berkeley.edu:example:order:en">
  <o:from>me</o:from>
  <o:to>you</o:to>
  <o:items xmlns:o="urn:publicid:IDN+cde.berkeley.edu:example:order:items:en">
    <o:item>A clue</o:item>
    <o:item>A better clue!</o:item>
  </o:items>
  <o:memo xmlns="http://www.w3.org/1999/xhtml">
    <p>I need this order now!</p>
  </o:memo>
</o:order>

#7

Syntax vs. Resolved Names

#8

Syntax vs. Resolved Names

#9

What is XML to an Application?

#10

Information Sets (infosets)

#11

The XML Infoset

#12

An Example Infoset

Figure 2. Figure

<?xml version="1.0">

<doc><title>My Document</title>

<body><p>something</p>
</body><citations/></doc>

#13

Document Info Item

#14

Element Info Item

#15

Namespace Info Item

#16

In-Scope Namespaces

#17

Attribute Info Item

#18

Character Info Item

#19

There's More...

#20

Information Sets are Extensible

#21

The Base URI

#22

Unknown Base URI

#23

IETF RFC 2398

#24

xml:base Attribute

#25

Interpreting Values

#26

Modular Content

#27

XInclude

#28

Including External Content

#29

Try this at home!

#30

Including Internal Content

#31

Inclusion Chains