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 228959

Summary: Check XML action does not make check syntax of xmlns attribute
Product: xml Reporter: chrislovsund
Component: ValidationAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: Windows 7   
Issue Type: ENHANCEMENT Exception Reporter:

Description chrislovsund 2013-04-24 13:44:57 UTC
If you have a xml file with this content:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
                xmlns:="http://support.procad.de"
                version="1.0">
</xsl:stylesheet>

It should probably catch that the attribute xmlns:="http://support.procad.de" is missing an alias/name. It should be either xmlns="http://support.procad.de" or something like xmlns:procad="http://support.procad.de"

Opening the same file in Chrome will render:
"This page contains the following errors:
error on line 3 at column 7: Failed to parse QName 'xmlns:'
Below is a rendering of the page up to the first error."

Firefox:
XML Parsing Error: not well-formed
Location: file:///C:/temp/test.xml
Line Number 3, Column 23:
                xmlns:="http://support.procad.de"
----------------------^
Comment 1 Svata Dedic 2013-04-25 14:44:31 UTC
Strangely enough, the standard JAXP parser accepts such syntax. The reported attribute as NS URI "http://www.w3.org/2000/xmlns/" and localName = "".

But obviously such attribute is usually not what the user wanted to type