W3C home > Mailing lists > Public > www-html@w3.org > January 2000

tricky XHTML 1.0 namespace question

From: Simon St.Laurent <simonstl@simonstl.com>
Date: Mon, 17 Jan 2000 13:04:51 -0500 (EST)
Message-Id: <200001171804.NAA01595@hesketh.net>
To: XML-Dev Mailing list <xml-dev@ic.ac.uk>
Cc: www-html@w3.org
The XHTML 1.0 PR shows (in 3.12) an example of XHTML being included in another
XML document type: (I've changed all the angle brackets so this doesn't get et
by the mail programs)

              [?xml version="1.0" encoding="UTF-8"?]
              [!-- initially, the default namespace is "books" --]
              [book xmlns='urn:loc.gov:books'
                  xmlns:isbn='urn:ISBN:0-395-36341-6' xml:lang="en" lang="en"]
                [title]Cheaper by the Dozen[/title]
                [isbn:number]1568491379[/isbn:number]
                [notes]
                  [!-- make HTML the default namespace for a hypertext
commentary --]
                  [p xmlns='http://www.w3.org/1999/xhtml']
                      This is also available [a
href="http://www.w3.org/"]online[/a].
                  [/p]
                [/notes]
              [/book]

This uses the default namespace for its work.  Would it be possible (I
think it
should be) to use a prefix?

              [?xml version="1.0" encoding="UTF-8"?]
              [!-- initially, the default namespace is "books" --]
              [book xmlns='urn:loc.gov:books'
                  xmlns:isbn='urn:ISBN:0-395-36341-6' xml:lang="en" lang="en"]
                [title]Cheaper by the Dozen[/title]
                [isbn:number]1568491379[/isbn:number]
                [notes]
                  [!-- make HTML the default namespace for a hypertext
commentary --]
                  [xhtml:p xmlns:xhtml='http://www.w3.org/1999/xhtml']
                      This is also available [xhtml:a
xhtml:href="http://www.w3.org/"]online[/xhtml:a].
                  [/xhtml:p]
                [/notes]
              [/book]

If so, is:

                      This is also available [xhtml:a
xhtml:href="http://www.w3.org/"]online[/xhtml:a].

equivalent to:

                      This is also available [xhtml:a
href="http://www.w3.org/"]online[/xhtml:a].

While XHTML seems to assume that attributes with no prefix fall into the
namespace of their containing element throughout, I can't find this stated
explicitly.  (Perhaps they weren't aware that this has been a contentious
issue?)

Simon St.Laurent
XML Elements of Style / XML: A Primer, 2nd Ed.
Building XML Applications
Inside XML DTDs: Scientific and Technical
Cookies / Sharing Bandwidth
http://www.simonstl.com
Received on Monday, 17 January 2000 13:13:48 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:40 GMT