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 7946 - Auto Update cannot load update description using <!ENTITY> includes
Summary: Auto Update cannot load update description using <!ENTITY> includes
Status: VERIFIED DUPLICATE of bug 33097
Alias: None
Product: platform
Classification: Unclassified
Component: Autoupdate (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 normal (vote)
Assignee: issues@platform
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-10-18 18:36 UTC by Jesse Glick
Modified: 2004-02-19 08:56 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 Jesse Glick 2000-10-18 18:36:07 UTC
[dev-50] I tried to create an Auto Update *.xml update description which used
entity includes like this:

-----------%<---------- whatever.xml
<?xml version='1.0'?>

<!ENTITY all-updates SYSTEM "40_1.1.entities">
&all-updates;
-----------%<----------

-----------%<---------- 40_1.1.entities
<module_updates ...>
etc.
-----------%<----------

(I believe this is correct syntax??) When trying (in devel build #51) to check
the web for updates, I got:

URL : http://www.netbeans.org/updates/40_1.1_12344321.xml
org.xml.sax.SAXParseException: Document root element is missing.
	at com.sun.xml.parser.Parser.fatal(Parser.java:2817)
	at com.sun.xml.parser.Parser.fatal(Parser.java:2805)
	at com.sun.xml.parser.Parser.parseInternal(Parser.java:493)
	at com.sun.xml.parser.Parser.parse(Parser.java:284)
	at com.sun.xml.parser.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:95)
	at org.openide.loaders.XMLDataObject.parse(XMLDataObject.java:474)
	at org.openide.loaders.XMLDataObject.parse(XMLDataObject.java:433)
	at org.netbeans.modules.autoupdate.Updates.parseDocument(Updates.java:157)
	at org.netbeans.modules.autoupdate.Updates.access$0(Updates.java:151)
	at org.netbeans.modules.autoupdate.Updates$1.run(Updates.java:114)
	at org.openide.util.Task.run(Task.java:124)
	at
org.openide.util.RequestProcessor$ProcessorThread.run(RequestProcessor.java:562)

Shouldn't use of entity includes be supported? Perhaps you need to use a
validating parser to have them be replaced with the proper text?
Comment 1 Jesse Glick 2000-10-27 15:15:59 UTC
It may be that you can use entity includes, but not for the document root
element. Thus, the *.entities would include <module>....</module>, while the
*.xml would be <?xml?>, <!ENTITY>, then <module_description>, then
$all-updates;, then </module_description>. Please try that also.
Comment 2 akemr 2000-11-22 16:21:59 UTC
1. <!ENTITY all_modules..> tag must be used only within DTD or <!DOCTYPE...>
tag.
2. &all_modules cannot be used at the top level.

So, you can include autoupdate dtd, and use:
<module_updates>&all_modules</module_updates>

However, there is one problem more:
AU use DOM parsing and generated DOM-tree has
different structure then if I use the same XML,
but without entity include - all nodes in
*.entities file are shifted one level down in DOM-tree.

e.g.
method document.getDocumentElement().getChildNodes() doesn't return
<module_group>...

method document.getElementsByName( "license" ) doesn't find <license> tag.

I talked about this problem with Petr Kuzel and in his opinion
it's problem of SUN's parser.
Comment 3 Quality Engineering 2003-06-30 13:46:58 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.
Comment 4 Quality Engineering 2003-06-30 13:49:06 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.
Comment 5 Jan Chalupa 2003-10-30 12:07:09 UTC
A mistakenly closed RESOLVED LATER/REMIND issue. Reopening.
Comment 6 Petr Hrebejk 2003-11-06 14:33:05 UTC

*** This issue has been marked as a duplicate of 33097 ***
Comment 7 Marian Mirilovic 2004-02-19 08:56:25 UTC
verified duplicate