[yunqa.de] Re: DIHtmlParser: Empty Attribute Problem

  • From: "Mike Dixon" <mike@xxxxxxxxxxx>
  • To: <yunqa@xxxxxxxxxxxxx>
  • Date: Thu, 30 Jul 2009 10:37:41 -0500

Thanks, that worked. 

> -----Original Message-----
> From: yunqa-bounce@xxxxxxxxxxxxx 
> [mailto:yunqa-bounce@xxxxxxxxxxxxx] On Behalf Of Delphi Inspiration
> Sent: Thursday, July 30, 2009 7:40 AM
> To: yunqa@xxxxxxxxxxxxx; yunqa@xxxxxxxxxxxxx
> Subject: [yunqa.de] Re: DIHtmlParser: Empty Attribute Problem
> 
> At 14:53 30.07.2009, Mike Dixon wrote:
> 
> >I'm using DIHtmlParser and the CharCase and Writer plugin to simply 
> >convert an html page to lowercase before saving the file.
> >
> >My Problem is that when I have the following code:
> >
> ><img src="foo.gif" alt="" />
> >
> >It is converted to:
> >
> ><img src="foo.gif" alt/>
> >
> >Notice the ="" is missing from the output.
> >
> >I've tried setting DIHParser.TrimAttribValues := False; but that did 
> >not help.
> >
> >What am I missing?
> 
> Set the following properties of your TDIHtmlWriterPlugin instances:
> 
>   TDIHtmlWriterPlugin.EmptyHtmlAttribValues := True;
>   TDIHtmlWriterPlugin.QuoteHtmlTags := qvAlways;
> 
> Btw: The automatic "conversion" was choosen because IMO an 
> empty attribute value is equal to no attribute value in terms 
> of HTML. Accordingly, the following two tags represent identical HTML:
> 
>   <img src=test.png alt="" />
>   <img src=test.png alt />
> 
> I could not find the relevant section of the specification 
> right now, but I checked that Firefox renders them exactly 
> the same with explicitly "blank" alternative text. In this, 
> they are different from
> 
>   <img src=test.png />
> 
> which is rendered with explicitly "missing" alternative text.
> 
> Ralf  
> 
> _______________________________________________
> Delphi Inspiration mailing list
> yunqa@xxxxxxxxxxxxx
> //www.freelists.org/list/yunqa
> 
> 
> 

_______________________________________________
Delphi Inspiration mailing list
yunqa@xxxxxxxxxxxxx
//www.freelists.org/list/yunqa



Other related posts: