This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 58340 - Refresh all files doesn't re-read DTD
Summary: Refresh all files doesn't re-read DTD
Status: RESOLVED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Text-Edit (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-26 15:02 UTC by Alexander Kouznetsov
Modified: 2007-09-25 01:33 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kouznetsov 2005-04-26 15:02:01 UTC
Steps to reproduce:
- Consider an xml file and its DTD
- Open both files in NB
- Modify DTD somehow, save it
- Click File > Refresh All Files
- Try to use autocomplete. You could ensure that the updated DTD isn't re-load

To reload DTD user needs to perform Validate XML action.

The best solution is to automatically re-load DTD just when it is modified.
Comment 1 Marek Fukala 2005-11-28 14:13:18 UTC
Not easy to fix... there is no direct glue between the edited XML document and
the declared DTD. The DTD is parsed via SAX parser with DTD handler so the
XMLCompletion code has no idea where the DTD comes from :-(. This could probably
be fixed by attaching listeners to files in the SAX Handler's resolveEntity(...)
method and listen on their changes, but this seems to be dangerous three weeks
before HR => setting TM to next version.
Comment 2 Marek Fukala 2006-07-21 11:48:29 UTC
I'll try to implement the proposed solution.
Comment 3 Marek Fukala 2006-08-28 18:34:57 UTC
fixed - the GrammarManager now listens on all external DTDs and reloads the
grammar if any of the files changes (and is saved).

checking in core/src/org/netbeans/modules/xml/dtd/grammar/DTDGrammar.java;
/cvs/xml/core/src/org/netbeans/modules/xml/dtd/grammar/DTDGrammar.java,v  <-- 
DTDGrammar.java
new revision: 1.19.54.2.2.2; previous revision: 1.19.54.2.2.1
done
Checking in core/src/org/netbeans/modules/xml/dtd/grammar/DTDParser.java;
/cvs/xml/core/src/org/netbeans/modules/xml/dtd/grammar/DTDParser.java,v  <-- 
DTDParser.java
new revision: 1.7.54.1.2.2; previous revision: 1.7.54.1.2.1
done
Checking in
text-edit/src/org/netbeans/modules/xml/text/completion/GrammarManager.java;
/cvs/xml/text-edit/src/org/netbeans/modules/xml/text/completion/GrammarManager.java,v
 <--  GrammarManager.java
new revision: 1.8.42.1.2.2; previous revision: 1.8.42.1.2.1
done