File: xml.pike

package info (click to toggle)
pike7 7.0.361-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 14,876 kB
  • ctags: 12,334
  • sloc: ansic: 142,667; makefile: 1,526; sh: 1,035; lisp: 290; sed: 34; perl: 3
file content (32 lines) | stat: -rw-r--r-- 708 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "types.h"
#if __VERSION__ >= 0.6
import ".";
#endif /* __VERSION__ >= 0.6 */
inherit Stdio.File : out;


void output(string base, WMML data)
{
  SGML newdata=({
    Sgml.Tag("wmml",([]),0,
	     ({
	       /* FIXME:
		* add toc, index_data and links
		*/
	       "\n",
	       Sgml.Tag("metadata",([]),0,data->metadata),"\n",
	       Sgml.Tag("data",([]),0,data->data),"\n",
	     }))
  });
  Stdio.File(base+".xml","wct")->write(XML.generate(newdata));
}

Sgml.Tag illustration(object o,void|mapping options)
{
  return Sgml.Tag("image",(["src":Gfx.mkgif(o,options)]),0);
}

Sgml.Tag illustration_jpeg(object o,void|mapping options)
{
  return Sgml.Tag("image",(["src":Gfx.mkjpg(o,options)]),0);
}