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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Example Documentation</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.15 -->
<center>
<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="examples.html">Examples</a> </center>
<hr><h1>XSLTProc.cpp</h1>
<p>
XSLTProc program; a simple clone of libxslt's xsltproc. Binary should be installed as sp-gxmlcpp-xsltproc.
<p>
<div class="fragment"><pre><font class="comment">// $Id: XSLTProc.cpp,v 1.4 2003/01/30 12:38:31 spabsurd Exp $</font>
<font class="comment">// STDC++</font>
<font class="preprocessor">#include <iostream></font>
<font class="preprocessor">#include <cassert></font>
<font class="comment">// C libraries</font>
<font class="preprocessor">#include <libexslt/exslt.h></font> <font class="comment">// Needed to enable exslt</font>
<font class="comment">// Local</font>
<font class="preprocessor">#include <<a class="code" href="XMLTree_8hpp.html">sp-gxmlcpp/XMLTree.hpp</a>></font>
<font class="preprocessor">#include <<a class="code" href="XMLDump_8hpp.html">sp-gxmlcpp/XMLDump.hpp</a>></font>
<font class="preprocessor">#include <<a class="code" href="XSLTrans_8hpp.html">sp-gxmlcpp/XSLTrans.hpp</a>></font>
<font class="keywordtype">int</font> main(<font class="keywordtype">int</font> argc, <font class="keywordtype">char</font>** argv)
{
<font class="comment">// Support for exslt</font>
exsltRegisterAll();
<font class="keywordflow">if</font> (argc < 3)
{
std::cerr << <font class="stringliteral">"Usage: "</font> << argv[0] << <font class="stringliteral">" XSL-FILE XML-FILE"</font> << std::endl;
exit(1);
}
std::ifstream xslFile(argv[1], std::ios::in);
assert(xslFile.is_open());
std::ifstream xmlFile(argv[2], std::ios::in);
assert(xmlFile.is_open());
SP::GXML::XSLTrans trans(xslFile);
SP::GXML::XMLTree tree(xmlFile);
std::auto_ptr<SP::GXML::XMLDump> dump(trans.trans(&tree));
std::cout << dump.get()->get() << std::flush;
}
</pre></div><hr><address align="right"><small>Generated on Thu Jun 3 19:20:12 2004 for sp-gxmlcpp by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0
width=110 height=53></a>1.2.15 </small></address>
</body>
</html>
|