1
/* $Id: generate_xml.cpp,v 1.5 1999/10/20 10:24:55 kulow Exp $
3
* This file is part of MIFParse, a MIF parser for Unix.
5
* Copyright (C) 1998 by Matthias Kalle Dalheimer <kalle@dalheimer.de>
8
#include "generate_xml.h"
9
#include "generate_xml_textflow.h"
10
#include "generate_xml_document.h"
16
unsigned int indent = 0;
18
void generate_xml( const char* outfile )
20
xmloutstr.open( outfile );
21
if( !xmloutstr.is_open() ) {
22
cerr << "Could not open outfile " << outfile << '\n';
26
xmloutstr << "<?xml version=\"1.0\"?>\n";
27
xmloutstr << "<DOC author=\"Kalle Dalheimer\" email=\"kalle@kde.org\" editor=\"KWord/MIF-Filter\" mime=\"application/x-kword\">" << endl;
28
// PENDING(kalle) Don't hard-code those values
30
xmloutstr << " <PAPER format=\"1\" width=\"";
31
xmloutstr << point2mm( generate_xml_document::paperWidth() );
32
xmloutstr << "\" height=\"";
33
xmloutstr << point2mm( generate_xml_document::paperHeight() );
34
xmloutstr << "\" orientation=\"0\" columns=\"1\" columnspacing=\"3\">" << endl;
35
xmloutstr << " </PAPER>";
36
xmloutstr << " <ATTRIBUTES processing=\"1\" standardpage=\"1\"/>"
40
// write out framesets tag
41
xmloutstr << " <FRAMESETS>" << endl;
43
// Traverse all text flow elements
44
QListIterator<TextFlow> tfi( textflows );
45
TextFlow* tf = tfi.current();
48
generate_xml_textflow::generate( tf );
52
// write out /framesets tag
53
xmloutstr << " </FRAMESETS>" << endl;
55
xmloutstr << "</DOC>";