PreviousNextTracker indexSee it online !

(190/211) 4020 - XML with entity and xml schema produces error and breaks jEdit UI

When I open XML file then jEdit writes NullPointerException on STDERR and UI stops refreshing properly.

Steps to reproduce:
1. extract files from testCase.tar.gz to one directory
2. start jEdit
3. open file apiEntities.xml
4. NullPointerException message is written on STDERR
5. put cursor to the last line of apiEntities.xml file
6. press Enter and keep it pressed for a while
7. line numbers in gutter bar stops updated properly after few seconds
8. release Enter key
9. press and keep Up key
10. line numbers in gutter bar are updated but only from to bottom to the current cursor position (so for example you can see that line 7 is followed by line 63)
11. Keep the Up key pressed untill it hits begin of document
12. You can see that document content is not displayed properly (some lines are missing)
13. You can see other anomalies. For example try to click to some docked panel and then click them again to be not displayed (part of plugin window remains visible)

You can see something similar to attached screenshot.


jEdit version number: 5.2.0
platform: Gentoo Linux
Java version: Oracle Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Activity log: see attached activit.log file
Plugins: see attached plugin-list.txt file

Submitted enca - 2016-09-09 17:46:26.975000 Assigned kerik-sf
Priority 5 Labels XML Plugin
Status pending Group minor bug
Resolution fixed

Comments

2016-09-12 14:58:13.948000
kerik-sf

- **assigned_to**: Eric Le Lay

2016-09-12 14:58:14.383000
kerik-sf

Confirmed! Thanks for reporting.

1. a NullPointerException in xml.parser.XSDSchemaToCompletion.xsAttributeToElementDecl shouldn't happen
2. causes an error with null message in ErrorList
3. which causes exception when painting the editor (shouldn't happen)

2016-09-13 07:33:18.445000
kerik-sf

- **status**: open --> pending-fixed

2016-09-13 07:33:18.700000
kerik-sf

fixed in r24528.
It will be in XMLPlugin 3.0.5.
Meanwhile you can get a pre-release here: http://cloudy.elelay.fr/dropbox/2016-09-13-XML-fix-4020.tbz2
Extract and move XML.jar to ~/.jedit/jars/

2016-09-13 08:28:44.374000
enca

**Many thanks for quick response.
I can approve that no errors are reported with the pre-release version. Also GUI works well.**

But when I try to validate the apiEntities.xml from testCase.tar.gz in jEdit than it says that 'Element type "apiEntities" must be declared.'
The problem seems to be the fact that I'm using XML Schema (for validation) simultaneously with DOCTYPE definition (for entity expansion). It seems that XML Schema is ignored in this case. I'm not sure if it is problem of XML plugin, Xerces plugin or Xerces itself. I want to create separate bug for this but I don't know where the correct place is (jEdit or Xerces).

2016-09-13 08:55:52.878000
kerik-sf

You can disable DTD validation in XML plugin.
From XML User's guide:
> DTD Validation can be disabled on a per-buffer basis by inserting
> the following in the first or last 10 lines of the buffer:
>
> <!-- :xml.validate.ignore-dtd=true: -->

2016-09-13 09:12:14.415000
enca

Disabling DTD validation works well. I will create separate feature request for possibility to disable it on a global basis.

This issue is fixed from my point of view. Thanks again.

2016-09-13 19:37:40.631000
ezust

Thank *you* vaclav, for the detailed steps to reproduce.