Documentation Center

Load TOC levels XML

Loads the XML representation of the TOC. Because TOC files can be very large, this API call is designed to be able to grab specific sections of the TOC on demand, while not loading other sections. The eid parameter allows the API call to grab a specific section of the TOC, while the levels parameter allows the depth of the returned XML to be shortened for performance. The shorter the depth of the returned XML, the more frequently the client will need to return to the server for more TOC XML. Therefore, a balance between size of XML fragments and frequency of requests needs to be struck, based upon the structure, size, and content of the TOC.

Example API call

/servlets3/wietmsd?id=1460038885460&book=s1000d_bike_41&collection=default&target=toc&action=tree_xml&eid=root&levels=1

Parameters

ParameterDescription
targettoc
actiontree_xml
levelsThe level of depth to load from the point of the targeted TOC element, identified by the eid parameter. If levels is set to 2, then two levels of children elements below the targeted element will be loaded and returned. If levels is not set, the API call will load two levels.
eidThe eid of the TOC element whose children are to be loaded. For example, set this parameter to root or 1 to load the top-level TOC elements.
idA session ID that is valid for this collection and publication combination.
collectionThe name of the collection that the publication is registered in, such as default.
book The name of the publication, such as s1000d_bike_41.

Returns

On success
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="/servlets3/wietmsd/styles/toc.xsl" ?>
<TOC_ROOT EID="1" LASTEID="945" xmlns:xlink="http://www.w3.org/1999/xlink">
    <SYSTEM EID="2" LASTEID="3" ROOT="1" TOP="1">
        <TITLE EID="3">Bike 4.1</TITLE>
    </SYSTEM>
    <SYSTEM EID="791" LASTEID="792" ROOT="1" TOP="1">
        <TITLE EID="792">Lighting</TITLE>
    </SYSTEM>
    <SYSTEM APPENDIX="1" EID="841" LASTEID="842" ROOT="1" TOP="1">
        <TITLE EID="842">No title for this system</TITLE>
    </SYSTEM>
</TOC_ROOT>
On failure
Appropriate error message.
<ERROR>
  <MESSAGE>Failed to find TOC node.</MESSAGE>
</ERROR>