VSCodeUI5Plugin icon indicating copy to clipboard operation
VSCodeUI5Plugin copied to clipboard

XML linter complains about DOCTYPE declaration

Open richardatsap opened this issue 4 years ago • 2 comments

Describe the bug I use a DOCTYPE declaration to reuse definitions for attributes. The linter complains about those. I noticed that the linter has trouble when the namespace changes in inner elements. Maybe not a good practice but it may be a related issue. Adding <!-- @ui5ignore --> does not work either.

To Reproduce Define an xml view containing a DOCTYPE declaration at the beginning if the file.

Expected behavior The linter should not complain. UI5 has no problems using the declarations.

Screenshots ui5 doctype declaration

richardatsap avatar Aug 17 '21 09:08 richardatsap

Hi,

To be frank I see this possibility for the first time within UI5 :) I have researched my current code base and unfortunately it's not an easy task to do in order to support this. I am using self written XML parser and it would be pretty time consuming to introduce this type of tags. The main reason behind it is basically a different syntax than a usual xml tag, e.g. tag is not closed via /> or </TagName> and attributes here are not attributes at all. This requires a big effort to make the current parser to support such features, and even then all the linters and XML based logic should be adjusted as well. I will leave this issue as enhancement and I will try to implement this if I have enough free time.

iljapostnovs avatar Sep 01 '21 18:09 iljapostnovs

Hi,

thanks for looking into this. Afaik VSCode uses Javascript, Maybe it's worth having a look which parser UI5 uses as it has no problems with correctly parsing the declaration. I use this to define "variables" which I can use throughout the file.

Kind Regards Richard

richardatsap avatar Sep 02 '21 06:09 richardatsap

Hi @richardatsap,

Long time, but finally found some time for this :) Please let me know if it works

iljapostnovs avatar Feb 04 '23 17:02 iljapostnovs

Hi,

works great! Thank you very much for fixing.

Kind Regards Richard

richardatsap avatar Feb 06 '23 07:02 richardatsap