diff --git a/src/libxml2_loader.cpp b/src/libxml2_loader.cpp index 85464f2e3..7973a109a 100644 --- a/src/libxml2_loader.cpp +++ b/src/libxml2_loader.cpp @@ -37,7 +37,7 @@ using boost::property_tree::ptree; using namespace std; -#define DEFAULT_OPTIONS (XML_PARSE_NOERROR | XML_PARSE_NOENT | XML_PARSE_NOBLANKS | XML_PARSE_DTDLOAD) +#define DEFAULT_OPTIONS (XML_PARSE_NOERROR | XML_PARSE_NOENT | XML_PARSE_NOBLANKS | XML_PARSE_DTDLOAD | XML_PARSE_NOCDATA) namespace mapnik { diff --git a/tests/python_tests/filter_test.py b/tests/python_tests/filter_test.py new file mode 100644 index 000000000..7a547e136 --- /dev/null +++ b/tests/python_tests/filter_test.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python + +from nose.tools import * +from utilities import Todo + +import mapnik + +map_ = ''' + +''' + +def test_filter_init(): + m = mapnik.Map(1,1) + mapnik.load_map_from_string(m,map_) + filters = [] + filters.append(mapnik.Filter("([region]>=0) and ([region]<=50)")) + filters.append(mapnik.Filter("(([region]>=0) and ([region]<=50))")) + filters.append(mapnik.Filter("((([region]>=0) and ([region]<=50)))")) + filters.append(mapnik.Filter('((([region]>=0) and ([region]<=50)))')) + filters.append(mapnik.Filter('''((([region]>=0) and ([region]<=50)))''')) + filters.append(mapnik.Filter(''' + ((([region]>=0) + and + ([region]<=50))) + ''')) + filters.append(mapnik.Filter(''' + ([region]>=0) + and + ([region]<=50) + ''')) + filters.append(mapnik.Filter(''' + ([region] + >= + 0) + and + ([region] + <= + 50) + ''')) + + s = m.find_style('s') + + for r in s.rules: + filters.append(r.filter) + + first = filters[0] + for f in filters: + eq_(str(first),str(f)) \ No newline at end of file