From ejucovy at codespeak.net Thu Apr 8 13:51:01 2010 From: ejucovy at codespeak.net (ejucovy at codespeak.net) Date: Thu, 8 Apr 2010 13:51:01 +0200 (CEST) Subject: [z3-checkins] r73543 - z3/deliverance/trunk/deliverance/tests Message-ID: <20100408115101.830D4282BD6@codespeak.net> Author: ejucovy Date: Thu Apr 8 13:51:00 2010 New Revision: 73543 Modified: z3/deliverance/trunk/deliverance/tests/test_middleware.txt Log: add partially failing test for #38 (escaped in SCRIPT/STYLE) Modified: z3/deliverance/trunk/deliverance/tests/test_middleware.txt ============================================================================== --- z3/deliverance/trunk/deliverance/tests/test_middleware.txt (original) +++ z3/deliverance/trunk/deliverance/tests/test_middleware.txt Thu Apr 8 13:51:00 2010 @@ -497,6 +497,92 @@ +Test that HTML comments inside SCRIPT and STYLE tags aren't escaped: + + >>> app['/scriptcomments'] = Response('''\ + ... + ... + ... + ... foo + ... + ... ''') + + >>> print compare_request('/scriptcomments', deliv_filename) # doctest: +REPORT_UDIFF + Original content: + + + + foo + + + Themed content: + + This is a theme title + + +
+ +
+ foo +
+ Back to top +
+ + + + + +Works fine; what about XHTML? + + >>> app['/scriptcomments'] = Response('''\ + ... + ... + ... + ... + ... foo + ... + ... ''') + + >>> print compare_request('/scriptcomments', deliv_filename) # doctest: +REPORT_UDIFF + Original content: + + + + + foo + + + Themed content: + + This is a theme title + + +
+ +
+ foo +
+ Back to top +
+ + + + + CDATA sections in XHTML documents should be preserved! lxml has a tendency to escape the angle brackets that start and end a CDATA section in XHTML documents (but not HTML) -- so Deliverance will munge the markers that start and end CDATA sections before passing the documents to lxml, and then unmunge them @@ -914,6 +1000,7 @@ + Some non-ASCII characters can end up mangled when they pass through lxml.html:: >>> from lxml.html import fromstring, tostring @@ -972,3 +1059,4 @@ + From ejucovy at codespeak.net Thu Apr 8 18:16:17 2010 From: ejucovy at codespeak.net (ejucovy at codespeak.net) Date: Thu, 8 Apr 2010 18:16:17 +0200 (CEST) Subject: [z3-checkins] r73562 - in z3/deliverance/trunk/deliverance: . tests Message-ID: <20100408161617.07A46282BDC@codespeak.net> Author: ejucovy Date: Thu Apr 8 18:16:16 2010 New Revision: 73562 Modified: z3/deliverance/trunk/deliverance/ruleset.py z3/deliverance/trunk/deliverance/tests/test_middleware.txt Log: only use method="xml" on the last tostring(); otherwise we end up double-escaping things like &gt; Modified: z3/deliverance/trunk/deliverance/ruleset.py ============================================================================== --- z3/deliverance/trunk/deliverance/ruleset.py (original) +++ z3/deliverance/trunk/deliverance/ruleset.py Thu Apr 8 18:16:16 2010 @@ -109,7 +109,7 @@ ## FIXME: this seems like a terrible way to preserve the content's DOCTYPE if resp.body.strip().startswith(" Themed content: - This is a theme titleThis is a theme title From ejucovy at codespeak.net Fri Apr 9 17:31:06 2010 From: ejucovy at codespeak.net (ejucovy at codespeak.net) Date: Fri, 9 Apr 2010 17:31:06 +0200 (CEST) Subject: [z3-checkins] r73587 - in z3/deliverance/trunk/deliverance: tests util Message-ID: <20100409153106.717BC282BDC@codespeak.net> Author: ejucovy Date: Fri Apr 9 17:31:04 2010 New Revision: 73587 Added: z3/deliverance/trunk/deliverance/tests/test_cdata.py Modified: z3/deliverance/trunk/deliverance/util/cdata.py Log: use the __START_CDATA__ trick to protect special characters within a cdata section so that javascript ><& are not escaped when they are inside a CDATA section (#38) Added: z3/deliverance/trunk/deliverance/tests/test_cdata.py ============================================================================== --- (empty file) +++ z3/deliverance/trunk/deliverance/tests/test_cdata.py Fri Apr 9 17:31:04 2010 @@ -0,0 +1,84 @@ +from deliverance.util.cdata import escape_cdata, unescape_cdata +from nose.tools import assert_true, assert_false, assert_equals +from lxml.html import fromstring, tostring + +docs = [ + """""", + + """""", + + """""", + ] + +def test_symmetry(): + for doc in docs: + assert_equals(unescape_cdata(escape_cdata(doc)), + doc) + +def test_content_preserved(): + output = escape_cdata(docs[0]) + assert "Success!" in output + assert "1 > 0 && 2 < 3" not in output + assert "1 __GT__ 0 __AMP____AMP__ 2 __LT__ 3" in output + + output = escape_cdata(docs[1]) + assert "Success!" in output + assert "A second success!" in output + +def test_no_escape_outside_cdata(): + output = escape_cdata(docs[2]) + assert " > " in output + assert " && " in output + assert " < " in output + +def test_lxml_output(): + output = escape_cdata(docs[0]) + output = tostring(fromstring(output), method="xml") + assert ">" not in output + assert "<" not in output + assert "&" not in output + + output = escape_cdata(docs[1]) + output = tostring(fromstring(output), method="xml") + assert ">" not in output + assert "<" not in output + assert "&" not in output + + output = escape_cdata(docs[2]) + output = tostring(fromstring(output), method="xml") + assert output.count(">") == 1 + assert output.count("<") == 1 + assert output.count("&") == 2 + Modified: z3/deliverance/trunk/deliverance/util/cdata.py ============================================================================== --- z3/deliverance/trunk/deliverance/util/cdata.py (original) +++ z3/deliverance/trunk/deliverance/util/cdata.py Fri Apr 9 17:31:04 2010 @@ -2,10 +2,51 @@ import re +SPECIAL_CHARACTERS = ( + (">", "__GT__"), + ("<", "__LT__"), + ("&", "__AMP__"), + ) + +class Escaper(object): + def __init__(self, inners): + self.index = 0 + self.inners = inners + self.pattern = r'__START_CDATA__%s__END_CDATA__' + + def replace(self, string): + for char in SPECIAL_CHARACTERS: + string = string.replace(char[0], char[1]) + return string + + def __call__(self, matchobj): + inner = self.inners[self.index] + inner = self.replace(inner) + self.index += 1 + return self.pattern % inner + +class Unescaper(Escaper): + def __init__(self, inners): + Escaper.__init__(self, inners) + self.pattern = r"" + + def replace(self, string): + for char in SPECIAL_CHARACTERS: + string = string.replace(char[1], char[0]) + return string + def escape_cdata(s): cdata_re = re.compile(r'', re.DOTALL) - return cdata_re.sub(r'__START_CDATA__\1__END_CDATA__', s) + inners = cdata_re.findall(s) + if not inners: + return s + repl = Escaper(inners) + return cdata_re.sub(repl, s) def unescape_cdata(s): cdata_re = re.compile(r'__START_CDATA__(.*?)__END_CDATA__', re.DOTALL) - return cdata_re.sub(r'', s) + inners = cdata_re.findall(s) + if not inners: + return s + repl = Unescaper(inners) + return cdata_re.sub(repl, s) From ejucovy at codespeak.net Fri Apr 9 18:14:11 2010 From: ejucovy at codespeak.net (ejucovy at codespeak.net) Date: Fri, 9 Apr 2010 18:14:11 +0200 (CEST) Subject: [z3-checkins] r73588 - z3/deliverance/trunk/deliverance Message-ID: <20100409161411.83E3F282BAD@codespeak.net> Author: ejucovy Date: Fri Apr 9 18:14:08 2010 New Revision: 73588 Modified: z3/deliverance/trunk/deliverance/ruleset.py Log: Use the doctype from the theme if it was explicitly specified; only fall back to the content's doctype otherwise. Modified: z3/deliverance/trunk/deliverance/ruleset.py ============================================================================== --- z3/deliverance/trunk/deliverance/ruleset.py (original) +++ z3/deliverance/trunk/deliverance/ruleset.py Fri Apr 9 18:14:08 2010 @@ -73,9 +73,13 @@ try: theme_href = theme.resolve_href(req, resp, log) - theme_doc = self.get_theme( - theme_href, resource_fetcher, log, - should_escape_cdata=True, should_fix_meta_charset_position=True) + original_theme_resp = self.get_theme_response( + theme_href, resource_fetcher, log) + theme_doc = self.get_theme_doc( + original_theme_resp, theme_href, + should_escape_cdata=True, + should_fix_meta_charset_position=True) + resp = force_charset(resp) body = resp.unicode_body body = escape_cdata(body) @@ -100,18 +104,19 @@ remove_content_attribs(theme_doc) ## FIXME: handle caching? - content_tree = content_doc.getroottree() + if original_theme_resp.body.strip().startswith(" Author: ejucovy Date: Mon Apr 12 21:39:47 2010 New Revision: 73676 Added: z3/deliverance/trunk/deliverance/docs/output-format.txt Modified: z3/deliverance/trunk/deliverance/docs/index.txt Log: add documentation on how output format is determined Modified: z3/deliverance/trunk/deliverance/docs/index.txt ============================================================================== --- z3/deliverance/trunk/deliverance/docs/index.txt (original) +++ z3/deliverance/trunk/deliverance/docs/index.txt Mon Apr 12 21:39:47 2010 @@ -10,6 +10,7 @@ philosophy configuration pyref + output-format clientside-theming code-map news @@ -23,5 +24,3 @@ page-classes rules proxy - -.. comment: FIXME: should those last 3 documents just be deleted? Added: z3/deliverance/trunk/deliverance/docs/output-format.txt ============================================================================== --- (empty file) +++ z3/deliverance/trunk/deliverance/docs/output-format.txt Mon Apr 12 21:39:47 2010 @@ -0,0 +1,14 @@ +Controlling the output format +============================= + +Deliverance can produce output as HTML or XHTML. On each request, it +determines the output format by looking for DOCTYPE declarations in +the theme and content. The precedence rules it uses are: + +1. If the theme declares its doctype, it is used in the output always. +2. Otherwise, if the content declares a doctype, it is used in the output. +3. If neither document declares a doctype, the output format is HTML. + +This allows the integrator to override the output format by specifying +a doctype in the theme. + From ejucovy at codespeak.net Mon Apr 12 21:42:35 2010 From: ejucovy at codespeak.net (ejucovy at codespeak.net) Date: Mon, 12 Apr 2010 21:42:35 +0200 (CEST) Subject: [z3-checkins] r73677 - in z3/deliverance/trunk: . deliverance/docs Message-ID: <20100412194235.AFB0B282B9C@codespeak.net> Author: ejucovy Date: Mon Apr 12 21:42:34 2010 New Revision: 73677 Modified: z3/deliverance/trunk/changes_on_trunk.txt z3/deliverance/trunk/deliverance/docs/news.txt Log: update changes Modified: z3/deliverance/trunk/changes_on_trunk.txt ============================================================================== --- z3/deliverance/trunk/changes_on_trunk.txt (original) +++ z3/deliverance/trunk/changes_on_trunk.txt Mon Apr 12 21:42:34 2010 @@ -1,30 +1,5 @@ - * The paste.deploy configuration and middleware factory now accept a `theme_uri` - parameter. + * Characters <, >, and & are no longer escaped when they appear + within a CDATA section in XHTML output mode. - If used, this will be the global default theme uri. It will be used if no - theme is defined within the ruleset. - - * Internal subrequests that return non-200 response codes are now retried as external - HTTP requests. (#16) - - * Request/response matching in elements now work. (#6) - - * tags are no longer stripped from documents. - Instead, they are always included in the output of Deliverance, with a default - charset of ASCII. (#34) - - * CDATA sections in XHTML documents are left as-is instead of being incorrectly - escaped. (#36) - - * Before applying the rules, Deliverance now moves the tag with a charset - declaration to be the first child of the element, if both are present. - This ensures that non-ASCII characters in the are converted to the correct - HTML sequences. (#12) - - * There is now a garbage-collecting WSGI middleware `deliverance.garbagecollect`, - disabled by default, which calls `gc.collect()` after every request. This was - added after a report (unconfirmed) of potential memory leaks when using some - versions of lxml. (#22) - - You can use it with `deliverance-proxy --garbage-collect` or, in paste.deploy - configurations, filter your app with `use = egg:Deliverance#garbagecollect`. + * The theme's doctype is now given priority over the content + doctype, to give users more control over the output format. Modified: z3/deliverance/trunk/deliverance/docs/news.txt ============================================================================== --- z3/deliverance/trunk/deliverance/docs/news.txt (original) +++ z3/deliverance/trunk/deliverance/docs/news.txt Mon Apr 12 21:42:34 2010 @@ -1,6 +1,40 @@ News ==== +0.3c3 +----- + + * The paste.deploy configuration and middleware factory now accept a `theme_uri` + parameter. + + If used, this will be the global default theme uri. It will be used if no + theme is defined within the ruleset. + + * Internal subrequests that return non-200 response codes are now retried as external + HTTP requests. (#16) + + * Request/response matching in elements now work. (#6) + + * tags are no longer stripped from documents. + Instead, they are always included in the output of Deliverance, with a default + charset of ASCII. (#34) + + * CDATA sections in XHTML documents are left as-is instead of being incorrectly + escaped. (#36) + + * Before applying the rules, Deliverance now moves the tag with a charset + declaration to be the first child of the element, if both are present. + This ensures that non-ASCII characters in the are converted to the correct + HTML sequences. (#12) + + * There is now a garbage-collecting WSGI middleware `deliverance.garbagecollect`, + disabled by default, which calls `gc.collect()` after every request. This was + added after a report (unconfirmed) of potential memory leaks when using some + versions of lxml. (#22) + + You can use it with `deliverance-proxy --garbage-collect` or, in paste.deploy + configurations, filter your app with `use = egg:Deliverance#garbagecollect`. + 0.3c2 ----- From optilude at codespeak.net Wed Apr 14 04:11:38 2010 From: optilude at codespeak.net (optilude at codespeak.net) Date: Wed, 14 Apr 2010 04:11:38 +0200 (CEST) Subject: [z3-checkins] r73725 - in z3/xdv/trunk/lib/xdv: . tests Message-ID: <20100414021138.66F74282B9C@codespeak.net> Author: optilude Date: Wed Apr 14 04:11:37 2010 New Revision: 73725 Modified: z3/xdv/trunk/lib/xdv/compiler.py z3/xdv/trunk/lib/xdv/tests/tests.py Log: Normalise paths when using an absolute prefix Modified: z3/xdv/trunk/lib/xdv/compiler.py ============================================================================== --- z3/xdv/trunk/lib/xdv/compiler.py (original) +++ z3/xdv/trunk/lib/xdv/compiler.py Wed Apr 14 04:11:37 2010 @@ -52,15 +52,15 @@ if url == 'xdv:extra' and self.extra is not None: return self.resolve_string(self.extra, context) -def to_absolute(src, prefix): - """Turn a url +def to_absolute(path, prefix): + """Make a url/path into an absolute URL by applying the given prefix """ - if src.startswith('/') or '://' in src: - return src - if src.startswith('./'): - return "%s/%s" % (prefix, src[2:]) - else: - return "%s/%s" % (prefix, src) + # Absolute path or full url + if path.startswith('/') or '://' in path: + return path + + absolute = "%s/%s" % (prefix, path) + return os.path.normpath(absolute) def apply_absolute_prefix(theme_doc, absolute_prefix): if absolute_prefix.endswith('/'): Modified: z3/xdv/trunk/lib/xdv/tests/tests.py ============================================================================== --- z3/xdv/trunk/lib/xdv/tests/tests.py (original) +++ z3/xdv/trunk/lib/xdv/tests/tests.py Wed Apr 14 04:11:37 2010 @@ -118,7 +118,7 @@ '@import "/abs/foo.css";', '@import url("/abs/foo.css");', "@import url('/abs/foo.css');", - "@import url('/abs/../foo.css');", + "@import url('/foo.css');", "@import url('/foo.css');", "@import url('http://site.com/foo.css');" ] @@ -129,7 +129,7 @@ self.assertEquals([ '/abs/foo.css', '/abs/foo.css', - '/abs/../foo.css', + '/foo.css', '/foo.css', 'http://site.com/foo.css' ], [x.get('href') for x in linkTags]) @@ -138,7 +138,7 @@ self.assertEquals([ '/abs/foo.js', '/abs/foo.js', - '/abs/../foo.js', + '/foo.js', '/foo.js', 'http://site.com/foo.js' ], [x.get('src') for x in scriptTags]) @@ -147,7 +147,7 @@ self.assertEquals([ '/abs/foo.jpg', '/abs/foo.jpg', - '/abs/../foo.jpg', + '/foo.jpg', '/foo.jpg', 'http://site.com/foo.jpg' ], [x.get('src') for x in imgTags]) @@ -156,7 +156,7 @@ self.assertEquals([ '/abs/foo.jpg', '/abs/foo.jpg', - '/abs/../foo.jpg', + '/foo.jpg', '/foo.jpg', 'http://site.com/foo.jpg' ], [x.get('src') for x in inputTags]) From optilude at codespeak.net Wed Apr 14 04:12:43 2010 From: optilude at codespeak.net (optilude at codespeak.net) Date: Wed, 14 Apr 2010 04:12:43 +0200 (CEST) Subject: [z3-checkins] r73726 - z3/xdv/trunk/lib/xdv Message-ID: <20100414021243.62C4F282B9C@codespeak.net> Author: optilude Date: Wed Apr 14 04:12:42 2010 New Revision: 73726 Modified: z3/xdv/trunk/lib/xdv/compiler.py Log: Optimise a bit Modified: z3/xdv/trunk/lib/xdv/compiler.py ============================================================================== --- z3/xdv/trunk/lib/xdv/compiler.py (original) +++ z3/xdv/trunk/lib/xdv/compiler.py Wed Apr 14 04:12:42 2010 @@ -60,6 +60,8 @@ return path absolute = "%s/%s" % (prefix, path) + if '://' in absolute: + return absolute return os.path.normpath(absolute) def apply_absolute_prefix(theme_doc, absolute_prefix): From vangheem at codespeak.net Wed Apr 14 14:22:49 2010 From: vangheem at codespeak.net (vangheem at codespeak.net) Date: Wed, 14 Apr 2010 14:22:49 +0200 (CEST) Subject: [z3-checkins] r73736 - z3/deliverance/branches/vangheem-multi-site-middleware Message-ID: <20100414122249.04E16282B9C@codespeak.net> Author: vangheem Date: Wed Apr 14 14:22:48 2010 New Revision: 73736 Added: z3/deliverance/branches/vangheem-multi-site-middleware/ - copied from r73735, z3/deliverance/trunk/ Log: branch for making deliverance support mutliple sites via an extra ini file From ejucovy at codespeak.net Wed Apr 14 22:37:46 2010 From: ejucovy at codespeak.net (ejucovy at codespeak.net) Date: Wed, 14 Apr 2010 22:37:46 +0200 (CEST) Subject: [z3-checkins] r73746 - z3/deliverance/trunk/deliverance Message-ID: <20100414203746.BD7F4282B9C@codespeak.net> Author: ejucovy Date: Wed Apr 14 22:37:43 2010 New Revision: 73746 Modified: z3/deliverance/trunk/deliverance/middleware.py Log: patch from kiorky to work around lxml segfaults Modified: z3/deliverance/trunk/deliverance/middleware.py ============================================================================== --- z3/deliverance/trunk/deliverance/middleware.py (original) +++ z3/deliverance/trunk/deliverance/middleware.py Wed Apr 14 22:37:43 2010 @@ -634,7 +634,9 @@ filename = self.filename try: - doc = parse(filename, base_url='file://'+os.path.abspath(filename)).getroot() + fp = open(filename) + doc = parse(fp, base_url='file://'+os.path.abspath(filename)).getroot() + fp.close() except XMLSyntaxError, e: raise Exception('Invalid syntax in %s: %s' % (filename, e)) assert doc.tag == 'ruleset', ( From optilude at codespeak.net Mon Apr 19 17:13:36 2010 From: optilude at codespeak.net (optilude at codespeak.net) Date: Mon, 19 Apr 2010 17:13:36 +0200 (CEST) Subject: [z3-checkins] r73886 - z3/xdv/trunk/lib/xdv Message-ID: <20100419151336.2B668282B9D@codespeak.net> Author: optilude Date: Mon Apr 19 17:13:34 2010 New Revision: 73886 Modified: z3/xdv/trunk/lib/xdv/compiler.py Log: Fix potential Windows path problem Modified: z3/xdv/trunk/lib/xdv/compiler.py ============================================================================== --- z3/xdv/trunk/lib/xdv/compiler.py (original) +++ z3/xdv/trunk/lib/xdv/compiler.py Mon Apr 19 17:13:34 2010 @@ -62,7 +62,11 @@ absolute = "%s/%s" % (prefix, path) if '://' in absolute: return absolute - return os.path.normpath(absolute) + + normalized = os.path.normpath(absolute) + if os.path.sep != '/': + normalized = normalized.replace(os.path.sep, '/') + return normalized def apply_absolute_prefix(theme_doc, absolute_prefix): if absolute_prefix.endswith('/'): From optilude at codespeak.net Tue Apr 20 17:30:32 2010 From: optilude at codespeak.net (optilude at codespeak.net) Date: Tue, 20 Apr 2010 17:30:32 +0200 (CEST) Subject: [z3-checkins] r73913 - z3/xdv/tags/0.3a3 Message-ID: <20100420153032.63452282BD4@codespeak.net> Author: optilude Date: Tue Apr 20 17:30:30 2010 New Revision: 73913 Added: z3/xdv/tags/0.3a3/ - copied from r73912, z3/xdv/trunk/ Log: Tagging 0.3a3 From optilude at codespeak.net Tue Apr 20 17:33:39 2010 From: optilude at codespeak.net (optilude at codespeak.net) Date: Tue, 20 Apr 2010 17:33:39 +0200 (CEST) Subject: [z3-checkins] r73914 - z3/xdv/tags/0.3a3 Message-ID: <20100420153339.1025E282BD4@codespeak.net> Author: optilude Date: Tue Apr 20 17:33:38 2010 New Revision: 73914 Removed: z3/xdv/tags/0.3a3/ Log: Remove dodgy tag From optilude at codespeak.net Wed Apr 21 18:29:15 2010 From: optilude at codespeak.net (optilude at codespeak.net) Date: Wed, 21 Apr 2010 18:29:15 +0200 (CEST) Subject: [z3-checkins] r73946 - z3/xdv/trunk Message-ID: <20100421162915.6592A282BD4@codespeak.net> Author: optilude Date: Wed Apr 21 18:29:13 2010 New Revision: 73946 Modified: z3/xdv/trunk/setup.py Log: Prepare xdv 0.3a3. Modified: z3/xdv/trunk/setup.py ============================================================================== --- z3/xdv/trunk/setup.py (original) +++ z3/xdv/trunk/setup.py Wed Apr 21 18:29:13 2010 @@ -1,7 +1,7 @@ from setuptools import setup, find_packages setup( name='xdv', - version='0.3a2', + version='0.3a3', description='''\ XDV implements a subset of Deliverance using a pure XSLT engine. With XDV, you "compile" your theme and ruleset in one step, then use a superfast/simple From optilude at codespeak.net Wed Apr 21 18:30:02 2010 From: optilude at codespeak.net (optilude at codespeak.net) Date: Wed, 21 Apr 2010 18:30:02 +0200 (CEST) Subject: [z3-checkins] r73947 - z3/xdv/tags/0.3a3 Message-ID: <20100421163002.5CB3C282BD4@codespeak.net> Author: optilude Date: Wed Apr 21 18:30:00 2010 New Revision: 73947 Added: z3/xdv/tags/0.3a3/ - copied from r73946, z3/xdv/trunk/ Log: Tagged xdv 0.3a3. From z3-checkins at codespeak.net Sat Apr 24 01:52:00 2010 From: z3-checkins at codespeak.net (BestVIAGRA Shop) Date: Sat, 24 Apr 2010 01:52:00 +0200 (CEST) Subject: [z3-checkins] Hey z3-checkins, get 80 percent OFF Message-ID: <20100423235200.077E236C21E@codespeak.net> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/z3-checkins/attachments/20100424/45c62975/attachment.htm From ldr at codespeak.net Mon Apr 26 00:51:40 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Mon, 26 Apr 2010 00:51:40 +0200 (CEST) Subject: [z3-checkins] r74058 - in z3/xdv/trunk/lib/xdv: . tests/update-namespace Message-ID: <20100425225140.8FF20282B90@codespeak.net> Author: ldr Date: Mon Apr 26 00:51:39 2010 New Revision: 74058 Modified: z3/xdv/trunk/lib/xdv/tests/update-namespace/rules.xml z3/xdv/trunk/lib/xdv/update-namespace.xsl Log: Fix namespace update problem with drop theme Modified: z3/xdv/trunk/lib/xdv/tests/update-namespace/rules.xml ============================================================================== --- z3/xdv/trunk/lib/xdv/tests/update-namespace/rules.xml (original) +++ z3/xdv/trunk/lib/xdv/tests/update-namespace/rules.xml Mon Apr 26 00:51:39 2010 @@ -5,5 +5,6 @@ - + + Modified: z3/xdv/trunk/lib/xdv/update-namespace.xsl ============================================================================== --- z3/xdv/trunk/lib/xdv/update-namespace.xsl (original) +++ z3/xdv/trunk/lib/xdv/update-namespace.xsl Mon Apr 26 00:51:39 2010 @@ -9,7 +9,7 @@ - + From ldr at codespeak.net Mon Apr 26 00:54:22 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Mon, 26 Apr 2010 00:54:22 +0200 (CEST) Subject: [z3-checkins] r74059 - z3/xdv/trunk/lib/xdv Message-ID: <20100425225422.22342282B90@codespeak.net> Author: ldr Date: Mon Apr 26 00:54:20 2010 New Revision: 74059 Modified: z3/xdv/trunk/lib/xdv/update-namespace.xsl Log: update namespace transform can use ifcontent='' Modified: z3/xdv/trunk/lib/xdv/update-namespace.xsl ============================================================================== --- z3/xdv/trunk/lib/xdv/update-namespace.xsl (original) +++ z3/xdv/trunk/lib/xdv/update-namespace.xsl Mon Apr 26 00:54:20 2010 @@ -10,7 +10,7 @@ - + From gotcha at codespeak.net Mon Apr 26 13:38:03 2010 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Mon, 26 Apr 2010 13:38:03 +0200 (CEST) Subject: [z3-checkins] r74065 - z3/xdv/trunk Message-ID: <20100426113803.7CBBF282B90@codespeak.net> Author: gotcha Date: Mon Apr 26 13:38:02 2010 New Revision: 74065 Modified: z3/xdv/trunk/README.txt Log: break lines for better rendering of code blocks on PyPI Modified: z3/xdv/trunk/README.txt ============================================================================== --- z3/xdv/trunk/README.txt (original) +++ z3/xdv/trunk/README.txt Mon Apr 26 13:38:02 2010 @@ -290,7 +290,8 @@ Here is another example using CSS selectors:: - + This will copy the children of the element with id ``header-box`` in the content into the element with id ``header`` in the theme, so long as an @@ -301,15 +302,19 @@ the expression in the ``content`` or ``css:content``` attribute as the condition". Hence the following two rules are equivalent:: - - + + If multiple rules of the same type match the same theme node but have different ``if-content`` expressions, they will be combined as an if..else if...else block:: - - + + These rules all attempt to fill the text in the ``

`` inside the body. @@ -341,16 +346,19 @@ rule element. Whether this is able to resolve the URL depends on how and where the compiled XSLT is being executed:: - + * Via a Server Side Include directive. This can be specified by setting the ``method`` attribute to ``ssi``:: - + The output will look something like this:: - + This SSI instruction would need to be processed by a fronting web server such as Apache or nginx. Also note the ``;filter_xpath`` query string @@ -363,11 +371,13 @@ * Via an Edge Side Includes directive. This can be specified by setting the ``method`` attribute to ``esi``:: - + The output is similar to that for the SSI mode:: - + + Again, the directive would need to be processed by a fronting server, such as Varnish. Chances are an ESI-aware cache server would not support From gotcha at codespeak.net Mon Apr 26 13:39:34 2010 From: gotcha at codespeak.net (gotcha at codespeak.net) Date: Mon, 26 Apr 2010 13:39:34 +0200 (CEST) Subject: [z3-checkins] r74066 - z3/xdv/trunk Message-ID: <20100426113934.116DC282B90@codespeak.net> Author: gotcha Date: Mon Apr 26 13:39:33 2010 New Revision: 74066 Modified: z3/xdv/trunk/README.txt Log: one more line break for better rendering of code blocks on PyPI Modified: z3/xdv/trunk/README.txt ============================================================================== --- z3/xdv/trunk/README.txt (original) +++ z3/xdv/trunk/README.txt Mon Apr 26 13:39:33 2010 @@ -830,7 +830,8 @@ As well as the libxml2 and libxslt development packages, you will require libapreq2 and the Apache development pacakges:: - $ sudo apt-get install libxslt1-dev libapache2-mod-apreq2 libapreq2-dev apache2-threaded-dev + $ sudo apt-get install libxslt1-dev libapache2-mod-apreq2 libapreq2-dev \ + > apache2-threaded-dev Install mod_depends then mod_transform using the standard procedure:: From z3-checkins at codespeak.net Fri Apr 30 20:10:16 2010 From: z3-checkins at codespeak.net (Anti-Impotence Meds online) Date: Fri, 30 Apr 2010 21:10:16 +0300 Subject: [z3-checkins] User z3-checkins, Get your 80% off today Leslie Message-ID: <20100430175534.34846282BF2@codespeak.net> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/z3-checkins/attachments/20100430/d91d11be/attachment-0001.htm From ejucovy at codespeak.net Tue May 4 23:31:18 2010 From: ejucovy at codespeak.net (ejucovy at codespeak.net) Date: Tue, 4 May 2010 23:31:18 +0200 (CEST) Subject: [z3-checkins] r74368 - in z3/deliverance/trunk: . deliverance/docs Message-ID: <20100504213118.9B91B282BDB@codespeak.net> Author: ejucovy Date: Tue May 4 23:31:17 2010 New Revision: 74368 Modified: z3/deliverance/trunk/changes_on_trunk.txt z3/deliverance/trunk/deliverance/docs/news.txt z3/deliverance/trunk/setup.py Log: 0.3c4 Modified: z3/deliverance/trunk/changes_on_trunk.txt ============================================================================== --- z3/deliverance/trunk/changes_on_trunk.txt (original) +++ z3/deliverance/trunk/changes_on_trunk.txt Tue May 4 23:31:17 2010 @@ -1,5 +0,0 @@ - * Characters <, >, and & are no longer escaped when they appear - within a CDATA section in XHTML output mode. - - * The theme's doctype is now given priority over the content - doctype, to give users more control over the output format. Modified: z3/deliverance/trunk/deliverance/docs/news.txt ============================================================================== --- z3/deliverance/trunk/deliverance/docs/news.txt (original) +++ z3/deliverance/trunk/deliverance/docs/news.txt Tue May 4 23:31:17 2010 @@ -1,6 +1,15 @@ News ==== +0.3c4 +----- + + * Characters <, >, and & are no longer escaped when they appear + within a CDATA section in XHTML output mode. + + * The theme's doctype is now given priority over the content + doctype, to give users more control over the output format. + 0.3c3 ----- Modified: z3/deliverance/trunk/setup.py ============================================================================== --- z3/deliverance/trunk/setup.py (original) +++ z3/deliverance/trunk/setup.py Tue May 4 23:31:17 2010 @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '0.3-dev' +version = '0.3c4' setup(name='Deliverance', version=version, From ejucovy at codespeak.net Tue May 4 23:31:39 2010 From: ejucovy at codespeak.net (ejucovy at codespeak.net) Date: Tue, 4 May 2010 23:31:39 +0200 (CEST) Subject: [z3-checkins] r74369 - z3/deliverance/tags/0.3c4 Message-ID: <20100504213139.6F0A3282BAD@codespeak.net> Author: ejucovy Date: Tue May 4 23:31:38 2010 New Revision: 74369 Added: z3/deliverance/tags/0.3c4/ - copied from r74368, z3/deliverance/trunk/ Log: tag 0.3c4 From ejucovy at codespeak.net Tue May 4 23:36:14 2010 From: ejucovy at codespeak.net (ejucovy at codespeak.net) Date: Tue, 4 May 2010 23:36:14 +0200 (CEST) Subject: [z3-checkins] r74370 - z3/deliverance/trunk Message-ID: <20100504213614.5E669282BDB@codespeak.net> Author: ejucovy Date: Tue May 4 23:36:12 2010 New Revision: 74370 Modified: z3/deliverance/trunk/setup.py Log: back to -dev, and retarget docs URL Modified: z3/deliverance/trunk/setup.py ============================================================================== --- z3/deliverance/trunk/setup.py (original) +++ z3/deliverance/trunk/setup.py Tue May 4 23:36:12 2010 @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '0.3c4' +version = '0.3-dev' setup(name='Deliverance', version=version, @@ -24,7 +24,7 @@ keywords='wsgi theming html', author='Ian Bicking, The Open Planning Project, and the Deliverance development community', author_email='deliverance-devel at lists.coactivate.org', - url='http://deliverance.openplans.org/', + url='http://packages.python.org/Deliverance/', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), include_package_data=True, From ejucovy at codespeak.net Tue May 4 23:50:15 2010 From: ejucovy at codespeak.net (ejucovy at codespeak.net) Date: Tue, 4 May 2010 23:50:15 +0200 (CEST) Subject: [z3-checkins] r74371 - z3/deliverance/trunk/deliverance/docs Message-ID: <20100504215015.60B80282BDB@codespeak.net> Author: ejucovy Date: Tue May 4 23:50:14 2010 New Revision: 74371 Modified: z3/deliverance/trunk/deliverance/docs/quickstart.txt Log: doc typo (effect->affect) Modified: z3/deliverance/trunk/deliverance/docs/quickstart.txt ============================================================================== --- z3/deliverance/trunk/deliverance/docs/quickstart.txt (original) +++ z3/deliverance/trunk/deliverance/docs/quickstart.txt Tue May 4 23:50:14 2010 @@ -8,7 +8,7 @@ If you are familiar with `virtualenv `_ and `easy_install `_ you can skip this section. -We'll be setting everything up in an isolated environment. Nothing in this will effect anything on your system outside of the directories we set up in this tutorial -- so you can just delete the directory and forget about the whole thing if you don't like it. +We'll be setting everything up in an isolated environment. Nothing in this will affect anything on your system outside of the directories we set up in this tutorial -- so you can just delete the directory and forget about the whole thing if you don't like it. The first thing we'll do is get virtualenv and create an environment. Grab `virtualenv.py `_, and run:: From ejucovy at codespeak.net Tue May 4 23:53:10 2010 From: ejucovy at codespeak.net (ejucovy at codespeak.net) Date: Tue, 4 May 2010 23:53:10 +0200 (CEST) Subject: [z3-checkins] r74372 - z3/deliverance/trunk/deliverance/docs Message-ID: <20100504215310.2125D282BDB@codespeak.net> Author: ejucovy Date: Tue May 4 23:53:08 2010 New Revision: 74372 Modified: z3/deliverance/trunk/deliverance/docs/quickstart.txt Log: update docs to not point to outdated pybundle (will hopefully figure out a solution for hosting pybundles and reinstate at that point) -- for now just tell people to easy_install deliverance Modified: z3/deliverance/trunk/deliverance/docs/quickstart.txt ============================================================================== --- z3/deliverance/trunk/deliverance/docs/quickstart.txt (original) +++ z3/deliverance/trunk/deliverance/docs/quickstart.txt Tue May 4 23:53:08 2010 @@ -21,13 +21,9 @@ Installing the Software ----------------------- -We won't actually use ``easy_install`` much, we'll just install another installer:: +You can use easy_install to install the latest release of Deliverance and all its dependencies: - $ DelivTest/bin/easy_install pip - -And we'll use the ``pip`` installer to install Deliverance. This has the benefit over ``easy_install`` of installing all the source at once and with versions of the software that are known to work with each other. So, we'll install the Deliverance bundle:: - - $ DelivTest/bin/pip install http://deliverance.openplans.org/dist/Deliverance-snapshot-latest.pybundle + $ easy_install Deliverance .. comment: From ldr at codespeak.net Mon May 10 22:46:44 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Mon, 10 May 2010 22:46:44 +0200 (CEST) Subject: [z3-checkins] r74473 - z3/xdv/trunk Message-ID: <20100510204644.2377E282BF0@codespeak.net> Author: ldr Date: Mon May 10 22:46:42 2010 New Revision: 74473 Modified: z3/xdv/trunk/README.txt Log: documentation typo Modified: z3/xdv/trunk/README.txt ============================================================================== --- z3/xdv/trunk/README.txt (original) +++ z3/xdv/trunk/README.txt Mon May 10 22:46:42 2010 @@ -172,8 +172,8 @@ Used to copy elements from the content into an element in the theme, leaving existing content in place. ```` places the matched -content directly before the closing tag in the theme; append places it -directly after the opening tag. For example:: +content directly before the closing tag in the theme; ```` places +it directly after the opening tag. For example:: From ldr at codespeak.net Mon May 10 23:02:03 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Mon, 10 May 2010 23:02:03 +0200 (CEST) Subject: [z3-checkins] r74474 - z3/xdv/trunk/lib/xdv/tests/before-prepend-append-after Message-ID: <20100510210203.B0E60282BF0@codespeak.net> Author: ldr Date: Mon May 10 23:02:02 2010 New Revision: 74474 Added: z3/xdv/trunk/lib/xdv/tests/before-prepend-append-after/ z3/xdv/trunk/lib/xdv/tests/before-prepend-append-after/content.html z3/xdv/trunk/lib/xdv/tests/before-prepend-append-after/output.html z3/xdv/trunk/lib/xdv/tests/before-prepend-append-after/rules.xml z3/xdv/trunk/lib/xdv/tests/before-prepend-append-after/theme.html Log: a test demonstrating before, prepend, append, after Added: z3/xdv/trunk/lib/xdv/tests/before-prepend-append-after/content.html ============================================================================== --- (empty file) +++ z3/xdv/trunk/lib/xdv/tests/before-prepend-append-after/content.html Mon May 10 23:02:02 2010 @@ -0,0 +1,4 @@ +

Before

+

Prepend

+

Append

+

After

Added: z3/xdv/trunk/lib/xdv/tests/before-prepend-append-after/output.html ============================================================================== --- (empty file) +++ z3/xdv/trunk/lib/xdv/tests/before-prepend-append-after/output.html Mon May 10 23:02:02 2010 @@ -0,0 +1,12 @@ + + + +

Before

+
+

Prepend

+
Content
+

Append

+
+

After

+ + Added: z3/xdv/trunk/lib/xdv/tests/before-prepend-append-after/rules.xml ============================================================================== --- (empty file) +++ z3/xdv/trunk/lib/xdv/tests/before-prepend-append-after/rules.xml Mon May 10 23:02:02 2010 @@ -0,0 +1,8 @@ + + + + + + + Added: z3/xdv/trunk/lib/xdv/tests/before-prepend-append-after/theme.html ============================================================================== --- (empty file) +++ z3/xdv/trunk/lib/xdv/tests/before-prepend-append-after/theme.html Mon May 10 23:02:02 2010 @@ -0,0 +1,3 @@ +
+
Content
+
From z3-checkins at codespeak.net Wed May 19 16:56:32 2010 From: z3-checkins at codespeak.net (E-store of sex remedies) Date: Wed, 19 May 2010 18:26:32 +0330 Subject: [z3-checkins] For z3-checkins - Get 83% discounts today. notably Message-ID: <20100519145631.A38BE282C0D@codespeak.net> An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/z3-checkins/attachments/20100519/2bef8321/attachment-0001.htm From ldr at codespeak.net Thu May 20 18:35:35 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Thu, 20 May 2010 18:35:35 +0200 (CEST) Subject: [z3-checkins] r74603 - z3/deliverance/branches/Attic/doc Message-ID: <20100520163535.88F3B282B90@codespeak.net> Author: ldr Date: Thu May 20 18:35:33 2010 New Revision: 74603 Added: z3/deliverance/branches/Attic/doc/zopesitethemesdiagram.png - copied unchanged from r25953, z3/deliverance/trunk/lib/zopesitethemesdiagram.png Log: restore the old diagram to the Attic as it is referenced by http://wiki.zope.org/zope3/SiteThemes From ldr at codespeak.net Sat May 22 17:18:12 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Sat, 22 May 2010 17:18:12 +0200 (CEST) Subject: [z3-checkins] r74679 - z3/xdv/trunk/docs Message-ID: <20100522151812.02F41282BAD@codespeak.net> Author: ldr Date: Sat May 22 17:18:11 2010 New Revision: 74679 Added: z3/xdv/trunk/docs/TODO.txt Log: TODO list Added: z3/xdv/trunk/docs/TODO.txt ============================================================================== --- (empty file) +++ z3/xdv/trunk/docs/TODO.txt Sat May 22 17:18:11 2010 @@ -0,0 +1,235 @@ +====== + TODO +====== + + +0.3 release +=========== + +``pre`` double linebreaks +------------------------- + +libxml2 quotes CR characters on output, this causes Firefox to insert extra +blank lines in ``
`` blocks. As HTTP specified CRLF line endings for form
+this is a problem for us. plone.org works around this with::
+
+    
+        
+    
+
+This should be included in the boilerplate xsl.
+
+
+Copy xsl directives from the rules file
+---------------------------------------
+
+We want to be able to do::
+
+    
+        
+    
+
+And have the directive copied into the output xsl.
+
+In combination with the inline XSL, this should allow the ``extra.xsl``
+support to be depracated
+
+
+
+0.4 release
+===========
+
+
+Group directive
+---------------
+
+It would be useful to group together rules that share the same condition::
+
+    
+     
+     
+    
+
+To match multiple paths in a single rule separate them with spaces::
+
+    
+
+This would be limited to simple string matching. Regexp would also be
+possible, with the extension included in lxml or the libxslt-regexp-plugin_
+for apache / nginx usage::
+
+    
+
+($path would be supplied to the template as a parameter)
+
+.. _libxslt-regexp-plugin: http://fr.rpmfind.net/pub/libxml/plugins/
+
+
+Refactor generated xslt
+-----------------------
+
+The xslt generated by the xdv compiler is currently uses three passes,
+an initial-stage where drop rules are applied, an apply-theme stage
+and a final-stage which ensures script and style element content is
+unquoted. By collapsing this into a single stage we should see a
+30-50% speedup (from my initial experiments).
+
+The initial-stage and final-stage passes were also a plugin point to
+include custom xslt, but xdv 0.3 now allows you to write inline xsl
+should you wish::
+
+    
+       
+ +
+
+
+
+
+ +extra.xsl is may also be used for output directives, such as +````. This would be put into the rules file +instead. + +There is one slight complication. Take a content document as follows:: + +
ONE
+
TWO
+ +And rules:: + + + + +Should this give the output (as currently):: + +
+
ONE
+
+ +or (the easier to implement in a single pass template):: + +
+
ONE
+
TWO
+
+ +I guess the former might be implemented by prefixing +ancestor-or-self::, though that may interact badly with complex xpath +selectors. + + +Include directive +----------------- + +The current xinclude syntax is complex, maybe we need a dedicated directive:: + + + +* Lars noted that by placing an id on groups, it would be possible to pull in + groups with xinclude. e.g.: + + In rules.xml:: + + + + + + In common.xml:: + + + + + + + + + + + With the result:: + + + + + + + + +Theme directive / multiple theme support +---------------------------------------- + +It would be nice to specify the theme in the rules file itself:: + + + +Multiple themes may be used with conditions:: + + + + +When no conditional theme matches and there is no unconditional theme, the +page would still be parsed and serialized through libxml2. + + +Omit directive +-------------- + +Similar to TAL's omit-tag, it leaves the contents of the matched node +in place, while omitting the start and end tags (along with any +attributes):: + + + +* Martin points out that ``omit`` is a synonym for ``drop``, though we already + have ``copy`` and ``replace``. + + +Better debugging support +------------------------ + +There needs to be some mechanism to feedback to the integrator which rules are +being matched, probably by writing out information into comments. + + + +Maybe sometime in the future +============================ + + +pyref support +------------- + +It might be useful to add pyref_ support for collective.xdv and dv.xdvserver. + +.. _pyref + + +i18n support +------------ + +It would be nice to be able to leverage the existing gettext translation +machinery for message strings within the template. I don't know exactly what +syntax we should use, but it would be quite easy to implement with lxml (see +this perl example_.) For Apache / Nginx use we would need a C libxslt plugin, +but that shouldn't be too hard. + +Maybe something like:: + + + +.. _example: `_ From ejucovy at codespeak.net Sat May 22 19:09:59 2010 From: ejucovy at codespeak.net (ejucovy at codespeak.net) Date: Sat, 22 May 2010 19:09:59 +0200 (CEST) Subject: [z3-checkins] r74683 - z3/deliverance/trunk/deliverance/docs Message-ID: <20100522170959.64815282BAD@codespeak.net> Author: ejucovy Date: Sat May 22 19:09:57 2010 New Revision: 74683 Modified: z3/deliverance/trunk/deliverance/docs/rules.txt Log: add example on how to select multiple things with a single CSS selector, per http://www.coactivate.org/projects/deliverance/lists/deliverance-discussion/archive/2010/05/1273691268732 Modified: z3/deliverance/trunk/deliverance/docs/rules.txt ============================================================================== --- z3/deliverance/trunk/deliverance/docs/rules.txt (original) +++ z3/deliverance/trunk/deliverance/docs/rules.txt Sat May 22 19:09:57 2010 @@ -27,6 +27,7 @@ Some types are invalid in some positions; this will be noted later on. + Actions ------- @@ -227,3 +228,10 @@ +You want to copy all the items with class .one and all the items with class .three, preserving their order: + +.. code-block:: xml + + + From ldr at codespeak.net Sun May 23 14:22:47 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Sun, 23 May 2010 14:22:47 +0200 (CEST) Subject: [z3-checkins] r74685 - z3/xdv/trunk/lib/xdv Message-ID: <20100523122247.100E0282BD8@codespeak.net> Author: ldr Date: Sun May 23 14:22:45 2010 New Revision: 74685 Modified: z3/xdv/trunk/lib/xdv/compiler.py z3/xdv/trunk/lib/xdv/run.py Log: add support for xslt access control, so reads to network can be supported Modified: z3/xdv/trunk/lib/xdv/compiler.py ============================================================================== --- z3/xdv/trunk/lib/xdv/compiler.py (original) +++ z3/xdv/trunk/lib/xdv/compiler.py Sun May 23 14:22:45 2010 @@ -83,7 +83,7 @@ elif node.tag == 'style' or node.tag == etree.Comment and node.text.startswith("[if IE"): node.text = IMPORT_STYLESHEET.sub(lambda match: match.group(1) + to_absolute(match.group(2), absolute_prefix) + match.group(3), node.text) -def compile_theme(rules, theme, extra=None, css=True, xinclude=False, absolute_prefix=None, update=True, trace=False, includemode=None, parser=None, compiler_parser=None, rules_parser=None): +def compile_theme(rules, theme, extra=None, css=True, xinclude=False, absolute_prefix=None, update=True, trace=False, includemode=None, parser=None, compiler_parser=None, rules_parser=None, access_control=None): """Invoke the xdv compiler. * ``rules`` is the rules file @@ -134,7 +134,9 @@ if compiler_parser is None: compiler_parser = etree.XMLParser() - compiler_transform = etree.XSLT(etree.parse(COMPILER_PATH, parser=compiler_parser)) + if access_control is None: + access_control = etree.XSLTAccessControl() + compiler_transform = etree.XSLT(etree.parse(COMPILER_PATH, parser=compiler_parser), access_control=access_control) params = dict(rulesuri="'xdv:rules'") if extra: @@ -187,6 +189,9 @@ parser.add_option("-i", "--includemode", metavar="INC", help="include mode (document, ssi or esi)", dest="includemode", default=None) + parser.add_option("-n", "--network", action="store_true", + help="Allow reads to the network to fetch resources", + dest="read_network", default=False) (options, args) = parser.parse_args() if len(args) !=2: @@ -195,8 +200,10 @@ if options.trace: logger.setLevel(logging.DEBUG) + + access_control = etree.XSLTAccessControl(read_network=options.read_network) - output_xslt = compile_theme(rules=rules, theme=theme, extra=options.extra, trace=options.trace, xinclude=options.xinclude, absolute_prefix=options.absolute_prefix, includemode=options.includemode) + output_xslt = compile_theme(rules=rules, theme=theme, extra=options.extra, trace=options.trace, xinclude=options.xinclude, absolute_prefix=options.absolute_prefix, includemode=options.includemode, access_control=access_control) output_xslt.write(options.output, encoding='utf-8', pretty_print=options.pretty_print) if __name__ == '__main__': Modified: z3/xdv/trunk/lib/xdv/run.py ============================================================================== --- z3/xdv/trunk/lib/xdv/run.py (original) +++ z3/xdv/trunk/lib/xdv/run.py Sun May 23 14:22:45 2010 @@ -47,8 +47,13 @@ op.add_option("--xinclude", action="store_true", help="Run XInclude on rules.xml", dest="xinclude", default=False) + op.add_option("-n", "--network", action="store_true", + help="Allow reads to the network to fetch resources", + dest="read_network", default=False) (options, args) = op.parse_args() + access_control = etree.XSLTAccessControl(read_network=options.read_network) + if len(args) == 2: transform_path, content = args parser = etree.XMLParser() @@ -57,7 +62,7 @@ if options.theme and options.rules: content, = args parser = etree.HTMLParser() - output_xslt = compile_theme(rules=options.rules, theme=options.theme, extra=options.extra, xinclude=options.xinclude, parser=parser) + output_xslt = compile_theme(rules=options.rules, theme=options.theme, extra=options.extra, xinclude=options.xinclude, parser=parser, access_control=access_control) else: op.error("Theme and rules must be supplied.") else: @@ -67,7 +72,7 @@ content = sys.stdin parser.resolvers.add(RunResolver(os.path.dirname(content))) - transform = etree.XSLT(output_xslt) + transform = etree.XSLT(output_xslt, access_control=access_control) content_doc = etree.parse(content, parser=etree.HTMLParser()) output_html = transform(content_doc) output_html.write(options.output, encoding='utf-8', pretty_print=options.pretty_print) From ldr at codespeak.net Sun May 23 15:14:10 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Sun, 23 May 2010 15:14:10 +0200 (CEST) Subject: [z3-checkins] r74686 - z3/xdv/trunk/lib/xdv Message-ID: <20100523131410.B9265282BD8@codespeak.net> Author: ldr Date: Sun May 23 15:14:09 2010 New Revision: 74686 Modified: z3/xdv/trunk/lib/xdv/compiler.py z3/xdv/trunk/lib/xdv/run.py Log: fix access control Modified: z3/xdv/trunk/lib/xdv/compiler.py ============================================================================== --- z3/xdv/trunk/lib/xdv/compiler.py (original) +++ z3/xdv/trunk/lib/xdv/compiler.py Sun May 23 15:14:09 2010 @@ -47,9 +47,9 @@ self.extra = extra def resolve(self, url, pubid, context): - if url == 'xdv:rules': + if url == '__xdv__rules': return self.resolve_string(self.rules, context) - if url == 'xdv:extra' and self.extra is not None: + if url == '__xdv__extra' and self.extra is not None: return self.resolve_string(self.extra, context) def to_absolute(path, prefix): @@ -135,12 +135,12 @@ if compiler_parser is None: compiler_parser = etree.XMLParser() if access_control is None: - access_control = etree.XSLTAccessControl() + access_control = etree.XSLTAccessControl(read_file=True, write_file=False, create_dir=False, read_network=False, write_network=False) compiler_transform = etree.XSLT(etree.parse(COMPILER_PATH, parser=compiler_parser), access_control=access_control) - params = dict(rulesuri="'xdv:rules'") + params = dict(rulesuri="'__xdv__rules'") if extra: - params['extraurl'] = "'xdv:extra'" + params['extraurl'] = "'__xdv__extra'" resolver = CompileResolver(etree.tostring(rules_doc), etree.tostring(etree.parse(extra))) else: resolver = CompileResolver(etree.tostring(rules_doc)) @@ -200,8 +200,8 @@ if options.trace: logger.setLevel(logging.DEBUG) - - access_control = etree.XSLTAccessControl(read_network=options.read_network) + + access_control = etree.XSLTAccessControl(read_file=True, write_file=False, create_dir=False, read_network=options.read_network, write_network=False) output_xslt = compile_theme(rules=rules, theme=theme, extra=options.extra, trace=options.trace, xinclude=options.xinclude, absolute_prefix=options.absolute_prefix, includemode=options.includemode, access_control=access_control) output_xslt.write(options.output, encoding='utf-8', pretty_print=options.pretty_print) Modified: z3/xdv/trunk/lib/xdv/run.py ============================================================================== --- z3/xdv/trunk/lib/xdv/run.py (original) +++ z3/xdv/trunk/lib/xdv/run.py Sun May 23 15:14:09 2010 @@ -52,7 +52,7 @@ dest="read_network", default=False) (options, args) = op.parse_args() - access_control = etree.XSLTAccessControl(read_network=options.read_network) + access_control = access_control = etree.XSLTAccessControl(read_file=True, write_file=False, create_dir=False, read_network=options.read_network, write_network=False) if len(args) == 2: transform_path, content = args From ldr at codespeak.net Sun May 23 15:45:59 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Sun, 23 May 2010 15:45:59 +0200 (CEST) Subject: [z3-checkins] r74687 - z3/xdv/trunk/lib/xdv Message-ID: <20100523134559.1F0A8282BD8@codespeak.net> Author: ldr Date: Sun May 23 15:45:57 2010 New Revision: 74687 Modified: z3/xdv/trunk/lib/xdv/compiler.py Log: remove unused function Modified: z3/xdv/trunk/lib/xdv/compiler.py ============================================================================== --- z3/xdv/trunk/lib/xdv/compiler.py (original) +++ z3/xdv/trunk/lib/xdv/compiler.py Sun May 23 15:45:57 2010 @@ -155,15 +155,6 @@ logger.info(msg) return compiled -def prepare_filename(filename): - """Make file name string parameters compatible with xdv's compiler.xsl - """ - filename = os.path.abspath(filename) - if sys.platform.startswith('win'): - # compiler.xsl on Windows wants c:/foo/bar instead of C:\foo\bar - filename = filename.replace('\\', '/') - return filename - def main(): """Called from console script """ From ldr at codespeak.net Sun May 23 20:55:57 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Sun, 23 May 2010 20:55:57 +0200 (CEST) Subject: [z3-checkins] r74688 - z3/xdv/trunk/lib/xdv Message-ID: <20100523185557.8B3DC282BD8@codespeak.net> Author: ldr Date: Sun May 23 20:55:54 2010 New Revision: 74688 Modified: z3/xdv/trunk/lib/xdv/compiler.py Log: allow theme and rules to be supplied as options to compiler Modified: z3/xdv/trunk/lib/xdv/compiler.py ============================================================================== --- z3/xdv/trunk/lib/xdv/compiler.py (original) +++ z3/xdv/trunk/lib/xdv/compiler.py Sun May 23 20:55:54 2010 @@ -1,6 +1,6 @@ #!/usr/bin/env python """\ -Usage: %prog [options] RULES THEME +Usage: %prog [options] [-r] RULES [-t] THEME THEME is an html file. RULES is a file defining a set of xdv rules in css syntax, e.g: @@ -183,18 +183,28 @@ parser.add_option("-n", "--network", action="store_true", help="Allow reads to the network to fetch resources", dest="read_network", default=False) + parser.add_option("-t", "--theme", metavar="theme.html", + help="Theme file", + dest="theme", default=None) + parser.add_option("-r", "--rules", metavar="rules.xml", + help="XDV rules file", + dest="rules", default=None) (options, args) = parser.parse_args() - - if len(args) !=2: - parser.error("Wrong number of arguments.") - rules, theme = args + + if options.rules is None and options.theme is None: + if len(args) == 2: + options.rules, options.theme = args + else: + parser.error("Wrong number of arguments.") + elif not(options.rules is not None and options.theme is not None): + parser.error("Both theme and rules must be supplied as options or as arguments.") if options.trace: logger.setLevel(logging.DEBUG) access_control = etree.XSLTAccessControl(read_file=True, write_file=False, create_dir=False, read_network=options.read_network, write_network=False) - output_xslt = compile_theme(rules=rules, theme=theme, extra=options.extra, trace=options.trace, xinclude=options.xinclude, absolute_prefix=options.absolute_prefix, includemode=options.includemode, access_control=access_control) + output_xslt = compile_theme(rules=options.rules, theme=options.theme, extra=options.extra, trace=options.trace, xinclude=options.xinclude, absolute_prefix=options.absolute_prefix, includemode=options.includemode, access_control=access_control) output_xslt.write(options.output, encoding='utf-8', pretty_print=options.pretty_print) if __name__ == '__main__': From ldr at codespeak.net Sun May 23 20:56:27 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Sun, 23 May 2010 20:56:27 +0200 (CEST) Subject: [z3-checkins] r74689 - in z3/xdv/trunk/lib/xdv: . tests/inline-xsl-directives Message-ID: <20100523185627.04140282BD8@codespeak.net> Author: ldr Date: Sun May 23 20:56:26 2010 New Revision: 74689 Added: z3/xdv/trunk/lib/xdv/tests/inline-xsl-directives/ z3/xdv/trunk/lib/xdv/tests/inline-xsl-directives/content.html z3/xdv/trunk/lib/xdv/tests/inline-xsl-directives/output.html z3/xdv/trunk/lib/xdv/tests/inline-xsl-directives/rules.xml z3/xdv/trunk/lib/xdv/tests/inline-xsl-directives/theme.html Modified: z3/xdv/trunk/lib/xdv/compiler.xsl Log: allow inline xsl directives in rules Modified: z3/xdv/trunk/lib/xdv/compiler.xsl ============================================================================== --- z3/xdv/trunk/lib/xdv/compiler.xsl (original) +++ z3/xdv/trunk/lib/xdv/compiler.xsl Sun May 23 20:56:26 2010 @@ -101,6 +101,7 @@ + @@ -139,7 +140,7 @@ - + r @@ -169,6 +170,7 @@ + Added: z3/xdv/trunk/lib/xdv/tests/inline-xsl-directives/content.html ============================================================================== --- (empty file) +++ z3/xdv/trunk/lib/xdv/tests/inline-xsl-directives/content.html Sun May 23 20:56:26 2010 @@ -0,0 +1 @@ +

From the content

Added: z3/xdv/trunk/lib/xdv/tests/inline-xsl-directives/output.html ============================================================================== --- (empty file) +++ z3/xdv/trunk/lib/xdv/tests/inline-xsl-directives/output.html Sun May 23 20:56:26 2010 @@ -0,0 +1,8 @@ + + + +
+

From the content

+
+ + Added: z3/xdv/trunk/lib/xdv/tests/inline-xsl-directives/rules.xml ============================================================================== --- (empty file) +++ z3/xdv/trunk/lib/xdv/tests/inline-xsl-directives/rules.xml Sun May 23 20:56:26 2010 @@ -0,0 +1,9 @@ + + + + + Added: z3/xdv/trunk/lib/xdv/tests/inline-xsl-directives/theme.html ============================================================================== --- (empty file) +++ z3/xdv/trunk/lib/xdv/tests/inline-xsl-directives/theme.html Sun May 23 20:56:26 2010 @@ -0,0 +1,3 @@ +
+
Content
+
From ldr at codespeak.net Sun May 23 21:15:33 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Sun, 23 May 2010 21:15:33 +0200 (CEST) Subject: [z3-checkins] r74690 - z3/xdv/trunk/lib/xdv/tests Message-ID: <20100523191533.3C109282BD8@codespeak.net> Author: ldr Date: Sun May 23 21:15:30 2010 New Revision: 74690 Modified: z3/xdv/trunk/lib/xdv/tests/tests.py Log: tweak test class names Modified: z3/xdv/trunk/lib/xdv/tests/tests.py ============================================================================== --- z3/xdv/trunk/lib/xdv/tests/tests.py (original) +++ z3/xdv/trunk/lib/xdv/tests/tests.py Sun May 23 21:15:30 2010 @@ -225,7 +225,7 @@ path = os.path.join(HERE, name) if not os.path.isdir(path): continue - cls = type('Test%s'%name, (XDVTestCase,), dict(testdir=path)) + cls = type('Test-%s'%name, (XDVTestCase,), dict(testdir=path)) suite.addTest(unittest.makeSuite(cls)) suite.addTest(unittest.makeSuite(TestAbsolutePrefix)) return suite From ldr at codespeak.net Sun May 23 21:17:10 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Sun, 23 May 2010 21:17:10 +0200 (CEST) Subject: [z3-checkins] r74691 - z3/xdv/trunk/lib/xdv/tests/pre-line-endings Message-ID: <20100523191710.72075282BD8@codespeak.net> Author: ldr Date: Sun May 23 21:17:08 2010 New Revision: 74691 Added: z3/xdv/trunk/lib/xdv/tests/pre-line-endings/ z3/xdv/trunk/lib/xdv/tests/pre-line-endings/content.html z3/xdv/trunk/lib/xdv/tests/pre-line-endings/output.html z3/xdv/trunk/lib/xdv/tests/pre-line-endings/rules.xml z3/xdv/trunk/lib/xdv/tests/pre-line-endings/theme.html Log: Fix
 double linebreaks

Added: z3/xdv/trunk/lib/xdv/tests/pre-line-endings/content.html
==============================================================================
--- (empty file)
+++ z3/xdv/trunk/lib/xdv/tests/pre-line-endings/content.html	Sun May 23 21:17:08 2010
@@ -0,0 +1 @@
+
Line1
Line2
\ No newline at end of file Added: z3/xdv/trunk/lib/xdv/tests/pre-line-endings/output.html ============================================================================== --- (empty file) +++ z3/xdv/trunk/lib/xdv/tests/pre-line-endings/output.html Sun May 23 21:17:08 2010 @@ -0,0 +1,11 @@ + + + +
+
Line1
+Line2
+
+
Line1
+Line2
+ + Added: z3/xdv/trunk/lib/xdv/tests/pre-line-endings/rules.xml ============================================================================== --- (empty file) +++ z3/xdv/trunk/lib/xdv/tests/pre-line-endings/rules.xml Sun May 23 21:17:08 2010 @@ -0,0 +1,5 @@ + + + + Added: z3/xdv/trunk/lib/xdv/tests/pre-line-endings/theme.html ============================================================================== --- (empty file) +++ z3/xdv/trunk/lib/xdv/tests/pre-line-endings/theme.html Sun May 23 21:17:08 2010 @@ -0,0 +1,4 @@ +
+
Content
+
+
Line1
Line2
From ldr at codespeak.net Sun May 23 21:20:32 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Sun, 23 May 2010 21:20:32 +0200 (CEST) Subject: [z3-checkins] r74692 - z3/xdv/trunk/lib/xdv Message-ID: <20100523192032.E3CEC282BD8@codespeak.net> Author: ldr Date: Sun May 23 21:20:31 2010 New Revision: 74692 Modified: z3/xdv/trunk/lib/xdv/boilerplate.xsl z3/xdv/trunk/lib/xdv/compiler.xsl Log: compiler changes for pre line endings Modified: z3/xdv/trunk/lib/xdv/boilerplate.xsl ============================================================================== --- z3/xdv/trunk/lib/xdv/boilerplate.xsl (original) +++ z3/xdv/trunk/lib/xdv/boilerplate.xsl Sun May 23 21:20:31 2010 @@ -4,8 +4,9 @@ xmlns:dv="http://namespaces.plone.org/xdv" xmlns:esi="http://www.edge-delivery.org/esi/1.0" xmlns:exsl="http://exslt.org/common" + xmlns:str="http://exslt.org/strings" xmlns:xhtml="http://www.w3.org/1999/xhtml" - exclude-result-prefixes="exsl dv xhtml" > + exclude-result-prefixes="exsl str dv xhtml" > + + + + Modified: z3/xdv/trunk/lib/xdv/compiler.xsl ============================================================================== --- z3/xdv/trunk/lib/xdv/compiler.xsl (original) +++ z3/xdv/trunk/lib/xdv/compiler.xsl Sun May 23 21:20:31 2010 @@ -215,6 +215,11 @@ + + + + + From ldr at codespeak.net Sun May 23 21:22:12 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Sun, 23 May 2010 21:22:12 +0200 (CEST) Subject: [z3-checkins] r74693 - in z3/xdv/trunk/lib/xdv/tests: 001 002 003 004 005 006 007 008 009 010 011 012 013 014 Message-ID: <20100523192212.47078282BD8@codespeak.net> Author: ldr Date: Sun May 23 21:22:10 2010 New Revision: 74693 Removed: z3/xdv/trunk/lib/xdv/tests/001/compiled.xsl z3/xdv/trunk/lib/xdv/tests/002/compiled.xsl z3/xdv/trunk/lib/xdv/tests/003/compiled.xsl z3/xdv/trunk/lib/xdv/tests/004/compiled.xsl z3/xdv/trunk/lib/xdv/tests/005/compiled.xsl z3/xdv/trunk/lib/xdv/tests/006/compiled.xsl z3/xdv/trunk/lib/xdv/tests/007/compiled.xsl z3/xdv/trunk/lib/xdv/tests/008/compiled.xsl z3/xdv/trunk/lib/xdv/tests/009/compiled.xsl z3/xdv/trunk/lib/xdv/tests/010/compiled.xsl z3/xdv/trunk/lib/xdv/tests/011/compiled.xsl z3/xdv/trunk/lib/xdv/tests/012/compiled.xsl z3/xdv/trunk/lib/xdv/tests/013/compiled.xsl z3/xdv/trunk/lib/xdv/tests/014/compiled.xsl Log: remove the compiled.xsl files from the tests, keeping them up to date is just make work Deleted: /z3/xdv/trunk/lib/xdv/tests/001/compiled.xsl ============================================================================== --- /z3/xdv/trunk/lib/xdv/tests/001/compiled.xsl Sun May 23 21:22:10 2010 +++ (empty file) @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file Deleted: /z3/xdv/trunk/lib/xdv/tests/002/compiled.xsl ============================================================================== --- /z3/xdv/trunk/lib/xdv/tests/002/compiled.xsl Sun May 23 21:22:10 2010 +++ (empty file) @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <xsl:copy-of select="/html/head/title"/> - - - - - - - - - - - - - - - - \ No newline at end of file Deleted: /z3/xdv/trunk/lib/xdv/tests/003/compiled.xsl ============================================================================== --- /z3/xdv/trunk/lib/xdv/tests/003/compiled.xsl Sun May 23 21:22:10 2010 +++ (empty file) @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Second Theme Page Title -

Title

-
- -
- - - - - - - - - - - - - - -
\ No newline at end of file Deleted: /z3/xdv/trunk/lib/xdv/tests/010/compiled.xsl ============================================================================== --- /z3/xdv/trunk/lib/xdv/tests/010/compiled.xsl Sun May 23 21:22:10 2010 +++ (empty file) @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Theming with portlets -
-
-
Portlet
-
-
- - -
- - - - - - - - - - - - - - -
\ No newline at end of file Deleted: /z3/xdv/trunk/lib/xdv/tests/011/compiled.xsl ============================================================================== --- /z3/xdv/trunk/lib/xdv/tests/011/compiled.xsl Sun May 23 21:22:10 2010 +++ (empty file) @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Theming with portlets -
-
-
- -
- - - - - - - - - - - - - - -
\ No newline at end of file Deleted: /z3/xdv/trunk/lib/xdv/tests/012/compiled.xsl ============================================================================== --- /z3/xdv/trunk/lib/xdv/tests/012/compiled.xsl Sun May 23 21:22:10 2010 +++ (empty file) @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Replace and after - - - - - - - - - - - - - - - - - - - \ No newline at end of file Deleted: /z3/xdv/trunk/lib/xdv/tests/013/compiled.xsl ============================================================================== --- /z3/xdv/trunk/lib/xdv/tests/013/compiled.xsl Sun May 23 21:22:10 2010 +++ (empty file) @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - External includes - -
- -
- - - - - - - - - - - - - - -
\ No newline at end of file Deleted: /z3/xdv/trunk/lib/xdv/tests/014/compiled.xsl ============================================================================== --- /z3/xdv/trunk/lib/xdv/tests/014/compiled.xsl Sun May 23 21:22:10 2010 +++ (empty file) @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- Third Marker -
  • first
  • -
  • second
  • -
  • -
  • fourth
  • -
-
Third Marker
-
Fourth marker
- -
- - - - - - - - - - - - - - -
\ No newline at end of file From ldr at codespeak.net Sun May 23 21:46:27 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Sun, 23 May 2010 21:46:27 +0200 (CEST) Subject: [z3-checkins] r74694 - in z3/xdv/trunk/lib/xdv: . tests/nested-rules-for-xinclude Message-ID: <20100523194627.83E61282BD8@codespeak.net> Author: ldr Date: Sun May 23 21:46:26 2010 New Revision: 74694 Added: z3/xdv/trunk/lib/xdv/tests/nested-rules-for-xinclude/ z3/xdv/trunk/lib/xdv/tests/nested-rules-for-xinclude/content.html z3/xdv/trunk/lib/xdv/tests/nested-rules-for-xinclude/output.html z3/xdv/trunk/lib/xdv/tests/nested-rules-for-xinclude/rules.xml z3/xdv/trunk/lib/xdv/tests/nested-rules-for-xinclude/theme.html Modified: z3/xdv/trunk/lib/xdv/compiler.py z3/xdv/trunk/lib/xdv/compiler.xsl z3/xdv/trunk/lib/xdv/run.py Log: allow nested rules tags for simpler xincludes Modified: z3/xdv/trunk/lib/xdv/compiler.py ============================================================================== --- z3/xdv/trunk/lib/xdv/compiler.py (original) +++ z3/xdv/trunk/lib/xdv/compiler.py Sun May 23 21:46:26 2010 @@ -83,16 +83,17 @@ elif node.tag == 'style' or node.tag == etree.Comment and node.text.startswith("[if IE"): node.text = IMPORT_STYLESHEET.sub(lambda match: match.group(1) + to_absolute(match.group(2), absolute_prefix) + match.group(3), node.text) -def compile_theme(rules, theme, extra=None, css=True, xinclude=False, absolute_prefix=None, update=True, trace=False, includemode=None, parser=None, compiler_parser=None, rules_parser=None, access_control=None): +def compile_theme(rules, theme, extra=None, css=True, xinclude=True, absolute_prefix=None, update=True, trace=False, includemode=None, parser=None, compiler_parser=None, rules_parser=None, access_control=None): """Invoke the xdv compiler. * ``rules`` is the rules file * ``theme`` is the theme file - * ``extra`` is an optional XSLT file with XDV extensions + * ``extra`` is an optional XSLT file with XDV extensions (depracated, use + inline xsl in the rules instead) * ``css`` can be set to False to disable CSS syntax support (providing a moderate speed gain) - * ``xinclude`` can be set to True to enable XInclude support (at a - moderate speed cost) + * ``xinclude`` can be set to False to disable XInclude support during the + compile phase (providing a moderate speed gain) * ``absolute_prefix`` can be set to a string that will be prefixed to any *relative* URL referenced in an image, link or stylesheet in the theme HTML file before the theme is passed to the compiler. This allows a @@ -159,9 +160,6 @@ """Called from console script """ parser = OptionParser(usage=usage) - parser.add_option("-e", "--extra", metavar="extra.xsl", - help="Extra XSL to be included in the transform", - dest="extra", default=None) parser.add_option("-o", "--output", metavar="output.xsl", help="Output filename (instead of stdout)", dest="output", default=sys.stdout) @@ -172,8 +170,8 @@ help="Compiler trace logging", dest="trace", default=False) parser.add_option("--xinclude", action="store_true", - help="Run XInclude on rules.xml", - dest="xinclude", default=False) + help="Run XInclude on rules.xml (depracated, xinclude is always run)", + dest="xinclude", default=True) parser.add_option("-a", "--absolute-prefix", metavar="/", help="relative urls in the theme file will be made into absolute links with this prefix.", dest="absolute_prefix", default=None) @@ -189,6 +187,9 @@ parser.add_option("-r", "--rules", metavar="rules.xml", help="XDV rules file", dest="rules", default=None) + parser.add_option("-e", "--extra", metavar="extra.xsl", + help="Extra XSL to be included in the transform (depracated, use inline xsl in the rules instead)", + dest="extra", default=None) (options, args) = parser.parse_args() if options.rules is None and options.theme is None: Modified: z3/xdv/trunk/lib/xdv/compiler.xsl ============================================================================== --- z3/xdv/trunk/lib/xdv/compiler.xsl (original) +++ z3/xdv/trunk/lib/xdv/compiler.xsl Sun May 23 21:46:26 2010 @@ -140,7 +140,7 @@ - + r Modified: z3/xdv/trunk/lib/xdv/run.py ============================================================================== --- z3/xdv/trunk/lib/xdv/run.py (original) +++ z3/xdv/trunk/lib/xdv/run.py Sun May 23 21:46:26 2010 @@ -36,7 +36,7 @@ help="XDV rules file", dest="rules", default=None) op.add_option("-e", "--extra", metavar="extra.xsl", - help="XDV extraurl XSLT file", + help="XDV extraurl XSLT file (depracated, use inline xsl in the rules instead)", dest="extra", default=None) op.add_option("-o", "--output", metavar="output.html", help="Output filename (instead of stdout)", @@ -45,8 +45,8 @@ help="Pretty print output (can alter rendering on the browser)", dest="pretty_print", default=False) op.add_option("--xinclude", action="store_true", - help="Run XInclude on rules.xml", - dest="xinclude", default=False) + help="Run XInclude on rules.xml (depracated, xinclude is always run)", + dest="xinclude", default=True) op.add_option("-n", "--network", action="store_true", help="Allow reads to the network to fetch resources", dest="read_network", default=False) @@ -62,7 +62,7 @@ if options.theme and options.rules: content, = args parser = etree.HTMLParser() - output_xslt = compile_theme(rules=options.rules, theme=options.theme, extra=options.extra, xinclude=options.xinclude, parser=parser, access_control=access_control) + output_xslt = compile_theme(rules=options.rules, theme=options.theme, extra=options.extra, parser=parser, access_control=access_control) else: op.error("Theme and rules must be supplied.") else: Added: z3/xdv/trunk/lib/xdv/tests/nested-rules-for-xinclude/content.html ============================================================================== --- (empty file) +++ z3/xdv/trunk/lib/xdv/tests/nested-rules-for-xinclude/content.html Sun May 23 21:46:26 2010 @@ -0,0 +1 @@ +

From the content

Added: z3/xdv/trunk/lib/xdv/tests/nested-rules-for-xinclude/output.html ============================================================================== --- (empty file) +++ z3/xdv/trunk/lib/xdv/tests/nested-rules-for-xinclude/output.html Sun May 23 21:46:26 2010 @@ -0,0 +1,8 @@ + + + +
+

From the content

+
+ + Added: z3/xdv/trunk/lib/xdv/tests/nested-rules-for-xinclude/rules.xml ============================================================================== --- (empty file) +++ z3/xdv/trunk/lib/xdv/tests/nested-rules-for-xinclude/rules.xml Sun May 23 21:46:26 2010 @@ -0,0 +1,7 @@ + + + + + + Added: z3/xdv/trunk/lib/xdv/tests/nested-rules-for-xinclude/theme.html ============================================================================== --- (empty file) +++ z3/xdv/trunk/lib/xdv/tests/nested-rules-for-xinclude/theme.html Sun May 23 21:46:26 2010 @@ -0,0 +1,3 @@ +
+
Content
+
From ldr at codespeak.net Sun May 23 21:52:13 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Sun, 23 May 2010 21:52:13 +0200 (CEST) Subject: [z3-checkins] r74695 - z3/xdv/trunk/lib/xdv/tests/xinclude Message-ID: <20100523195213.682DE282BD8@codespeak.net> Author: ldr Date: Sun May 23 21:52:12 2010 New Revision: 74695 Added: z3/xdv/trunk/lib/xdv/tests/xinclude/ - copied from r74694, z3/xdv/trunk/lib/xdv/tests/nested-rules-for-xinclude/ z3/xdv/trunk/lib/xdv/tests/xinclude/included-rules.xml Modified: z3/xdv/trunk/lib/xdv/tests/xinclude/rules.xml Log: xinclude test Added: z3/xdv/trunk/lib/xdv/tests/xinclude/included-rules.xml ============================================================================== --- (empty file) +++ z3/xdv/trunk/lib/xdv/tests/xinclude/included-rules.xml Sun May 23 21:52:12 2010 @@ -0,0 +1,6 @@ + + + + + Modified: z3/xdv/trunk/lib/xdv/tests/xinclude/rules.xml ============================================================================== --- z3/xdv/trunk/lib/xdv/tests/nested-rules-for-xinclude/rules.xml (original) +++ z3/xdv/trunk/lib/xdv/tests/xinclude/rules.xml Sun May 23 21:52:12 2010 @@ -1,7 +1,8 @@ - - - - - - + + + + + \ No newline at end of file From ldr at codespeak.net Sun May 23 22:05:01 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Sun, 23 May 2010 22:05:01 +0200 (CEST) Subject: [z3-checkins] r74696 - in z3/xdv/trunk/lib/xdv: . tests/esi tests/ssi Message-ID: <20100523200501.A4C7A282BD8@codespeak.net> Author: ldr Date: Sun May 23 22:05:00 2010 New Revision: 74696 Modified: z3/xdv/trunk/lib/xdv/compiler.xsl z3/xdv/trunk/lib/xdv/tests/esi/output.html z3/xdv/trunk/lib/xdv/tests/esi/rules.xml z3/xdv/trunk/lib/xdv/tests/esi/theme.html z3/xdv/trunk/lib/xdv/tests/ssi/output.html z3/xdv/trunk/lib/xdv/tests/ssi/rules.xml z3/xdv/trunk/lib/xdv/tests/ssi/theme.html Log: allow for esi / ssi includes without content selector Modified: z3/xdv/trunk/lib/xdv/compiler.xsl ============================================================================== --- z3/xdv/trunk/lib/xdv/compiler.xsl (original) +++ z3/xdv/trunk/lib/xdv/compiler.xsl Sun May 23 22:05:00 2010 @@ -540,6 +540,7 @@ * When using ssiprefix, $href should be an absolute local path (i.e. /foo/bar) --> # include virtual=" + " wait="yes" @@ -549,6 +550,7 @@ * When using esiprefix, $href should be an absolute local path (i.e. /foo/bar) --> + Modified: z3/xdv/trunk/lib/xdv/tests/esi/output.html ============================================================================== --- z3/xdv/trunk/lib/xdv/tests/esi/output.html (original) +++ z3/xdv/trunk/lib/xdv/tests/esi/output.html Sun May 23 22:05:00 2010 @@ -3,5 +3,6 @@

theme

+ Modified: z3/xdv/trunk/lib/xdv/tests/esi/rules.xml ============================================================================== --- z3/xdv/trunk/lib/xdv/tests/esi/rules.xml (original) +++ z3/xdv/trunk/lib/xdv/tests/esi/rules.xml Sun May 23 22:05:00 2010 @@ -4,5 +4,6 @@ > + Modified: z3/xdv/trunk/lib/xdv/tests/esi/theme.html ============================================================================== --- z3/xdv/trunk/lib/xdv/tests/esi/theme.html (original) +++ z3/xdv/trunk/lib/xdv/tests/esi/theme.html Sun May 23 22:05:00 2010 @@ -3,5 +3,6 @@

theme

theme content
+
theme content
Modified: z3/xdv/trunk/lib/xdv/tests/ssi/output.html ============================================================================== --- z3/xdv/trunk/lib/xdv/tests/ssi/output.html (original) +++ z3/xdv/trunk/lib/xdv/tests/ssi/output.html Sun May 23 22:05:00 2010 @@ -3,5 +3,6 @@

theme

+ Modified: z3/xdv/trunk/lib/xdv/tests/ssi/rules.xml ============================================================================== --- z3/xdv/trunk/lib/xdv/tests/ssi/rules.xml (original) +++ z3/xdv/trunk/lib/xdv/tests/ssi/rules.xml Sun May 23 22:05:00 2010 @@ -4,5 +4,6 @@ > + Modified: z3/xdv/trunk/lib/xdv/tests/ssi/theme.html ============================================================================== --- z3/xdv/trunk/lib/xdv/tests/ssi/theme.html (original) +++ z3/xdv/trunk/lib/xdv/tests/ssi/theme.html Sun May 23 22:05:00 2010 @@ -3,5 +3,6 @@

theme

theme content
+
theme content
From ldr at codespeak.net Sun May 23 22:19:03 2010 From: ldr at codespeak.net (ldr at codespeak.net) Date: Sun, 23 May 2010 22:19:03 +0200 (CEST) Subject: [z3-checkins] r74697 - in z3/xdv/trunk: . docs Message-ID: <20100523201903.635E0282BD8@codespeak.net> Author: ldr Date: Sun May 23 22:19:01 2010 New Revision: 74697 Removed: z3/xdv/trunk/CHANGES.txt Modified: z3/xdv/trunk/README.txt z3/xdv/trunk/docs/TODO.txt Log: update documentation Deleted: /z3/xdv/trunk/CHANGES.txt ============================================================================== --- /z3/xdv/trunk/CHANGES.txt Sun May 23 22:19:01 2010 +++ (empty file) @@ -1,30 +0,0 @@ - -To Do -------------- - -- Generate valid XHTML output despite the namespaces of the theme or - content nodes. See NOTES.rst for more info. - -August 27 ---------- - -- Support attribute merging. For example, getting an attribute from - content and adding or replacing the attributes on the theme - . See NOTES.rst for more. - -- Work on a test suite. - -August 6 ------------------- - -- Set media-type on transforms. Compiler outputs as text/xml and generated - transforms output in text/html, but run in xml mode. - (Laurence) - -July 31 ------------------- - -- Add support for - -- Add support for and change example rules.xml to demonstrate - it Modified: z3/xdv/trunk/README.txt ============================================================================== --- z3/xdv/trunk/README.txt (original) +++ z3/xdv/trunk/README.txt Sun May 23 22:19:01 2010 @@ -442,6 +442,26 @@ use ``css:select="td:first-child > *"`` as you want a relative selector here. You can, of course, just use a manual XPath in a ``select`` attribute instead. +Inline XSL directives +~~~~~~~~~~~~~~~~~~~~~ + +You may supply inline XSL directives in the rules to tweak the final output, +for instance to strip space from the output document use:: + + + + + + + +Note: this may effect the rendering of the page on the browser. + +To use a strict doctype:: + + + XInclude ~~~~~~~~ @@ -449,9 +469,7 @@ This is particularly useful if you have multiple variations on the same theme used to style different pages on a particular website. -Rules files can be included using the XInclude protocol. By default, XInclude -processing is disabled (since it is a slight performance hit at compile -time), but it can be enabled in the XDV compiler using a command line option. +Rules files may be included using the XInclude protocol. Inclusions use standard XInclude syntax. For example:: @@ -460,12 +478,10 @@ xmlns:css="http://namespaces.plone.org/xdv+css" xmlns:xi="http://www.w3.org/2001/XInclude"> - + -An xpointer is used so as not to pull in the outer element. - Compilation =========== @@ -498,12 +514,8 @@ * Use ``-a`` to set an absolute prefix - see below. * Use ``-i`` to set the default external file inclusion mode to one of ``document``, ``ssi`` or ``esi``. -* Use ``-e`` to specify an "extras" XSLT file to be included in the compiled - theme. This allows you to include arbitrary XSLT instructions beyond what - XDV creates for you. * Use ``--trace`` to output trace logging during the compilation step. This can be helpful in debugging rules. -* Use ``--xinclude`` to process XInclude instructions in the rules file. Check the output of the ``--help`` option for more details. @@ -565,9 +577,10 @@ * ``theme`` is the theme file, given either as a file name or a string with the file contents * ``extra`` is an optional XSLT file with XDV extensions, given as a URI + (depracated, use inline xsl in the rules instead) * ``css`` can be set to False to disable CSS syntax support (providing a moderate speed gain) -* ``xinclude`` can be set to ``True`` to enable XInclude support (at a +* ``xinclude`` can be set to ``False`` to enable XInclude support (at a moderate speed cost). If enabled, XInclude syntax can be used to split the rules file into multiple, re-usable fragments. * ``absolute_prefix`` can be set an string to be used as the "absolute prefix" @@ -594,15 +607,12 @@ from lxml import etree from xdv.compiler import compile_theme - extraurl = None absolute_prefix = "/static" - xinclude = False rules = "rules.xml" theme = "theme.html" - compiled_theme = compile_theme(rules, theme, extra=extraurl, - xinclude=xinclude, + compiled_theme = compile_theme(rules, theme, absolute_prefix=absolute_prefix) transform = etree.XSLT(compiled_theme) @@ -864,4 +874,4 @@ Unfortunately it is not possible to theme error responses (such as a 404 Not Found page) with Apache as these do not pass through the filter chain. -.. _Deliverance: http://deliverance.openplans.org/ +.. _Deliverance: http://deliveranceproject.org/ Modified: z3/xdv/trunk/docs/TODO.txt ============================================================================== --- z3/xdv/trunk/docs/TODO.txt (original) +++ z3/xdv/trunk/docs/TODO.txt Sun May 23 22:19:01 2010 @@ -6,8 +6,8 @@ 0.3 release =========== -``pre`` double linebreaks -------------------------- +``pre`` double linebreaks (complete) +------------------------------------ libxml2 quotes CR characters on output, this causes Firefox to insert extra blank lines in ``
`` blocks. As HTTP specified CRLF line endings for form
@@ -20,8 +20,8 @@
 This should be included in the boilerplate xsl.
 
 
-Copy xsl directives from the rules file
----------------------------------------
+Copy xsl directives from the rules file (complete)
+--------------------------------------------------
 
 We want to be able to do::
 

From ldr at codespeak.net  Sun May 23 23:14:17 2010
From: ldr at codespeak.net (ldr at codespeak.net)
Date: Sun, 23 May 2010 23:14:17 +0200 (CEST)
Subject: [z3-checkins] r74698 - z3/xdv/trunk
Message-ID: <20100523211417.BA04F282BD8@codespeak.net>

Author: ldr
Date: Sun May 23 23:14:16 2010
New Revision: 74698

Added:
   z3/xdv/trunk/checkdocs.cfg
Modified:
   z3/xdv/trunk/README.txt
Log:
documentation update; checkdocs buildout

Modified: z3/xdv/trunk/README.txt
==============================================================================
--- z3/xdv/trunk/README.txt	(original)
+++ z3/xdv/trunk/README.txt	Sun May 23 23:14:16 2010
@@ -357,8 +357,7 @@
 
   The output will look something like this::
   
-    
+    
   
   This SSI instruction would need to be processed by a fronting web server
   such as Apache or nginx. Also note the ``;filter_xpath`` query string
@@ -367,6 +366,15 @@
   has executed), we need to ask the SSI processor to filter out elements in
   the included file that we are not interested in. This requires specific
   configuration. An example for nginx is included below.
+  
+  For simple SSI includes of a whole document, you may omit the ``content``
+  selector from the rule::
+  
+    
+  
+  The output then renders like this::
+  
+    
 
 * Via an Edge Side Includes directive. This can be specified by setting the
   ``method`` attribute to ``esi``::
@@ -376,8 +384,7 @@
 
   The output is similar to that for the SSI mode::
 
-    
-    
+    
   
   Again, the directive would need to be processed by a fronting server, such
   as Varnish. Chances are an ESI-aware cache server would not support
@@ -387,6 +394,15 @@
   of this is placed in-between the cache server and the underlying web server,
   that server can perform the necessary filtering.
 
+  For simple ESI includes of a whole document, you may omit the ``content``
+  selector from the rule::
+  
+    
+  
+  The output then renders like this::
+  
+    
+
 Modifying the theme on the fly
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

Added: z3/xdv/trunk/checkdocs.cfg
==============================================================================
--- (empty file)
+++ z3/xdv/trunk/checkdocs.cfg	Sun May 23 23:14:16 2010
@@ -0,0 +1,6 @@
+[buildout]
+extends = buildout.cfg
+
+[xdv]
+eggs +=
+    collective.checkdocs

From ldr at codespeak.net  Sun May 23 23:15:23 2010
From: ldr at codespeak.net (ldr at codespeak.net)
Date: Sun, 23 May 2010 23:15:23 +0200 (CEST)
Subject: [z3-checkins] r74699 - in z3/xdv/trunk: . docs
Message-ID: <20100523211523.E17A9282BD8@codespeak.net>

Author: ldr
Date: Sun May 23 23:15:22 2010
New Revision: 74699

Added:
   z3/xdv/trunk/docs/HISTORY.txt
Modified:
   z3/xdv/trunk/docs/TODO.txt
   z3/xdv/trunk/setup.py
Log:
prepare for 0.3rc1 release

Added: z3/xdv/trunk/docs/HISTORY.txt
==============================================================================
--- (empty file)
+++ z3/xdv/trunk/docs/HISTORY.txt	Sun May 23 23:15:22 2010
@@ -0,0 +1,8 @@
+Changelog
+=========
+
+0.3rc1 - 2010-05-23
+-------------------
+
+* First release candidate.
+  [laurence]

Modified: z3/xdv/trunk/docs/TODO.txt
==============================================================================
--- z3/xdv/trunk/docs/TODO.txt	(original)
+++ z3/xdv/trunk/docs/TODO.txt	Sun May 23 23:15:22 2010
@@ -52,7 +52,7 @@
 
 Nested conditions would be allowed and simply ANDed together.
 
-* Maybe this should be called ``rules`` instead. Then inclusion works better.
+* Maybe this should be called ``rules`` instead.
 
 
 Path conditions
@@ -134,8 +134,8 @@
 selectors.
 
 
-Include directive
------------------
+Include directive (rejected)
+----------------------------
 
 The current xinclude syntax is complex, maybe we need a dedicated directive::
 
@@ -169,6 +169,7 @@
       
     
 
+* Nested  now works, so this is not necessary.
 
 Theme directive / multiple theme support
 ----------------------------------------

Modified: z3/xdv/trunk/setup.py
==============================================================================
--- z3/xdv/trunk/setup.py	(original)
+++ z3/xdv/trunk/setup.py	Sun May 23 23:15:22 2010
@@ -1,13 +1,16 @@
 from setuptools import setup, find_packages
+import os
+
 setup(
     name='xdv',
-    version='0.3a3',
+    version='0.3rc1',
     description='''\
 XDV implements a subset of Deliverance using a pure XSLT engine. With XDV, you
 "compile" your theme and ruleset in one step, then use a superfast/simple
 transform on each request thereafter. Alternatively, compile your theme during
 development, check it into Subversion, and not touch XDV during deployment.''',
-    long_description=open("README.txt").read(),
+    long_description=open("README.txt").read() + "\n\n" +
+                     open(os.path.join("docs", "HISTORY.txt")).read(),
     packages=find_packages('lib'),
     package_dir = {'':'lib'},
     include_package_data=True,

From ldr at codespeak.net  Sun May 23 23:16:21 2010
From: ldr at codespeak.net (ldr at codespeak.net)
Date: Sun, 23 May 2010 23:16:21 +0200 (CEST)
Subject: [z3-checkins] r74700 - z3/xdv/tags/0.3rc1
Message-ID: <20100523211621.DF001282BD8@codespeak.net>

Author: ldr
Date: Sun May 23 23:16:20 2010
New Revision: 74700

Added:
   z3/xdv/tags/0.3rc1/
      - copied from r74699, z3/xdv/trunk/
Log:
tag 0.3rc1

From ldr at codespeak.net  Sun May 23 23:44:38 2010
From: ldr at codespeak.net (ldr at codespeak.net)
Date: Sun, 23 May 2010 23:44:38 +0200 (CEST)
Subject: [z3-checkins] r74701 - z3/xdv/trunk
Message-ID: <20100523214438.ED08C282BD8@codespeak.net>

Author: ldr
Date: Sun May 23 23:44:37 2010
New Revision: 74701

Modified:
   z3/xdv/trunk/setup.py
Log:
bump version

Modified: z3/xdv/trunk/setup.py
==============================================================================
--- z3/xdv/trunk/setup.py	(original)
+++ z3/xdv/trunk/setup.py	Sun May 23 23:44:37 2010
@@ -3,7 +3,7 @@
 
 setup(
     name='xdv',
-    version='0.3rc1',
+    version='0.3rc2',
     description='''\
 XDV implements a subset of Deliverance using a pure XSLT engine. With XDV, you
 "compile" your theme and ruleset in one step, then use a superfast/simple

From ldr at codespeak.net  Tue May 25 13:15:54 2010
From: ldr at codespeak.net (ldr at codespeak.net)
Date: Tue, 25 May 2010 13:15:54 +0200 (CEST)
Subject: [z3-checkins] r74729 - z3/xdv/trunk/docs
Message-ID: <20100525111554.333E0282B9D@codespeak.net>

Author: ldr
Date: Tue May 25 13:15:52 2010
New Revision: 74729

Modified:
   z3/xdv/trunk/docs/HISTORY.txt
Log:
better history

Modified: z3/xdv/trunk/docs/HISTORY.txt
==============================================================================
--- z3/xdv/trunk/docs/HISTORY.txt	(original)
+++ z3/xdv/trunk/docs/HISTORY.txt	Tue May 25 13:15:52 2010
@@ -4,5 +4,31 @@
 0.3rc1 - 2010-05-23
 -------------------
 
+* Nested  are now allowed, so you can simply::
+
+    ````
+
+  [elro]
+
+* XInclude processing is now enabled by default
+  [elro]
+
+* XSL directives inlined in the rules file are now supported (e.g.
+  ). With the inline XSL support, there should
+  now be no need for extra.xsl.
+  [elro]
+
+* libxml2 quotes CR characters on output, causing Firefox to insert extra
+  blank lines in ``
`` blocks. As HTTP specified CRLF line endings for
+  form this was a problem for us. This is now caught by the compiled XSL.
+  [elro]
+
+* Support for including complete fragment documents with SSI/ESI.
+  [elro]
+
+* A bug on namespace upgrade is fixed, but you should update your namespace to
+  http://namespaces.plone.org/xdv anyway.
+  [elro]
+
 * First release candidate.
-  [laurence]
+  [elro]

From ldr at codespeak.net  Tue May 25 13:18:33 2010
From: ldr at codespeak.net (ldr at codespeak.net)
Date: Tue, 25 May 2010 13:18:33 +0200 (CEST)
Subject: [z3-checkins] r74730 - in z3/xdv/trunk: docs lib/xdv
Message-ID: <20100525111833.52F1C282B9D@codespeak.net>

Author: ldr
Date: Tue May 25 13:18:31 2010
New Revision: 74730

Modified:
   z3/xdv/trunk/docs/HISTORY.txt
   z3/xdv/trunk/lib/xdv/compiler.py
Log:
Fixed bug resolving the rules files while use a network theme.

Modified: z3/xdv/trunk/docs/HISTORY.txt
==============================================================================
--- z3/xdv/trunk/docs/HISTORY.txt	(original)
+++ z3/xdv/trunk/docs/HISTORY.txt	Tue May 25 13:18:31 2010
@@ -1,6 +1,12 @@
 Changelog
 =========
 
+0.3rc2 - 2010-05-25
+-------------------
+
+* Fixed bug resolving the rules files while use a network theme.
+  [elro]
+
 0.3rc1 - 2010-05-23
 -------------------
 

Modified: z3/xdv/trunk/lib/xdv/compiler.py
==============================================================================
--- z3/xdv/trunk/lib/xdv/compiler.py	(original)
+++ z3/xdv/trunk/lib/xdv/compiler.py	Tue May 25 13:18:31 2010
@@ -47,9 +47,9 @@
         self.extra = extra
         
     def resolve(self, url, pubid, context):
-        if url == '__xdv__rules':
+        if url == 'file:///__xdv__rules':
             return self.resolve_string(self.rules, context)
-        if url == '__xdv__extra' and self.extra is not None:
+        if url == 'file:///__xdv__extra' and self.extra is not None:
             return self.resolve_string(self.extra, context)
 
 def to_absolute(path, prefix):
@@ -139,9 +139,9 @@
         access_control = etree.XSLTAccessControl(read_file=True, write_file=False, create_dir=False, read_network=False, write_network=False)
     compiler_transform = etree.XSLT(etree.parse(COMPILER_PATH, parser=compiler_parser), access_control=access_control)
 
-    params = dict(rulesuri="'__xdv__rules'")
+    params = dict(rulesuri="'file:///__xdv__rules'")
     if extra:
-        params['extraurl'] = "'__xdv__extra'"
+        params['extraurl'] = "'file:///__xdv__extra'"
         resolver = CompileResolver(etree.tostring(rules_doc), etree.tostring(etree.parse(extra)))
     else:
         resolver = CompileResolver(etree.tostring(rules_doc))

From ldr at codespeak.net  Tue May 25 14:06:22 2010
From: ldr at codespeak.net (ldr at codespeak.net)
Date: Tue, 25 May 2010 14:06:22 +0200 (CEST)
Subject: [z3-checkins] r74731 - z3/xdv/trunk/docs
Message-ID: <20100525120622.65C26282BDB@codespeak.net>

Author: ldr
Date: Tue May 25 14:06:21 2010
New Revision: 74731

Modified:
   z3/xdv/trunk/docs/HISTORY.txt
Log:
(docs) Note: the current lxml Windows binaries are unable to load files over the network.

Modified: z3/xdv/trunk/docs/HISTORY.txt
==============================================================================
--- z3/xdv/trunk/docs/HISTORY.txt	(original)
+++ z3/xdv/trunk/docs/HISTORY.txt	Tue May 25 14:06:21 2010
@@ -4,6 +4,9 @@
 0.3rc2 - 2010-05-25
 -------------------
 
+Note: the current lxml Windows binaries are unable to load files over the
+network.
+
 * Fixed bug resolving the rules files while use a network theme.
   [elro]
 

From ldr at codespeak.net  Tue May 25 14:07:17 2010
From: ldr at codespeak.net (ldr at codespeak.net)
Date: Tue, 25 May 2010 14:07:17 +0200 (CEST)
Subject: [z3-checkins] r74732 - z3/xdv/tags/0.3rc2
Message-ID: <20100525120717.83D6E282BDB@codespeak.net>

Author: ldr
Date: Tue May 25 14:07:16 2010
New Revision: 74732

Added:
   z3/xdv/tags/0.3rc2/
      - copied from r74731, z3/xdv/trunk/
Log:
tag 0.3rc2

From ldr at codespeak.net  Tue May 25 14:11:12 2010
From: ldr at codespeak.net (ldr at codespeak.net)
Date: Tue, 25 May 2010 14:11:12 +0200 (CEST)
Subject: [z3-checkins] r74733 - z3/xdv/trunk
Message-ID: <20100525121112.67375282BDB@codespeak.net>

Author: ldr
Date: Tue May 25 14:11:10 2010
New Revision: 74733

Modified:
   z3/xdv/trunk/setup.py
Log:
bump version

Modified: z3/xdv/trunk/setup.py
==============================================================================
--- z3/xdv/trunk/setup.py	(original)
+++ z3/xdv/trunk/setup.py	Tue May 25 14:11:10 2010
@@ -3,7 +3,7 @@
 
 setup(
     name='xdv',
-    version='0.3rc2',
+    version='0.3rc3',
     description='''\
 XDV implements a subset of Deliverance using a pure XSLT engine. With XDV, you
 "compile" your theme and ruleset in one step, then use a superfast/simple

From ldr at codespeak.net  Thu May 27 14:54:50 2010
From: ldr at codespeak.net (ldr at codespeak.net)
Date: Thu, 27 May 2010 14:54:50 +0200 (CEST)
Subject: [z3-checkins] r74808 - z3/xdv/trunk/examples/ploneorg
Message-ID: <20100527125450.D33C0282BE0@codespeak.net>

Author: ldr
Date: Thu May 27 14:54:49 2010
New Revision: 74808

Removed:
   z3/xdv/trunk/examples/ploneorg/default-extra.xsl
Modified:
   z3/xdv/trunk/examples/ploneorg/default.xml
Log:
update ploneorg example with css rules

Deleted: /z3/xdv/trunk/examples/ploneorg/default-extra.xsl
==============================================================================
--- /z3/xdv/trunk/examples/ploneorg/default-extra.xsl	Thu May 27 14:54:49 2010
+++ (empty file)
@@ -1,5 +0,0 @@
-
-
-    
-    
-

Modified: z3/xdv/trunk/examples/ploneorg/default.xml
==============================================================================
--- z3/xdv/trunk/examples/ploneorg/default.xml	(original)
+++ z3/xdv/trunk/examples/ploneorg/default.xml	Thu May 27 14:54:49 2010
@@ -1,11 +1,16 @@
 
-
-	
-	
+
+    
+    
+    
+	
+	
 
 	
-	
-	
+	
+	
 
 	
@@ -13,26 +18,26 @@
 	
 
 	
-	
+	
 
 	
-	 
-	
+	 
+	
 
 	
-	
-	
+	
+	
 	
-	 
+	 
 
 	
-	
+	
 
 	
-	
-	
+	
+	
 
-	
+	
 
     
 

From ldr at codespeak.net  Thu May 27 15:55:12 2010
From: ldr at codespeak.net (ldr at codespeak.net)
Date: Thu, 27 May 2010 15:55:12 +0200 (CEST)
Subject: [z3-checkins] r74810 - z3/xdv/trunk/lib/xdv
Message-ID: <20100527135512.DA7C8282BE0@codespeak.net>

Author: ldr
Date: Thu May 27 15:55:11 2010
New Revision: 74810

Modified:
   z3/xdv/trunk/lib/xdv/utils.py
Log:
unused code

Modified: z3/xdv/trunk/lib/xdv/utils.py
==============================================================================
--- z3/xdv/trunk/lib/xdv/utils.py	(original)
+++ z3/xdv/trunk/lib/xdv/utils.py	Thu May 27 15:55:11 2010
@@ -1,5 +1,3 @@
-from lxml import etree
-
 namespaces = dict(
     xdv="http://namespaces.plone.org/xdv",
     css="http://namespaces.plone.org/xdv+css",
@@ -11,20 +9,3 @@
 
 def fullname(namespace, name):
     return '{%s}%s' % (namespace, name)
-
-class Resolver(etree.Resolver):
-
-    def __init__(self, strings={}, files={}, filenames=[]):
-        self.strings = {}
-        self.files = {}
-        self.filenames = set(filenames)
-
-    def resolve(self, url, pubid, context):
-        result = self.strings.get(url)
-        if result is not None:
-            return self.resolve_string(result, context)
-        result = self.files.get(url)
-        if result is not None:
-            return self.resolve_file(result, context)
-        if url in self.filenames:
-            return self.resolve_filename(url, context)

From ldr at codespeak.net  Thu May 27 15:57:12 2010
From: ldr at codespeak.net (ldr at codespeak.net)
Date: Thu, 27 May 2010 15:57:12 +0200 (CEST)
Subject: [z3-checkins] r74811 - in z3/xdv/trunk/lib/xdv: . tests tests/001
	tests/002 tests/003 tests/004 tests/005 tests/006 tests/007
	tests/008 tests/009 tests/010 tests/011 tests/012 tests/013
	tests/014 tests/modify-theme
Message-ID: <20100527135712.2050A282BE0@codespeak.net>

Author: ldr
Date: Thu May 27 15:57:10 2010
New Revision: 74811

Modified:
   z3/xdv/trunk/lib/xdv/run.py
   z3/xdv/trunk/lib/xdv/tests/001/output.html
   z3/xdv/trunk/lib/xdv/tests/002/output.html
   z3/xdv/trunk/lib/xdv/tests/003/output.html
   z3/xdv/trunk/lib/xdv/tests/004/output.html
   z3/xdv/trunk/lib/xdv/tests/005/output.html
   z3/xdv/trunk/lib/xdv/tests/006/output.html
   z3/xdv/trunk/lib/xdv/tests/007/output.html
   z3/xdv/trunk/lib/xdv/tests/008/output.html
   z3/xdv/trunk/lib/xdv/tests/009/output.html
   z3/xdv/trunk/lib/xdv/tests/010/output.html
   z3/xdv/trunk/lib/xdv/tests/011/output.html
   z3/xdv/trunk/lib/xdv/tests/012/output.html
   z3/xdv/trunk/lib/xdv/tests/013/output.html
   z3/xdv/trunk/lib/xdv/tests/014/output.html
   z3/xdv/trunk/lib/xdv/tests/modify-theme/output.html
   z3/xdv/trunk/lib/xdv/tests/tests.py
Log:
Use UTF-8 output in tests to match xdvrun

Modified: z3/xdv/trunk/lib/xdv/run.py
==============================================================================
--- z3/xdv/trunk/lib/xdv/run.py	(original)
+++ z3/xdv/trunk/lib/xdv/run.py	Thu May 27 15:57:10 2010
@@ -75,7 +75,7 @@
     transform = etree.XSLT(output_xslt, access_control=access_control)
     content_doc = etree.parse(content, parser=etree.HTMLParser())
     output_html = transform(content_doc)
-    output_html.write(options.output, encoding='utf-8', pretty_print=options.pretty_print)
+    output_html.write(options.output, encoding='UTF-8', pretty_print=options.pretty_print)
     for msg in transform.error_log:
         print msg
 

Modified: z3/xdv/trunk/lib/xdv/tests/001/output.html
==============================================================================
--- z3/xdv/trunk/lib/xdv/tests/001/output.html	(original)
+++ z3/xdv/trunk/lib/xdv/tests/001/output.html	Thu May 27 15:57:10 2010
@@ -1,7 +1,7 @@
 
 
   
-    
+    
     A Deeper Look At xdv
   
   

Modified: z3/xdv/trunk/lib/xdv/tests/002/output.html
==============================================================================
--- z3/xdv/trunk/lib/xdv/tests/002/output.html	(original)
+++ z3/xdv/trunk/lib/xdv/tests/002/output.html	Thu May 27 15:57:10 2010
@@ -1,7 +1,7 @@
 
 
   
-    
+    
     
       <title>A Deeper Look At xdv
     

Modified: z3/xdv/trunk/lib/xdv/tests/003/output.html
==============================================================================
--- z3/xdv/trunk/lib/xdv/tests/003/output.html	(original)
+++ z3/xdv/trunk/lib/xdv/tests/003/output.html	Thu May 27 15:57:10 2010
@@ -1,7 +1,7 @@
 
 
   
-    
+    
     Second Theme Page Title
     
     

Modified: z3/xdv/trunk/lib/xdv/tests/004/output.html
==============================================================================
--- z3/xdv/trunk/lib/xdv/tests/004/output.html	(original)
+++ z3/xdv/trunk/lib/xdv/tests/004/output.html	Thu May 27 15:57:10 2010
@@ -1,7 +1,7 @@
 
 
   
-    
+    
     
     Second Theme Page Title
     

Modified: z3/xdv/trunk/lib/xdv/tests/005/output.html
==============================================================================
--- z3/xdv/trunk/lib/xdv/tests/005/output.html	(original)
+++ z3/xdv/trunk/lib/xdv/tests/005/output.html	Thu May 27 15:57:10 2010
@@ -1,7 +1,7 @@
 
 
   
-    
+    
     Second Theme Page Title
   
   

Modified: z3/xdv/trunk/lib/xdv/tests/006/output.html
==============================================================================
--- z3/xdv/trunk/lib/xdv/tests/006/output.html	(original)
+++ z3/xdv/trunk/lib/xdv/tests/006/output.html	Thu May 27 15:57:10 2010
@@ -1,7 +1,7 @@
 
 
   
-    
+    
     
     Second Theme Page Title
     

Modified: z3/xdv/trunk/lib/xdv/tests/007/output.html
==============================================================================
--- z3/xdv/trunk/lib/xdv/tests/007/output.html	(original)
+++ z3/xdv/trunk/lib/xdv/tests/007/output.html	Thu May 27 15:57:10 2010
@@ -1,7 +1,7 @@
 
 
   
-    
+    
     Ninth Theme Page Title
     
     

Modified: z3/xdv/trunk/lib/xdv/tests/008/output.html
==============================================================================
--- z3/xdv/trunk/lib/xdv/tests/008/output.html	(original)
+++ z3/xdv/trunk/lib/xdv/tests/008/output.html	Thu May 27 15:57:10 2010
@@ -1,7 +1,7 @@
 
 
   
-    
+    
     A Deeper Look At xdv
   
   

Modified: z3/xdv/trunk/lib/xdv/tests/009/output.html
==============================================================================
--- z3/xdv/trunk/lib/xdv/tests/009/output.html	(original)
+++ z3/xdv/trunk/lib/xdv/tests/009/output.html	Thu May 27 15:57:10 2010
@@ -1,7 +1,7 @@
 
 
   
-    
+    
     Theme Title