This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 4475 - Namespace declarations treated as attributes
Summary: Namespace declarations treated as attributes
Status: NEW
Alias: None
Product: Validator
Classification: Unclassified
Component: Parser (show other bugs)
Version: 0.8.0b1
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Terje Bless
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on: 800
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-19 13:11 UTC by Chris Lilley
Modified: 2009-11-21 12:21 UTC (History)
1 user (show)

See Also:


Attachments

Description Chris Lilley 2007-04-19 13:11:57 UTC
Namespaces in XML adds namespace declarations to XML. DTD-based validators, such as the SGML validator used here, incorrectly treat namespace declaration as attributes and report validity errors. As an example

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
xmlns:foo="someURI">
<head><title>ns test</title></head>
<body/></html>

Please consider modifying the parser such that namespace declarations are not treated as validity errors.
Comment 1 Olivier Thereaux 2007-04-19 13:34:46 UTC
(In reply to comment #0)
> Namespaces in XML adds namespace declarations to XML. DTD-based validators,
> such as the SGML validator used here, incorrectly treat namespace declaration
> as attributes and report validity errors. 

I agree that there is a problem (and I've been talking to a few people about the goal of making the validator more aware of namespaces), but we both know that the real issue is that the XML spec is not putting a constraint on validating user agents to be namespaces aware, right?
Comment 2 Olivier Thereaux 2007-04-24 06:14:07 UTC
Raised underlying XML DTD/namespace issue with the TAG:
http://lists.w3.org/Archives/Public/www-tag/2007Apr/0084.html

I could start hacking the validator to filter out error messages related to namespaces, but I'd rather make sure that this is following a clear resolution of the age-old XML DTD/xmlns issues.
Comment 3 Chris Lilley 2007-04-24 13:37:34 UTC
There has been some work in this area: Vitali et. a. "Datatype- and namespace-aware DTDs - A minimal extension". Extreme Markup 2003

http://www.mulberrytech.com/Extreme/Proceedings/html/2003/Gessa01/EML2003Gessa01.html

although its not clear that this isn't just pouring good money after bad. In some ways  I prefer Robin Berjon's characterisation on DTD based, namespace-unaware validators:

  "So when they say OK they really haven't checked anything, when they say
NOT OK they might be on crack, and like all namespace-unaware things
they're a dead branch of the XML tree. But feel free to use them anyway :)"

(see link below for the reasoning of which the above is a summary)
http://tech.groups.yahoo.com/group/svg-developers/message/48562

So, rather than *add* namespace processing to a DTD system, which seems hard, I proposed instead to filter out namespace declarations, to prevent the DTD validator thinking they are attributes. This might help RDF, or things which use qnames in attribute values; and it will help prevent anyone still maintaining a DTD from trying to add as many namespace declarations as they can think of on every element and hacking in magic prefixes, with or without parameter entities to allow the instance to define new magic prefixes.

It won't help if the qualified names are used in element names or attribute names, but then that takes us right back to the other bug I raised, 4776 - that the validator should have three states, valid, invalid, and "i can't tell".
http://www.w3.org/Bugs/Public/show_bug.cgi?id=4476
Comment 4 Chris Lilley 2007-04-24 13:43:23 UTC
(In reply to comment #1) 
> I agree that there is a problem (and I've been talking to a few people about
> the goal of making the validator more aware of namespaces), but we both know
> that the real issue is that the XML spec is not putting a constraint on
> validating user agents to be namespaces aware, right?

The XML spec is not putting a constraint on user agents to be validating, either, or on DTDs to be a complete definition of the instance. But as we know, its the combination of the XML Spec the namespaces in XML spec, and so on (in short the 'xml ecosystem'), rather than the xml spec standalone, which is of interest here.

After all we do want to conform to webarch, specifically
http://www.w3.org/TR/webarch/#xml-namespaces
Comment 5 Olivier Thereaux 2007-05-07 14:45:43 UTC
Adding dependency to (now fixed) Bug 800, which filters out error messages for attributes prefixed with xmlns: - this solves most of the problem, without making the validator namespace aware stricto sensu.