examples/xerces/main.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file main.cpp
22 
23  \brief A list of examples for the TerraLib Xerces Module.
24  */
25 
26 // Example
27 #include "ReaderExample.h"
28 
29 // TerraLib
30 #include "../Config.h"
32 
33 
34 // STL
35 #include <iostream>
36 
37 int main(int /*argc*/, char** /*argv*/)
38 {
39  try
40  {
42  ReadXML("/home/vinicius/MyDevel/terralib5-git/examples/xerces/note.xml", true, false);
43  ReadXML("/home/vinicius/MyDevel/terralib5-git/examples/xerces/note.xml", false, false);
44  ReadXML("/home/vinicius/MyDevel/terralib5-git/examples/xerces/note.xml", false, true);
45  //ReadXML(""TE_DATA_EXAMPLE_DIR"/xml/xerces/test.xml", false, true); //not found
46  //ReadXML(""TE_DATA_EXAMPLE_DIR"/xml/xerces/test_contracted.xml", false, true); //not found
47 
49  }
50  catch(const std::exception& e)
51  {
52  std::cout << std::endl << "An exception has occurred: " << e.what() << std::endl;
53  return EXIT_FAILURE;
54  }
55  catch(...)
56  {
57  std::cout << std::endl << "An unexpected exception has occurred!" << std::endl;
58  return EXIT_FAILURE;
59  }
60 
61  return EXIT_SUCCESS;
62 }
An utility class to control the startup and cleanup of the TerraLib Platform and its resources...
void finalize()
It finalizes the TerraLib Platform.
static TerraLib & getInstance()
It returns a reference to the singleton instance.
void initialize()
It initializes the TerraLib Platform.
void ReadXML(const std::string &path, bool validSchema, bool ignoreWhiteSpaces)
int main(int, char **)