[
https://issues.apache.org/jira/browse/TAP5-171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647524#action_12647524
]
Folke Behrens commented on TAP5-171:
------------------------------------
Sorry, I don't have a Tapestry project at hand right now. IIRC, I added a
DOCTYPE to my templates and the XML parser automatically validated the XHTML,
which is a good thing. but when the output was written optional attributes with
their default values were included.
It's not really a problem. It just produces undesired output that can easily be
filtered by using Attributes2 which is part of every JRE.
Another possible solution would be to completely disable DTD loading and not
just validation. (Xerces2 still loads external DTDs even if validation is
disabled. This makes it possible to have HTML entities like without the
actual HTML validation being done, but can be switched off, too. Check
Xerces2's special SAX features.)
I see if I can reproduce this with the latest version of Tapestry5 and then
send you the test templates and a patch.
> Consider checking for org.xml.sax.ext.Attributes2
> -------------------------------------------------
>
> Key: TAP5-171
> URL: https://issues.apache.org/jira/browse/TAP5-171
> Project: Tapestry 5
> Issue Type: Improvement
> Environment: Sun JDK 1.5
> Reporter: Folke Behrens
> Priority: Trivial
>
> 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.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]