Patch by Kristian Klette.
13 files changed:
"color": "blue",
"#things": []
});
"color": "blue",
"#things": []
});
{ "li": "Warm, woolen mittens", "li/class": "even" }
]
})
{ "li": "Warm, woolen mittens", "li/class": "even" }
]
})
{ "li": "Warm, woolen mittens"},
], "odd", "even")
});
{ "li": "Warm, woolen mittens"},
], "odd", "even")
});
{ "li": "Warm, woolen mittens"},
], "odd", "even")
});
{ "li": "Warm, woolen mittens"},
], "odd", "even")
});
{ 'li': 'Warm, woolen mittens' }
]
})
{ 'li': 'Warm, woolen mittens' }
]
})
"h1": "Nice heading here",
"contents": doc
});
"h1": "Nice heading here",
"contents": doc
});
'tagname': 'foo',
'#moretest': 'bar'
})
'tagname': 'foo',
'#moretest': 'bar'
})
'title': 'Namespace tests',
'#hello': 'Replaced.'
})
'title': 'Namespace tests',
'#hello': 'Replaced.'
})
import xmltemplate
doc = xmltemplate.process_file("../xml/passthru.xml", {})
import xmltemplate
doc = xmltemplate.process_file("../xml/passthru.xml", {})
'title': 'A very basic example',
'#hello': 'Hello world!'
})
'title': 'A very basic example',
'#hello': 'Hello world!'
})
{ '#inner': 'Three' },
]
})
{ '#inner': 'Three' },
]
})
#! /usr/bin/python
import re
#! /usr/bin/python
import re
+if sys.version_info[0] > 2:
+ string = str
+else:
+ string = basestring
+
+
def process_file(filename, obj, clean = True):
doc = xml.dom.minidom.parse(filename)
process(doc, obj, clean)
return doc
def process(node, obj, clean = True):
def process_file(filename, obj, clean = True):
doc = xml.dom.minidom.parse(filename)
process(doc, obj, clean)
return doc
def process(node, obj, clean = True):
- if isinstance(obj, basestring): # overwrite
+ if isinstance(obj, string): # overwrite
while not node.firstChild is None:
node.removeChild(node.firstChild)
doc = _get_document_element(node)
while not node.firstChild is None:
node.removeChild(node.firstChild)
doc = _get_document_element(node)
TESTS="passthru simple clone include attribute attribute2 attribute3 attribute-empty namespace namespace2 structure"
fi
if [ -z "$LANGUAGES" ]; then
TESTS="passthru simple clone include attribute attribute2 attribute3 attribute-empty namespace namespace2 structure"
fi
if [ -z "$LANGUAGES" ]; then
- LANGUAGES="perl perl-sax php4 php5 python ruby c++11"
+ LANGUAGES="perl perl-sax php4 php5 python python3 ruby c++11"
fi
for L in $LANGUAGES; do
fi
for L in $LANGUAGES; do
( cd ../c++11 && make -s && cd ../php5-swig && make -s && sudo cp XML_Template_SWIG.so /usr/lib/php5/20090626+lfs ) && php5-cgi -q ../php5-swig/$T.php > $TEMPFILE
fi
if [ "$L" = "python" ]; then
( cd ../c++11 && make -s && cd ../php5-swig && make -s && sudo cp XML_Template_SWIG.so /usr/lib/php5/20090626+lfs ) && php5-cgi -q ../php5-swig/$T.php > $TEMPFILE
fi
if [ "$L" = "python" ]; then
- python ../python/$T.py > $TEMPFILE
+ python2 ../python/$T.py > $TEMPFILE
+ fi
+ if [ "$L" = "python3" ]; then
+ python3 ../python/$T.py > $TEMPFILE
fi
if [ "$L" = "ruby" ]; then
ruby -I../ruby ../ruby/$T.rb > $TEMPFILE
fi
if [ "$L" = "ruby" ]; then
ruby -I../ruby ../ruby/$T.rb > $TEMPFILE