Author: gchapelle Date: Mon Jan 30 12:47:13 2006 New Revision: 2250 Modified: azax/branches/snowsprint/azaxresponse.py azax/branches/snowsprint/config.py azax/branches/snowsprint/demos/azaxdemo/azaxview.py azax/branches/snowsprint/tests/test_azaxresponse.py Log: work with entities
Modified: azax/branches/snowsprint/azaxresponse.py ============================================================================== --- azax/branches/snowsprint/azaxresponse.py (original) +++ azax/branches/snowsprint/azaxresponse.py Mon Jan 30 12:47:13 2006 @@ -51,6 +51,7 @@ def __init__(self, response=None): etree = config.etree + etree.setGlobalParseOptions(etree.getDefaultParseOptions() + 4) self._html = etree.fromstring(HTML_PREFIX % '') self._body = self._html[0] self._html.set('xmlns:kukit', 'http://www.kukit.org/commands/1.0') @@ -74,10 +75,12 @@ def wrapInHtmlNamespace(self, new_value, data): etree = config.etree new_value = HTML_PREFIX % new_value + etree.setGlobalParseOptions(etree.getDefaultParseOptions() + 4) valuetree = etree.fromstring(new_value) body = valuetree[0] data.text = body.text for elem in body.getchildren(): + elem.set("xmlns", "http://www.w3.org/1999/xhtml") data.append(elem) # commands Modified: azax/branches/snowsprint/config.py ============================================================================== --- azax/branches/snowsprint/config.py (original) +++ azax/branches/snowsprint/config.py Mon Jan 30 12:47:13 2006 @@ -2,7 +2,7 @@ # ElemenTree or maybe even cElementTree try: - from lxml import etree + from Products.lxml import etree except ImportError: try: import cElementTree as etree Modified: azax/branches/snowsprint/demos/azaxdemo/azaxview.py ============================================================================== --- azax/branches/snowsprint/demos/azaxdemo/azaxview.py (original) +++ azax/branches/snowsprint/demos/azaxdemo/azaxview.py Mon Jan 30 12:47:13 2006 @@ -56,7 +56,7 @@ """ returns div content """ return_object = AzaxResponse(self.request.response) return_object.setHtmlAsChild('div#demo', '<h1>it worked</h1>') - return_object.setHtmlAsChild('div#demo', '<h1>it worked again</h1>') + return_object.setHtmlAsChild('div#demo', '<h1>it worked again</h1>') return return_object() def getCorrespondingSelect(self, value): Modified: azax/branches/snowsprint/tests/test_azaxresponse.py ============================================================================== --- azax/branches/snowsprint/tests/test_azaxresponse.py (original) +++ azax/branches/snowsprint/tests/test_azaxresponse.py Mon Jan 30 12:47:13 2006 @@ -132,7 +132,7 @@ class LxmlTestCase(AzaxResponseTestCase): def afterSetUp(self): - from lxml import etree + from Products.lxml import etree config.etree = etree def test_etree(self): @@ -141,7 +141,7 @@ def test_suite(): suites = [] try: - from lxml import etree + from Products.lxml import etree except ImportError: pass else: -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins