AxsJAX Content Navigation Rules (CNR) Reference

Table of Contents

1 Introduction

Think of a content rich site as a site with many trails through it. In each trail, there is content. You can greatly improve the usability of a busy pages by providing efficient keyboard navigation to move through these trails. This can be a more effective approach than providing section headings alone as it allows for grouping related content, filtering out content that is not relevant to what the user is immediately interested in, and controlling the granularity of each item in a given trail. The content navigation rule (CNR) system in AxsNav allows you to easily define these trails.

The CNR system is designed to handle cases where not all of the content is present. If a trail that you have defined happens to have no items, then for that instance, the CNR system will discard that trail. Therefore, when you write CNRs, you should do it for the case where all of the content is present.

To make it easier for users to discover the keyboard navigation commands for the page, the CNR system can automatically generate a help string with all the possible commands. This help generation mechanism takes the user's current position into account - it will only report actions that can be done from the present state. Here is some sample code for generating and speaking the help string:

 var helpStr = "The following shortcut keys are available: " +
               axsNavObj.localHelpString() +
               axsNavObj.globalHelpString();
 axsJAXObj.speakTextViaNode(helpStr);

2 Data Types

2.1 KEY

Any character that is letter, number, or punctuation found on the keyboard OR a string that is "LEFT", "DOWN", "UP", "RIGHT", "ENTER", "PGUP", "PGDOWN". Note that the case of the letter will matter - if you only assign "a" to do something, pressing "A" will not cause that to happen.

2.2 STRING

An arbitrary string of text

2.3 ACTION

A string that specifies what action should take place when the AxsNav system navigates to something. If no acceptable action is specified, the default action will take place.

2.4 INTEGER

An integer

2.5 TRIGGER

A string that specifies what trigger should cause the AxsNav system to click on a target.

3 CNR Elements

3.1 cnr

This is the root level element of the CNR file. The cnr element can contain lists and targets.

3.2 list

This is a child element of the cnr element. A list is a trail that the user can go through on the page. Lists can contain items and targets.

3.3 item

This is a child element of the list element. The item element is an xpath expression that returns a set of nodes which belong in the list. If a list has more than one item element, the set of nodes that will be in the list is the union of all the sets of nodes returned by the xpaths of all the item elements.

3.4 target

This is a child element of the cnr and list elements. The target element is an xpath expression that returns the node that should be clicked. Note that targets in a list can be relative to the items in that list. Thus having:

 <item>
  //p[@class='g']
 </item>
 <target title='Open result' hotkey='ENTER'>
   ./span[@class='w']
 </target>
means that if the user is currently on
 getNodesWithXPath("//p[@class='g']")[2]
then the element that will be clicked when the user presses Enter is
 getNodesWithXPath("//p[@class='g']/span[@class='w']")[2]

Author: T.V. Raman, Charles L. Chen <raman@google.com, clchen@google.com>

Date: 2008/06/09 11:27:59