Re: sgml-id / xml-id and namespaces



Il giorno Wed, 23 Dec 2009 19:30:43 +0200
Stefan Kost <ensonic hora-obscura de> ha scritto:

> Am 23.12.2009 13:54, schrieb Nicola Fontana:
> > Il giorno Wed, 23 Dec 2009 10:09:50 +0100
> > David Nečas <yeti physics muni cz> ha scritto:
> > 
> >> On Wed, Dec 23, 2009 at 12:52:02AM +0200, Stefan Kost wrote:
> >>> In my opinion we should
> >>> - design a better id-scheme with minimal breakage in mind. for
> >>> that I'd suggest to prefix document structure ids. the rational
> >>> is that those where not officially documented and I don't believe
> >>> people explicitly link to them a lot.
> >>>
> >>> - if possible have a quirks mode, that could catch link which got
> >>> broken, rewrite and warn about them
> >>>
> >>> - once we know about the potential impact, propose the change on
> >>> desktop-devel list
> >>>
> >>> How does that sound?
> >>
> >> For subsections, it's reasonable.  Something like sect: is
> >> unlikely to clash with existing IDs.
> >>
> >> But this does not solve the type/section clash, does it?
> > 
> > Yes, it will: the section is nothing more than a root subsection.
> > The problem is the final file name should be treated specially (as
> > I think nobody would like "DOC:::GtkWidget.html" or something
> > similar), but I guess the file name is yet handled apart.
> 
> I was thinking of DOC---GtkWidget. We already use "--" or "-" for
> proprties and signals. I'd liek to not use ":" anymore as they are
> used for namespaces in xml. It still works, but one already now get
> validity warnings for ":CAPS" (also :CAPS is only needed for sgml and
> not for xml). The "-" char is a good delimiter as it is not valid for
> symbols in C.

Of course the ":" is used for namespaces, but it is used in the name of
the attribute, not in its value.

As far as I know, DocBook ids are plain XML ids (in DocBook 5 they are
using xml:id directly). And, XML ids are less restrictive than
HTML/XHTML ids; for instance, id="_value" is a valid XML but invalid
HTML.

Given that, id="GtkWidget::size-request" is a perfectly valid XML/HTML
id, and so every C identifier that does not start with an underscore
(in HTML the first char of the id must be a letter). id=":CAPS" per se
is invalid because starts with ":" but if the validation fails when ":"
or "_" are in the middle of the id, I think would be better to file a
bug for the validator.


The real problem is to be sure the id value is case-sensitive: as
showed in the other answer it is not so clear and Internet Explorer 6
fails badly. I'd not be so sure every modern browser work as expected.

-- 
Nicola


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]