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.
The HintContext Javadoc doesn't talk about XML namespaces support at all, but it is clear from the impl in DefaultContext that there is none: public String getNamespaceURI() { throw new UOException(); } For some kinds of grammar providers this may be a serious deficiency. E.g. Ant 1.6 introduces support for namespaces in various forms; in order to support completing elements in a namespace-aware fashion, it may be necessary to have the XML module grok them. For example, if you have a script <project default="x"> <typedef file="mylib.xml" uri="urn:foo"/> <target name="x"> <!-- CURSOR HERE --> </target> </project> and mylib.xml contains <antlib> <taskdef name="foo" classname="Foo"/> </antlib> then an appropriate completion would be <f:foo xmlns:f="urn:foo"/> or <foo xmlns="urn:foo"/> or just <f:foo/> if xmlns:f="urn:foo" is added to <project>. It would be possible - with a fair amount of extra work - to implement the first or second possibilities in the GrammarQuery provider, rather than the xml/text-edit module, if this clause from the GrammarResult Javadoc "It can have children representing mandatory content. However it is up to client if it uses the mandatory content." guaranteed anything: you could manually examine the document tree looking for existing namespace prefixes, and if necessary add one on the element itself. Unfortunately it seems that ElementResultItem in fact ignores any content and pays attention only to the element name: public ElementResultItem(GrammarResult res) { super(res.getNodeName()); foreground = Color.blue; startElement = true; } So unless I am missing something, it is impossible in general to provide correct namespace-aware XML completion with the current API implementation. I guess you could try to return an Element GrammarResult with a "name" like "f:foo xmlns:f=\"urn:foo\"" But this is an awful hack, and it will not work if xml/text-edit attempts to insert a close tag. Note: XSLGrammarQuery does provide completion on elements in the namespace http://www.w3.org/1999/XSL/Transform with whatever namespace prefix. However it needs to manually interpret prefixes and xmlns attributes. (See updateProperties().) And this trick will only work if the document already has a defined prefix for the element to be completed - not a problem for XSLGQ since this will hold for stylesheets, but a problem for Ant scripts where it cannot be assumed that the user has already defined namespace prefixes.
It looks more like an enhancement.
DOM level 2 and NS support is RFE. In fact it'll be hard needed for XMLSchema completion support.
Note also that 4.0 project types, esp. the freeform project type, use schema-controlled XML files. To permit code completion on these we should stabilize and productize the xml/schema module.
Reassigning to default owner of selected subcomponent. New owners are gladly welcomed.