title |
|
Now we lay out some template slots that the bib data will be plugged into. This requires some extra explanation, I think.
First, we need to mark the containing element ('''' here) in some way so that we can find it. We do this by giving it a non-standard ''type'' attribute with a value of ''opac/slot-data-marcxml''. This attribute is used in two ways. First, ''opac/slot-data'' says that this element will be used as a place to deposit data needed for constructing this "opac". Second, ''+marcxml'' tells the query processor that it should use the ''marcxml'' form of the bibliographic record. Other formats would include ''marcxml-full'' (which includes holdings information), ''mods'', ''oai_dc'' and other formats supported by the Evergreen unAPI service.
Next we need to tell the query processor what to extract from the XML returned by the unapi service. We add a ''query'' attribute to the container element and set its value to the [[http://www.dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dijit-and-dojo/selecting-dom-nodes-dojo-query|dojo.query()]] we need to find the relevant data in the format selected by the ''type'' attribute.
Finally, we may need to format the data in some special way. We do this by providing a chunk of Javascript that knows how to take the output of the ''dojo.query()'' call, one node at a time, and do something special with it. Each node is run through this code, and the return values for all nodes passing through this code are joined with a space and used to replace the HTML content of the containing element.
Two things to note about this ''
|
Here we see that by selecting nodes in the middle of the DOM tree ('''' sits between '''' and '''' in ''marcxml'') we can process groups of values together, allowing richer rendering and interpretation of entire sections of information instead of simple, discrete data.
items |
|