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.
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
Created attachment 47144 [details] sample project
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 ***