Join  |  Sign in
XML Editor

15-Nov-2017 05:10 AM

Abhishek

Abhishek

Posts: 5

Hello

Can the code editor be used to edit generic XML files?

We are looking for automatic tag closing, error indication in case of invalid XML and node/attribute coloring.

Thanks
Abhishek
  Reply

15-Nov-2017 09:36 PM

Andrew Medvedev

Andrew Medvedev

Posts: 49

Hi,

Please try the following demo QuickStart Projects\Editor\Parsers\Advanced Syntax Parsing (you can run it from Demo Explorer), and select XML in the Language combobox.

It does provide coloring of tags and parameters, should be pretty easy to support underlining of invalid tags (i.e. if closing tag does not match open tag), please let me know if you need parser to catch any other errors as well.
Could yo also clarify how you expect automatic tag closing to work?

regards,
Andrew
  Reply

16-Nov-2017 05:30 AM

Abhishek

Abhishek

Posts: 5

Saw the sample - Coloring of tags and parameters looks good.

Current requirement is a basic one. So we need:

- Underlining of invalid tags (closing not matching opening)

- Automatic tag closing: As soon as a tag is typed, the closing tag is automatically inserted. Optionally, when a parameter is typed with a quotation mark, the closing quotation mark is automatically inserted.

- Pretty Print: The editor can convert any xml into properly formatted xml with cr/lf and indentation.
  Reply

16-Nov-2017 08:32 PM

Andrew Medvedev

Andrew Medvedev

Posts: 49

Hi,

yes these are possible.
Please have a look at this demo:
http://www.alternetsoft.com/projects/XmlDemo.zip

You can use "Ctrl+K+D"  key combination to smart format document.

regards,
Andrew

  Reply