Bug 397936 - Kate reports errors for syntax xml file but NO DETAILS
Summary: Kate reports errors for syntax xml file but NO DETAILS
Status: RESOLVED NOT A BUG
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (other bugs)
Version First Reported In: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-27 16:08 UTC by trijezdci
Modified: 2019-08-27 22:58 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description trijezdci 2018-08-27 16:08:11 UTC
I have made a new syntax highlighting profile xml file. When opening a file with the associated file extension, Kate opens a dialog box reporting "warning(s) and/or error(s)" and displays a button to click on for details. When I click that button, it opens another dialog box, but the details are empty.

I thoroughly checked the xml file and cannot find anything wrong with it. I checked that every list name is actually referenced, that every context referenced is actually defined, that every attribute referenced actually has a style entry. I also checked that no regex shadows that of another rule.

Besides, everything works as intended. I used xmllint to check the file and it did not report any warnings nor errors. However, when I use the --valid switch, xmllint reports that the language.dtd that ships with Kate has a "content error":

$ xmllint --valid gll.xmllanguage.dtd:1: parser error : Content error in the external subset
<!DOCTYPE dtd PUBLIC "-//Norman Walsh//DTD DTDParse V2.0//EN"
^

When I installed the XML validation plugin for Kate and use the XML menu to validate the file, Kate reports the same error then. This is not surprising since the Kate plugin uses xmllint. Xmllint expects the DTD file in the same directory as the file to be validated, so I had to copy the language.dtd file first.

In any event, it is very annoying to get a dialog box that reports warnings or errors but doesn't provide any detail. I have to dismiss the dialog box every time I edit a file that uses the syntax profile. So would anybody else using this (as I intend to contribute it).

The xml file is at:

https://github.com/trijezdci/gll/blob/master/syntax-highlighting/kate/gll.xml
Comment 1 Dominik Haumann 2018-08-28 21:42:00 UTC
Your first context does not have a name. I think all contexts require a valid non-empty name. Could you try this?
Comment 2 trijezdci 2018-08-29 04:43:44 UTC
(In reply to Dominik Haumann from comment #1)
> Your first context does not have a name. I think all contexts require a
> valid non-empty name. Could you try this?

Thanks, I just tried that but it still complains.

In any event, although I hope to find the cause, I also believe it is a bug to report warnings or errors without telling what the warnings or errors actually are, so in my view, regardless of what causes the warning/error notification, the lack of a detailed warning/error message or report ought to be fixed.
Comment 3 Jonathan Poelen 2019-08-27 22:58:33 UTC
I don't know where language.dtd is located, but the current validation uses XML Schema Definition (language.xsd) to validate the format. The content is very different from a dtd file and the verification is done with --schema rather than --valid.

xmllint --noout --schema data/schema/language.xsd file.xml

The xmllint error seems to come from the dtd parser that does not recognize the format.