Natures

While a human may be able to read the explanatory text in order to figure out which links point to schemas and which links point to stylesheets, software needs somewhat more formal hints to ensure that a validator doesn't try to validate a document against a stylesheet or that a browser doesn't try to format a document as described by a DTD. To this end, the xlink:role attribute may contain a URL that indicates the nature of the resource likely to be found at the other end of the simple link. For example, this rddl:resource element locates a W3C XML Schema Language schema:

 <rddl:resource xlink:type="simple"    xlink:href="http://developer.megabank.com/xml/mbsml.xsd"    xlink:role="http://www.w3.org/2001/XMLSchema" /> 

This rddl:resource element locates a DTD:

 <rddl:resource xlink:type="simple"    xlink:href="http://developer.megabank.com/xml/mbsml.dtd"    xlink:role="http://www.isi.edu/in- notes/iana/assignments/media-types/application/xml-dtd" /> 

This rddl:resource element locates a CSS stylesheet:

 <rddl:resource xlink:type="simple"    xlink:href="http://developer.megabank.com/xml/mbsml.xsd"    xlink:role="http://www.isi.edu/in -notes/iana/assignments/media-types/text/css" /> 

As in these examples, most nature URIs are derived from either XML namespace URLs or MIME media type URLs. The RDDL specification currently defines the 22 roles listed in Table 42-1. However, new ones are added regularly; you are free to invent and use your own. Most software will silently ignore any rddl:resource elements with unfamiliar natures.

Table 42-1. RDDL Natures

URI

Nature

http://www.isi.edu/in-notes/iana/assignments/media-types/text/css

CSS stylesheet

http://www.isi.edu/in-notes/iana/assignments/media-types/application/xml-dtd

DTD

http://www.rddl.org/natures#mailbox

Mailbox

http://www.w3.org/TR/html4/

HTML 4 document

http://www.w3.org/TR/html4/strict

Strict HTML 4 document

http://www.w3.org/TR/html4/transitional

HTML 4 transitional document

http://www.w3.org/TR/html4/frameset

HTML 4 Frameset document

http://www.w3.org/1999/xhtml

XHTML document

http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict

XHTML 1.0 strict document

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional

XHTML 1.0 transitional document

http://www.w3.org/2000/01/rdf-schema#

Resource Description Framework Schema [a]

http://www.w3.org/2000/10/XMLSchema

XML Schema module

http://www.xml.gr.jp/relax

RELAX schema [b]

http://www.xml.gr.jp/xmlns/relaxCore

RELAX core grammar

http://www.xml.gr.jp/xmlns/relaxNamespace

RELAX namespace grammar

http://www.ascc.net/xml/schematron

Schematron schema

http://www.rddl.org/natures#SOCAT

An OASIS Open Catalog [c]

http://www.w3.org/TR/REC-xml.html#dt-chardata

XML character data

http://www.w3.org/TR/REC-xml.html#dt-escape

Escaped XML text

http://www.w3.org/TR/REC-xml.html#dt-unparsed

Unparsed binary data

http://www.ietf.org/rfc/rfc2026.txt

An IETF RFC

http://www.iso.ch/

An ISO standard

[a] Not the same thing as a W3C XML Schema Language schema.

[b] RELAX is a precursor to RELAX NG. A RELAX NG nature is a likely candidate for the future.

[c] See Item 47.



Effective XML. 50 Specific Ways to Improve Your XML
Effective XML: 50 Specific Ways to Improve Your XML
ISBN: 0321150406
EAN: 2147483647
Year: 2002
Pages: 144

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net