AdvMemo and AdvXMLMemoStyler with VCL Styles

Hi,

I've added VCL styles to one of my apps and AdvMemo together with AdvXMLMemoStyler goes wild.

1) AdvXMLMemoStyler: Syntax-Parsing breaks when multiple http URLs in KML xsi:schemaLocation
    <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/kml/2.2 http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd http://www.google.com/kml/ext/2.2 http://code.google.com/apis/kml/schema/kml22gx.xsd http://www.w3.org/2005/Atom http://schemas.opengis.net/kml/2.2.0/atom-author-link.xsd" version="2.2" creator="TrackTool v3.1.0.287" name="Auf-Hulb_Ab-Herrenberg.fsp" time="2019-02-05T15:42:30.797Z">
All subsequent XML is not parsed correctly.

2) AdvXMLMemoStyler: Highlighting of URLs does not work reliably in XML
   - Works only if not in "": xsi:schemaLocation="http://www.opengis.net/kml/2.2"
   - Works only if surrounded by SPACES: <href>http://earth.google.com/images/kml-icons/track-directional/track-none.png</href>

3) AdvXMLMemoStyler: Marks URL as comment due to // in http://...
<href>http://earth.google.com/images/kml-icons/track-directional/track-none.png</href>

4) The VCL style colors are not used automatically by AdvXMLMemoStyler. See white background color using a dark VCL style.

I have a simple demo project which exposes all this issues, that I will upload.

Cheers,
Stefan

1)

I cannot see how the use of the VCL Styles would have any impact on the processing of the XML itself.

2)
If you do not want that the styler background colors are used for the TAdvMemo, set the background colors in this styler to clNone. 
A demo project could be downloaded here:

https://www.dropbox.com/sh/h39qyn8tyg7gj0o/AACZIprmBxxcOlQeloCtfPoZa?dl=0

The parsing issues are not related to the use of styles.

4) OK, this issue could be solved with clNone:

  with AdvXMLMemoStyler1 do
  begin
    CommentStyle.BkColor := clNone;
    NumberStyle.BkColor  := clNone;
    AllStyles[0].BGColor := clNone;
    AllStyles[1].BGColor := clNone;
    AllStyles[2].BGColor := clNone;
    AllStyles[3].BGColor := clNone;
  end;

I see you have  an attribute with multiple URLs separated by a space.
I'm not sure this is the right notation. By replacing the space with %20, this renders correct here.

All examples and definitions I find for KML and GPX has the URLs in attributes separated by a simple SPACE, not the HTML equivalent %20.

We have applied an improvement to address this. The next update will have this improvement.

Great, thanks for listening.
Have you solved all parsing issues 1), 2) and 3) from my first post?

Set AdvMemo.URLDelimiters := #32+'"'+'''';
Bruno Fierens2019-02-09 16:06:12

That's much better with this setting!
Just issue 3) remains.
In the following node the http is interpreted as comment due to the //:
          <href>http://earth.google.com/images/kml-icons/track-directional/track-none.png</href>

OK. solved the last issue as well:

  with AdvMemo1 do
  begin
    URLDelimiters    := #32 + '"' + '''' + '>' + '<';
    UrlStyle.BkColor := clNone;
  end;

  with AdvXMLMemoStyler1 do
  begin
    LineComment := '';
  end;

Thanks for informing.