On Sun, Jan 27, 2008 at 01:08:09PM -0500, Stephan Richter wrote:
On Monday 17 December 2007, David Pratt wrote:
Hi. Is there solution for create a single quoted attribute using
tal:attributes containing literal double quoted items. I am using a
python method for generating the string. I understand structure will
unquote but it does not work with an attribute.
Well, attributes must always be quoted based on the XML spec, right.
Otherwise
TAL could produce invalid XML. What does the spec actually say about this?
XML 1.0 spec says this:
Attribute ::= Name Eq AttValue
AttValue ::= '' ([^] | Reference)* ''
| ' ([^'] | Reference)* '
In other words, you can use either double quotes or single quotes.
References:
http://www.w3.org/TR/REC-xml/#dt-stag
http://www.w3.org/TR/REC-xml/#NT-AttValue
XML 1.1 spec says the same:
http://www.w3.org/TR/xml11/#dt-stag
http://www.w3.org/TR/xml11/#NT-AttValue
HTML 4 spec agrees:
http://www.w3.org/TR/html401/intro/sgmltut.html#h-3.2.2
I see there is a new
z3c.tal package based on lxml. Will I have to go as far as customizing
tal to do this? I realize this may be best on the zpt list but it it
rarely if ever used these days. Many thanks.
Well, if the XML specification allows for your output, we could consider it
not working this way a bug.
Why? A missing feature, surely, but why would generating attr=quot;
instead of attr='' be considered a bug?
However, it would make the code much more
complicated, I think (unless we support structure as well in this case).
Marius Gedminas
--
Despite all appearances, your boss is a thinking, feeling, human being.
signature.asc
Description: Digital signature
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users