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 248983

Summary: Auto-completion does not offer elements from other namespaces when using XML schemas
Product: xml Reporter: pkerling
Component: Text-EditAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal CC: mkristofic, mmetelka
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description pkerling 2014-11-28 14:36:26 UTC
Consider for example the following XML element:
<div
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xmlns:v='http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers'
    xsi:schemaLocation='
http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd
http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers https://fluidtypo3.org/schemas/vhs-master.xsd'>
</div>

Then inside the div, no elements from the namespace v are available for autocompletion at all.
I can't quote the XML specification on the correct behaviour in this case, but I think there should be an option to make the v: elements available for better user experience if not for the spec. Or even better, show them by default.
Comment 1 Svata Dedic 2015-09-04 11:48:55 UTC
Oops :)
because of the top-level element namespace, the entire text is recognized as XHTML;  while schema completion provider is registered against text/xml, it is not available for XHTML files.

This is not easily solvable. It could be possible to register the XML provider with some minor code tweaks, but the XML provider works XML lexical elements and expects them from the file's lexer. But, in this case, the lexer provides XHTML tokens.

The lexer infrastructure (IMHO) does not allow to produce different lexical streams for the same document, so the text cannot be reinterpreted as XML.

It isn't feasible to duplicate all the XML completion in XHTML module either.