Table of contentsAppendices |
3 Attributexml:base AttributeThe attribute xml:base Must, May, etc. be inserted in XML documents to specify a base URI other than the base URI of the document or external entity. The value of this attribute is interpreted as a URI Reference as defined in RFC 2396 [RFC2396], after processing according to Section 3.1. In namespace-aware XML processors, the "xml" prefix is bound to the namespace
name An example of xml:base in a simple document containing XLinks follows. XLink normatively references XML Base for interpretation of relative URI references in xlink:href attributes. <?xml version="1.0"?>
<doc xml:base="http://example.org/today/"
xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<title>Virtual Library</title>
</head>
<body>
<paragraph>See <link xlink:type="simple" xlink:href="new.xml">what's
new</link>!</paragraph>
<paragraph>Check out the hot picks of the day!</paragraph>
<olist xml:base="/hotpicks/">
<item>
<link xlink:type="simple" xlink:href="pick1.xml">Hot Pick #1</link>
</item>
<item>
<link xlink:type="simple" xlink:href="pick2.xml">Hot Pick #2</link>
</item>
<item>
<link xlink:type="simple" xlink:href="pick3.xml">Hot Pick #3</link>
</item>
</olist>
</body>
</doc>
The URIs in this example resolve to full URIs as follows:
|