File Format

HyperScope will work with any OPML documents. In order to view your documents under the HyperScope, all you have to do is transform your documents into OPML and put a link in your OPML to the stylesheet specified below.

HyperScope also uses some optional but useful attributes defined under the http://hyperscope.org/hyperscope/opml/public/2006/05/09 namespace:

OPML element HyperScope attribute Description
opml version We're at 1.0.
head nidCount The last node ID used in the document.
head, outline left-label-delim You can define label delimiters for every node, or on a node-by-node basis. These delimiters are characters that delimit the label in the node's content. If not set, the delimiter defaults to null or whitespace. For example, if the left-label-delim is unset, the right-label-delim is set to :, and the node's content is TODO: Wash car, then the node's label is TODO.
head, outline right-label-delim See the description for left-label-delim above.
outline createdOn The date on which the node was created. Must conform to the date and time specification in RFC822.
outline nid Node identifier. The node identifier is always preceded by a 0. NIDs must be unique to a node in a document, and once assigned, must always stay with that node. In other words, they are persistent and immutable.

Note About Purple Numbers: The purple numbers displayed by default in HyperScope-enabled documents are generated on the fly at browsing time based on relative indentation of the <outline> tag. In the example below, the first will be assigned 1, the next will be 1A, the next will be 2, and so on.

xml-stylesheet Hack

Because HyperScope is client-side JavaScript, we must have a way of packaging the JavaScript with an OPML document. Browsers have semantics defined for doing with HTML, but not XML. To get around this, we use a hack. At the beginning of the document, you define an xml-stylesheet directive that points to hyperscope.xsl (included as part of the HyperScope package):

  <?xml-stylesheet type="text/xsl" href="hyperscope.xsl"?>

The stylesheet transforms the OPML into HTML with a link to some JavaScript bootstrapping code that loads the HyperScope software, then retrieves the OPML file a second time for parsing.

Example

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="hyperscope.xsl"?>
<opml xmlns:hs="http://hyperscope.org/hyperscope/opml/public/2006/05/09" hs:version="1.0" version="2.0">
   <head hs:left-label-delim="" hs:right-label-delim="" hs:nidCount="3">
      <ownerName>Eugene Eric Kim</ownerName>
      <dateCreated>Wed 19 Jul 2006 06:44:27 GMT</dateCreated>
      <dateModified>Wed 26 Jul 2006 00:17:25 GMT</dateModified>
   </head>
   <body>
      <outline hs:createdOn="Wed 19 Jul 2006 06:44:27 GMT" hs:label="First" hs:nid="01" text="First paragraph.">
         <outline hs:createdOn="Wed 26 Jul 2006 00:17:25 GMT" hs:nid="03" text="First subparagraph."/>
      </outline>
      <outline hs:createdOn="Wed 19 Jul 2006 06:49:27 GMT" hs:nid="02" text="Second paragraph"/>
   </body>
</opml>