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 72698

Summary: Autocompletion should offer &
Product: xml Reporter: Tim Lebedkov <lebedkov>
Component: CodeAssignee: issues@xml <issues>
Status: NEW ---    
Severity: blocker    
Priority: P3    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description Tim Lebedkov 2006-02-15 19:39:28 UTC
& + Ctrl-Space should offer &amp; and other entities.

Thank You
Comment 1 Jiri Kovalsky 2006-02-16 13:24:52 UTC
Let me highlight that it works fine if the XML is DTD constrained document. Use
the following code snippet:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE updates SYSTEM "abcd.dtd">
<root>
  &|
</root>

and press CTRL+Space to see the entities.
Comment 2 gliesian 2010-06-16 16:20:54 UTC
I think that this type of "character data and markup" (e.g. &quot;) should have code completion available for XML documents in general, not just those constrained by DTDs. 

I too validated that the code completion does not work with XML files alone as well as XML files constrained by W3C XML Schema documents.

Reference: http://www.w3.org/TR/REC-xml/#sec-documents

I guess this is a tricky one to resolve as the standard does not specify a specific file extension for XML files (all are valid)... so a specific file extension can't be used for the trigger to enable the code completion.  Also, the XML declaration is optional (e.g. <?xml version="1.0" encoding="ISO-8859-1"?>)... so you can't trigger off of that since it may not be there.  Looks like you are triggering code completion off of the DTD-related statement...  unfortunately, this method leaves out plain XML documents and XML instance documents using other schemas (i.e. Relax NG, W3C XML schema, etc)...

I think the only way (to properly associated XML code completion with XML files) is to have a binding configuration option of file extensions used for XML-related files in the configuration panel (i.e. Tools | Options).  Note: Hopefully the user, uses common extensions and doesn't share with other apps with the same extensions.  Default file extensions would be .xsd, .xsl, .xslt, .xml, etc.  

Thanks.