tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Strand (JIRA)" <j...@apache.org>
Subject [jira] Updated: (TAP5-171) Filter out attributes with default value (from DTD) when parsing templates
Date Fri, 03 Dec 2010 04:48:11 GMT

     [ https://issues.apache.org/jira/browse/TAP5-171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Martin Strand updated TAP5-171:
-------------------------------

    Attachment: TAP5-171 5.2.4.patch

Now that Tapestry 5.2 is back to using SAX this issue might be worth looking into again.

The problem is that certain default attribute values are rendered in the resulting HTML eventhough
they are not present in the template. Specifically, every <a> element in a template
automatically gets a shape="rect" attribute in the rendered HTML.

I adapted Folke's patch to 5.2.4 and also added a small testcase.

> Filter out attributes with default value (from DTD) when parsing templates
> --------------------------------------------------------------------------
>
>                 Key: TAP5-171
>                 URL: https://issues.apache.org/jira/browse/TAP5-171
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.18
>         Environment: Sun JDK 1.5
>            Reporter: Folke Behrens
>            Assignee: Howard M. Lewis Ship
>            Priority: Minor
>         Attachments: attributes2-dtd-default.patch, TAP5-171 5.2.4.patch, Test.html
>
>
> Consider testing for org.xml.sax.ext.Attributes2 and use Attributes2.isSpecified(int)
to check if the attribute is really specified or just a default declaration.
> With this you can e.g. test if <a  shape="rect" > is really set. Test for "http://xml.org/sax/features/use-attributes2"
or just use "instanceof":
> if (attributes instanceof Attributes2) {
>     if (( (Attributes2)attributes ).isSpecified(i)) {
>         // do something
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message