Mercurial > hg > ltpda
comparison m-toolbox/html_help/help/convertTOC.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 function convertTOC() | |
2 | |
3 % This builds an html version of the TOC.XML file for use in on-line | |
4 % viewing. | |
5 % | |
6 % M Hewitson 24-07-07 | |
7 % | |
8 % $Id: convertTOC.m,v 1.1 2007/07/24 08:15:06 hewitson Exp $ | |
9 % | |
10 | |
11 disp('------------------') | |
12 | |
13 outfile = 'helptoc.html'; | |
14 xmlfile = 'helptoc.xml'; | |
15 | |
16 % Read in XML | |
17 xdoc = xmlread(xmlfile); | |
18 | |
19 ain = xdoc.getElementsByTagName('toc'); | |
20 a = ain.item(0); | |
21 | |
22 children = a.getChildNodes; | |
23 | |
24 % Write header | |
25 runcmd('cat header.html >', outfile); | |
26 | |
27 % Write content | |
28 fd = fopen(outfile, 'a+'); | |
29 | |
30 read_item(a, fd); | |
31 | |
32 fclose(fd) | |
33 | |
34 | |
35 % Write tail | |
36 runcmd('cat tail.html >>', outfile); | |
37 | |
38 | |
39 disp('------------------') | |
40 |