Tag names are converted to lower case in XML mode

Bug #572579 reported by Fred Drake
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zope.pagetemplate
Invalid
Undecided
Unassigned
zope.tal
Invalid
Undecided
Unassigned

Bug Description

In XML mode, zope.tal converts tag and attribute names to lower case.

It should not.

Revision history for this message
Fred Drake (fdrake) wrote :

This gets to some pathos in the page template API. If we write new source for the template, and then set the content type, we get into a situation where the template won't get re-parsed, and the wrong parsing mode may be used.

Consider:

    import zope.pagetemplate.pagetemplate

    source = """\
    <?xml version="1.0" encoding='UTF-8'?>
    <xml>
      <TEST aTTr="dfsfsf"/>
    </xml>
    """

    pt = zope.pagetemplate.pagetemplate.PageTemplate()
    pt.write(source)
    pt.content_type = 'text/xml'

If instead the content_type is set first:

    pt.content_type = 'text/xml'
    pt.write(source)

or the pt_edit() API is used:

    pt.pt_edit(source, 'text/xml')

everything is updated correctly.

Changed in zope.tal:
status: New → Invalid
Revision history for this message
Fred Drake (fdrake) wrote :

This is an API wart for zope.pagetemplate, not a bug in zope.tal.

Since pt_edit() is the only documented external API for updating either the content type or the template source, this isn't actually a bug in zope.pagetemplate.

It may be worthwhile to provide a more intuitive interface to changing just the content type of the template.

Revision history for this message
Fred Drake (fdrake) wrote :

As a bug, this is invalid, since the example code that demonstrates the behavior described isn't part of the documented API.

A feature request that extends the API may be filed separately.

Changed in zope.pagetemplate:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.