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 91333 - Schema based Code Completion for xml files should be available through XML catalog
Summary: Schema based Code Completion for xml files should be available through XML ca...
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema Tools (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker with 4 votes (vote)
Assignee: issues@xml
URL:
Keywords:
Depends on: 92875
Blocks:
  Show dependency tree
 
Reported: 2006-12-20 13:41 UTC by vivekjain
Modified: 2007-02-07 08:30 UTC (History)
5 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vivekjain 2006-12-20 13:41:22 UTC
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
Comment 1 aj 2006-12-20 19:07:01 UTC
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.
Comment 2 aj 2006-12-22 00:37:07 UTC
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.
Comment 3 Samaresh Panda 2007-01-22 05:06:50 UTC
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
Comment 4 Samaresh Panda 2007-01-23 00:39:17 UTC
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>
Comment 5 htt 2007-01-25 01:40:43 UTC
Verified in 070123_8.