Mercurial > hg > ltpda
view m-toolbox/html_help/help/read_item.m @ 4:e3c5468b1bfe database-connection-manager
Integrate with LTPDAPreferences
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Mon, 05 Dec 2011 16:20:06 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
function read_item(ch, fd) % Reads each item in the TOC and makes a nested html list. % % M Hewitson 24-07-07 % % $Id: read_item.m,v 1.2 2007/08/14 09:23:01 ingo Exp $ % children = ch.getChildNodes; % Go through children of AO object for j=1:children.getLength ch = children.item(j-1); if ch.getNodeType ~= ch.COMMENT_NODE childs = ch.getChildNodes; nodeName = char(ch.getNodeName); txtcon = deblank(char(ch.getTextContent)); if childs.getLength >= 1 fprintf(fd, '<ul>\n'); read_item(ch, fd); fprintf(fd, '</ul>\n'); elseif ~isempty(txtcon) % check if this node has a target attribute p = ch.getParentNode; att = p.getAttributes; if ~isempty(att) target = deblank(char(att.getNamedItem('target'))); if ~isempty(target) fprintf(fd, '<li><a %s>%s</a></li>\n', strrep(target, 'target', 'href'), txtcon); else fprintf(fd, '<li>%s</li>\n', txtcon); end else fprintf(fd, '<li>%s</li>\n', txtcon); end else end end end