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 31961

Summary: XML validation of generated AU catalogs
Product: www Reporter: Jesse Glick <jglick>
Component: Builds & RepositoriesAssignee: Michal Zlamal <mzlamal>
Status: RESOLVED FIXED    
Severity: blocker CC: issues, jrechtacek, mzlamal, rbalada, rnovak
Priority: P2    
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 31962    
Bug Blocks: 33098, 33519    

Description Jesse Glick 2003-03-12 19:00:08 UTC
I just casually tried to validate a typical update
XML file and found it full of errors. Here is a
sample from 35_1.6_.xml:

Checking
file:/space/src/nb_all/www/www/updates/alpha/35_1.6_.xml...
Referenced entity at
"http://www.netbeans.org/dtds/autoupdate-catalog-1_0.dtd".
Referenced entity at
"file:/space/src/nb_all/www/www/updates/alpha/35_alpha_release.ent".
Referenced entity at
"file:/space/src/nb_all/www/www/updates/alpha/35_alpha_daily.ent".
Attribute "OpenIDE-Module-Deprecated" must be
declared for element type "manifest". [856] 
Attribute "OpenIDE-Module-Deprecation-Message"
must be declared for element type "manifest". [856] 
Attribute "OpenIDE-Module-Deprecated" must be
declared for element type "manifest". [930] 
Attribute "OpenIDE-Module-Deprecation-Message"
must be declared for element type "manifest". [930] 
Attribute "OpenIDE-Module-Module-Install" must be
declared for element type "manifest". [1,224] 
Attribute "OpenIDE-Module-Name" is required and
must be specified for element type "manifest".
[2,529] 
The content of element type "module_group" must
match "(module_group|module)*". [14] 
The content of element type "module_updates" must
match
"((notification?,(module_group|module)*,license*)|error)".
[16] 
XML validation finished.

And for dev it is even worse:

Checking
file:/space/src/nb_all/www/www/updates/alpha/dev_1.6_.xml...
Referenced entity at
"http://www.netbeans.org/dtds/autoupdate-catalog-1_0.dtd".
Referenced entity at
"file:/space/src/nb_all/www/www/updates/alpha/dev_alpha_release.ent".
Referenced entity at
"file:/space/src/nb_all/www/www/updates/alpha/dev_alpha_daily.ent".
Attribute "OpenIDE-Module-Deprecated" must be
declared for element type "manifest". [856] 
Attribute "OpenIDE-Module-Deprecation-Message"
must be declared for element type "manifest". [856] 
Attribute "OpenIDE-Module-Deprecated" must be
declared for element type "manifest". [930] 
Attribute "OpenIDE-Module-Deprecation-Message"
must be declared for element type "manifest". [930] 
Attribute "OpenIDE-Module-Module-Install" must be
declared for element type "manifest". [1,224] 
Attribute "OpenIDE-Module-Name" is required and
must be specified for element type "manifest".
[2,526] 
Attribute "distribution" is required and must be
specified for element type "module". [2,561] 
Element type "l10n" must be declared. [2,567] 
The content of element type "module" must match
"(description?,module_notification?,external_package*,manifest)".
[2,568] 
Attribute "distribution" is required and must be
specified for element type "module". [2,573] 
Element type "l10n" must be declared. [2,579] 
The content of element type "module" must match
"(description?,module_notification?,external_package*,manifest)".
[2,580] 
Attribute "distribution" is required and must be
specified for element type "module". [2,585] 
Element type "l10n" must be declared. [2,592] 
The content of element type "module" must match
"(description?,module_notification?,external_package*,manifest)".
[2,593] 
Attribute "distribution" is required and must be
specified for element type "module". [2,598] 
Element type "l10n" must be declared. [2,605] 
The content of element type "module" must match
"(description?,module_notification?,external_package*,manifest)".
[2,606] 
Attribute "distribution" is required and must be
specified for element type "module". [2,611] 
Element type "l10n" must be declared. [2,618] 
Too many errors, stopping further checking.
XML validation finished.

(Note that the file is still using the old DOCTYPE
declaration even while using 2.0 DTD features!)

I *strongly* recommend that the <makenbm> and
<makeupdatedesc> tasks, or whatever all you are
using, run a full XML validation step as the last
thing they do and fail with a build error if it
reports that the file is invalid. We cannot be
publishing corrupt XML and expect Auto Update to
work with it. This should be fixed for 3.5.
Comment 1 Jesse Glick 2003-03-12 19:19:21 UTC
Even more ridiculous: note that the public and system ID do not match
at all:

<!DOCTYPE module_updates PUBLIC "-//NetBeans//DTD Autoupdate Module
Info 1.0//EN" "http://www.netbeans.org/dtds/autoupdate-catalog-1_0.dtd" [
...
]>
Comment 2 rbalada 2003-03-13 08:27:09 UTC
This is my code.
Comment 3 rbalada 2003-03-13 17:20:12 UTC
Updated public and system ids of alpha/[dev|35]_1.6_.xml update centres.


Checking in www/www/updates/alpha/dev_1.6_.xml;
/shared/data/helm/cvs/repository/www/www/updates/alpha/dev_1.6_.xml,v
 <--  dev_1.6_.xml
new revision: 1.4; previous revision: 1.3
done
Checking in www/www/updates/alpha/35_1.6_.xml;
/shared/data/helm/cvs/repository/www/www/updates/alpha/35_1.6_.xml,v 
<--  35_1.6_.xml
new revision: 1.2; previous revision: 1.1
done
Comment 4 rbalada 2003-03-14 10:38:24 UTC
Michal,
please implement xml validation in
nbbuild/antsrc/org/netbeans/nbbuild/MakeUpdateDesc.java
for file desc.getAbsolutePath() just right after the last pw.close()
(around line 309).
Thanks
Comment 5 Jesse Glick 2003-03-14 20:08:50 UTC
Did anyone actually correct the DTD validation errors? If not, this is
 still a DEFECT.
Comment 6 Michal Zlamal 2003-03-28 15:08:55 UTC
Ruda fixed the generation of XML according the DTD.
Comment 7 Jesse Glick 2003-03-28 15:31:15 UTC
I still consider this a priority. We have fixed a number of validation
problems. We have not actually fixed them all (see validation errors
in my original comments to this bug), and we could accidentally revert
any fixes we made if they are not validated.
Comment 8 Jesse Glick 2003-04-21 17:08:44 UTC
There are still validation errors. Besides things already reported
elsewhere, there are e.g.:

Attribute "OpenIDE-Module-Deprecated" must be declared for element
type "manifest". [937] 
Attribute "OpenIDE-Module-Deprecation-Message" must be declared for
element type "manifest". [937] 
Attribute "OpenIDE-Module-Name" is required and must be specified for
element type "manifest". [2,616] 

Probably many more, but Xerces reports:

Too many errors, stopping further checking.

due to the huge number of errors caused by issue #32437.
Comment 9 Jesse Glick 2003-05-09 15:23:18 UTC
Here's another error that should have been easily caught during
creation of the catalog file.

Say the NBM does not include a distribution location, i.e.
distribution="http://${dist.base}/archiver.nbm" on <makenbm>. This is
natural enough; the NBM itself does not know where it will be kept.
But <makeupdatedesc> does not *add* it. The resulting catalog file
includes an entry with no distribution location. AU then chokes
because it was given an invalid entry (issue #33519).

Since the distribution location is #REQUIRED in the DTD, this kind of
error would have been caught immediately by validation, rather than
waiting for someone to come across it by accident.
Comment 10 Jiri Rechtacek 2004-02-16 15:29:57 UTC
*** Issue 33519 has been marked as a duplicate of this issue. ***
Comment 11 Michal Zlamal 2005-02-04 14:44:13 UTC
I would say this was already done months ago.
Comment 12 Jesse Glick 2005-04-07 18:38:48 UTC
Not really; I filed issue #57634.