From daniel at whitehouse.id.au Tue Sep 8 05:27:34 2009 From: daniel at whitehouse.id.au (Daniel White) Date: Tue, 8 Sep 2009 15:27:34 +1000 Subject: [Bese-devel] yaclml: TAL and namespaces without packages Message-ID: <20090908152734.5ae0d2e0@whitehouse.id.au> The current problem is that TAL requires all XML namespaces to have an associated package. In my case, I have a fairly sizeable template with a lot of tags and attributes and I don't particularly want to hand generate tags for then entire template. I've attached a preliminary patch, but it needs some more work yet. The basic approach the patch takes is to: * Signal a namespace error only when the XML namespace is not properly declared. An associated package is not required. * Namespace declarations that are unresolvable are left as attributes. * Only replace the tag name with a symbol if the namespace is resolvable. * Only make a keyword from an attribute if it is qualified by a namespace (e.g. tal:replace) or its tag has a package associated with its namespace. This is done for case sensitivity reasons. * Generates an arbitrary tag (in TRANSFORM-LXML-FORM) if the name is a string. I'm not sure whether the change makes the parser logic much more complicated. Two options here: * Move all logic for mapping tags/attributes to symbol to a separate pass when the parser is completed. * Similar to above, but replace the entire parser with CXML or XMLS. The other issue is when transforming the lxml into yaclml tags there doesn't seem to be an easy way to generate arbitrary tags that are constant folded at compile-time by yaclml. At present, I've defined a custom tag that allows the name to be specified. For example, ( WRAP-IN-TAG is about the closest to what is needed, but it automatically downcases the tag name and isn't folded at compile time by yaclml. Also missing at the moment is the ability to enable or disable all of this, as I imagine it should be disabled by default for both backwards compatibility and keeping the stricter parser for the general case. Thoughts, suggestions? -- Daniel White -------------- next part -------------- A non-text attachment was scrubbed... Name: tal-namespaces.patch Type: text/x-patch Size: 9746 bytes Desc: not available URL: From attila.lendvai at gmail.com Tue Sep 29 14:12:37 2009 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Tue, 29 Sep 2009 16:12:37 +0200 Subject: [Bese-devel] Patch for fixing the failing test cases sent earlier In-Reply-To: <2F611DC3-768D-4ED4-985E-C53D7E04668B@nikolaus-demmel.de> References: <2F611DC3-768D-4ED4-985E-C53D7E04668B@nikolaus-demmel.de> Message-ID: > Regards, > Niko thanks for these patches, i've incorporated some of them into our branches crediting you in the commit messages. they are available at http://dwim.hu/darcsweb/darcsweb.cgi -- attila