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 113574 - Schema based code completion using catalog bug
Summary: Schema based code completion using catalog bug
Status: RESOLVED DUPLICATE of bug 112329
Alias: None
Product: xml
Classification: Unclassified
Component: Text-Edit (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P3 blocker with 3 votes (vote)
Assignee: issues@xml
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-23 09:01 UTC by cr
Modified: 2007-09-25 01:33 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
sample project (10.59 KB, application/octet-stream)
2007-08-23 09:02 UTC, cr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cr 2007-08-23 09:01:25 UTC
XML code completion is not working when xml grammar is loaded from runtime catalog and schema references other schemas
using include tag.

When code completion is invoked following exception is thrown:
java.lang.AssertionError
	at org.netbeans.modules.xml.xam.AbstractModelFactory.getModel(AbstractModelFactory.java:108)
	at org.netbeans.modules.xml.schema.model.SchemaModelFactory.getModel(SchemaModelFactory.java:95)
	at org.netbeans.modules.xml.schema.model.impl.IncludeImpl.resolveReferencedModel(IncludeImpl.java:78)
	at org.netbeans.modules.xml.axi.impl.AXIModelImpl.buildReferenceableCache(AXIModelImpl.java:275)
	at org.netbeans.modules.xml.axi.impl.ModelAccessImpl.sync(ModelAccessImpl.java:63)
	at org.netbeans.modules.xml.xam.AbstractModel.sync(AbstractModel.java:237)
	at org.netbeans.modules.xml.axi.impl.AXIModelImpl.sync(AXIModelImpl.java:185)
	at org.netbeans.modules.xml.xam.AbstractModelFactory.getModel(AbstractModelFactory.java:115)
	at org.netbeans.modules.xml.axi.AXIModelFactory.getModel(AXIModelFactory.java:76)
	at org.netbeans.modules.xml.axi.AXIModelFactory.getModel(AXIModelFactory.java:66)
	at org.netbeans.modules.xml.schema.completion.util.CompletionUtil.findAXIElementAtContext(CompletionUtil.java:350)
	at org.netbeans.modules.xml.schema.completion.util.CompletionUtil.getElements(CompletionUtil.java:223)
	at org.netbeans.modules.xml.schema.completion.CompletionQuery.getCompletionItems(CompletionQuery.java:81)
	at org.netbeans.modules.xml.schema.completion.CompletionQuery.query(CompletionQuery.java:57)
	at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:196)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:539)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:964)

Using Netbeans 6.0 M10 or (latest) build 200708211200 and Java6

Steps to reproduce:
1. create schema that includes other schemas
2. create XML catalog that contains these schemas
3. run and try to edit XML based on schema

Sample project included
Comment 1 cr 2007-08-23 09:02:40 UTC
Created attachment 47144 [details]
sample project
Comment 2 Samaresh Panda 2007-09-02 17:26:04 UTC
Richard, this has been fixed.

In catalog, relative path for included/imported schemas will not work, hence they must specify the system-id. For
example if A was the primary schema and B and C are included in A, here is how it'll look like:

<xsd:include schemaLocation="http://xml.netbeans.org/schemas/A.xsd"/>
<xsd:include schemaLocation="http://xml.netbeans.org/schemas/B.xsd"/>

Assuming that http://xml.netbeans.org/schemas/A.xsd and http://xml.netbeans.org/schemas/B.xsd are the system-id for A and B.

*** This issue has been marked as a duplicate of 112329 ***