diff options
Diffstat (limited to 'server/src/templateparser.cc')
-rw-r--r-- | server/src/templateparser.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/server/src/templateparser.cc b/server/src/templateparser.cc index d40bc1e..8db6bbf 100644 --- a/server/src/templateparser.cc +++ b/server/src/templateparser.cc @@ -40,11 +40,6 @@ // For vprintf and friends #include <stdarg.h> -#ifndef XML -// For XML -#include <config.h> -#endif/*XML*/ - #include <errno.h> #include <string.h> @@ -82,7 +77,11 @@ TemplateParser::TemplateParser(std::string course) t = new Template(); current_macro = NULL; +#ifndef TEST_TEMPLATEPARSER file = Conf::xml_basedir + "/templates/" + course + ".xml"; +#else + file = "../xml/templates/" + course + ".xml"; +#endif/*TEST_TEMPLATEPARSER*/ PRACRO_DEBUG(macro, "Using template file: %s\n", file.c_str()); @@ -183,6 +182,7 @@ void print_attributes(std::string prefix, int main() { + try { TemplateParser parser("example"); parser.parse(); @@ -217,7 +217,10 @@ int main() i++; } - + } catch(Exception &e) { + printf("ERROR: %s\n", e.what()); + return 1; + } return 0; } |