Skip to content

Instantly share code, notes, and snippets.

@mamund
Last active December 17, 2015 01:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mamund/5526106 to your computer and use it in GitHub Desktop.
Save mamund/5526106 to your computer and use it in GitHub Desktop.
<!--
Date: 2013-05-06
Author: @mamund
Note: Some ways to determine when a URI has an associated resolver and whether it SHOULD be resolvable.
-->
<root>
<scheme>
<!-- the scheme portion of the URI can indicate which (if any) resolver should be used -->
<example>
<link value="tel:+1.123.456.7890" />
<see href="http://tools.ietf.org/html/rfc3966"/>
</example>
<example>
<link value="URN:mamund:q1w2e3r4t5y" />
<see href="http://tools.ietf.org/html/rfc2141" />
</example>
<example>
<link value="http://server.org.home"/>
<see href="http://tools.ietf.org/html/rfc1738" />
</example>
</scheme>
<media-type>
<!-- the media-type design can also be used to indicate whether the receiver should treat the URI as resolvable -->
<example>
<!-- this URI is resolvable and should be treated as a navigation -->
<html:a href="..." />home</a>
<see href="http://www.w3.org/html/wg/drafts/html/master/links.html#attr-hyperlink-href" /.>
</example>
<example>
<!-- this URI is resolvable and should be treated as a transclusion -->
<html:img src="..." />
<see href="http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#attr-img-src" />
</example>
<example>
<!-- the value of the "rel" attribute is a URI and SHOULD NOT (see RFC5988) be resolved -->
<link rel="http://mamund.com/names/rolfnagle" ... />
<see href="http://www.w3.org/html/wg/drafts/html/master/links.html#attr-hyperlink-rel" />
<see href="http://tools.ietf.org/html/rfc5988#section-4.2" />
</example>
<example>
<!-- media types can define their own elements, attributes, properties that indicate whether clients
MUST|SHOULD|MAY treat the URI as resolvable. For example:
"In responses received from the server, clients MUST NOT attempt to resolve the URIs contained in
ID, NAME, and URI attributes. Clients MAY attempt to resolve values found in HREF, SRC, TARGET,
and URL attributes"
-->
<customer id="http://names.example.org/id/01928387465">
<detail-record href="http://example.org/customers/a">View Details</detail-record>
<logo src="http://example.org/logos/a" />
<voice-phone src="tel:+1.123.456.7890">Call Me</voice-phone>
<home-page href="http://big-customer.com">View Home Page</home-page>
<copy-to-local-storage target="http://your.server.org/">Copy Customer</copy-to-local-storage>
<contact-person uri="http://contacts.example.org/id/qawsedrftgy">
<detail-record href="http://example.org/contacts/z1x2c3">View Contact</detail-record>
<email url="mail:this-customer@their-server.org">Email Contact</email>
</contact-person>
<customer>
</example>
</media-type>
</root>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment