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.
Currently schema-based code completion for xml files works only if we provide value for 'schemaLocation' attribute and the value should be relative or absolute path of xsd file on the filesystem. Schema based Code Completion for xml files should be available through XML catalog also. If user register schema to catalog, in runtime tab, schema support should be available to xml files. eg: For a typical scenario like following xml file: <?xml version="1.0" encoding="UTF-8"?> <component label='SystemService' xmlns='http://www.sun.com/schema/SPS' name='systemService' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.sun.com/schema/SPS component.xsd'> <.........../> </component> Here the value of 'schemaLocation' attribute is not the correct location of xsd file. So in the ideal scenario user should be allowed to register component.xsd schema file to the xml catalog runtime tab, and then based on xml file's 'namespace + root element' resolve the schema entity and provide that schema support to xml file. Thanks, Vivek
Would it be reasonable to characterize this issue as a bug instead of enhancement. Isn't the purpose of the xml catalog is to be able to supply the locations of the xsd (& dtd) files for the registered schemas. ie. you only have to use the public/system ID of the schema in XML and netbeans will know where to find them through the catalog. Isn't that how it works when we have a DTD constrained document? Shouldn't schema constrained documents work the same way, given we have that precedent. You don't need to specify the dtd location when creating a dtd constrained doc. As long as the dtd is registered with the catalog it works well. Whereas the same is not true for the schema constrained documents.
Not sure if the issue was being looked at as it was marked as an enhancement. Reseting it to a bug based on the my comments from before.
Set of change integrated, however this feature requires a fix in #92875. Checking in nbproject/project.xml; new revision: 1.1.2.6.26.3; previous revision: 1.1.2.6.26.2 Checking in src/META-INF/services/org.netbeans.modules.xml.xam.locator.CatalogModel; new revision: 1.1.2.1; previous revision: 1.1 Checking in src/org/netbeans/modules/xml/schema/completion/CompletionResultItem.java; new revision: 1.1.2.13.16.3; previous revision: 1.1.2.13.16.2 Checking in src/org/netbeans/modules/xml/schema/completion/RuntimeCatalogModel.java; new revision: 1.1.2.1; previous revision: 1.1 Checking in src/org/netbeans/modules/xml/schema/completion/util/CompletionUtil.java; new revision: 1.1.2.21.6.6; previous revision: 1.1.2.21.6.5 Checking in src/org/netbeans/modules/xml/schema/completion/util/CompletionContextImpl.java; new revision: 1.1.2.9; previous revision: 1.1.2.8 Checking in src/org/netbeans/modules/xml/schema/completion/util/DefaultModelProvider.java; new revision: 1.1.2.5; previous revision: 1.1.2.4
From now on, code completion will work if a schema with appropriate system ID is found in the runtime catalog. For example if PO.xsd was registered in the catalog with system ID "http://xml.netbeans.org/schema/PO.xsd" CC will work in the following document. <PO xmlns='http://xml.netbeans.org/schema/PO' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://xml.netbeans.org/schema/PO http://xml.netbeans.org/schema/PO.xsd'> </purchaseOrder>
Verified in 070123_8.