[yunqa.de] Re: HTMLParser - attribute escaping for xml

  • From: Delphi Inspiration <delphi@xxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Tue, 5 Apr 2016 17:41:45 +0200

On 01.04.2016 14:41, Delphi Inspiration wrote:

On 01.04.2016 13:43, Michael Schwarzl wrote:

thank you for your reply! I added the other three replace too:

WC_LESS_THAN_SIGN: WriteBufW('&lt;', 4);

WC_GREATER_THAN_SIGN: WriteBufW('&gt;', 4);

WC_APOSTROPHE: WriteBufW('&apos;', 6);

WC_QUOTATION_MARK: WriteBufW('&quot;', 6);

I fail to see where you could add the above 6 lines without
receiving a "duplicate case label" compilation error. Except for 
WC_GREATER_THAN_SIGN, the case statement already covers the
remaining options.

The problem was caused by applying changes to an old version of
DIUnicodeHtmlWriter.pas. It worked well with the latest release.

The new DIHtmlParser 7.8.0 is now available to address "<" entities
in attribute values. There are now three new elements to the
TDIHtmlWriterPlugin.PredefinedEntities property:

* peLtAttribValue to encode "<" as &lt; in attribute values.
  Required for XML conformance.
* peGtAttribValue to encode ">" as &gt; in attribute values.
* peQuotNum to encode quotation mark as numeric &#34; instead of &quot;.

The latest DIHtmlParser is available for download here:

  http://yunqa.de/delphi/products/htmlparser/index

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



Other related posts: