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.


XML 1.1 spec says the same:

HTML 4 spec agrees:

> > 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.

Attachment: signature.asc
Description: Digital signature

Zope3-users mailing list

Reply via email to