[Home] [By Thread] [By Date] [Recent Entries]
Hi, Your question and example are seemingly incomplete; what kind of document is this with which you are attempting to use XML Namespaces? If it is intended to be an XHTML document, it needs an XML PI like so: <?xml version="1.0" ?>. I'm asking not to be a smartass but because it is hard to answer your question otherwise. If your document is intended to be HTML 4.0 as one of your xmlns attribute values suggests, then using XML Namespaces is totally inappropriate; HTML 4.0 documents are not XML documents, and XML Namespaces cannot be used in any way. If the example is an xhtml 1.0 document (I'm assuming that it is) then the answer to your question is this: an element with an appropriate Namespaces prefix does not need to have the prefix attached to each of its attributes, because the scope for that element is defined by the element name prefix. If you use an attribute from a Namespace that differs from the Namespace of the element on which the attribute appears, then you must prefix it properly. Hope this helps, Regards, D- > -----Original Message----- > From: hb@i... [mailto:hb@i...] > Sent: Monday, March 29, 1999 3:24 AM > To: xml-dev@i...; hb@i... > Subject: Namespace Question > > > Hi, > > For a short example regarding namespaces I have used a > variant of Tim's > example in his XML.com article. > > Is it necessary (as I presume) to assign every single > attribute as long > as it is not from HTML? > > <html xmlns="http://www.w3.org/html4" > xmlns:b="http://www.my.server.de/book" > xmlns:p="http://www.my.server.de/person"> > <head><title>My Booklist</title></head> > <body> > <table> > <tr><td> > <!-- these are the two lines where the attributes in question are: --> > <b:title b:read="yup" > class="important">Dream a little dream of > me</b:title></td> > <td><b:author id="sfreud"> > <p:title>Dr.</p:title> > <b:firstname>Sigmund</b:firstname> > <b:surname>Freud</b:surname></b:author></td></tr> > </table> > </body> > </html> > > Best regards, > > Henning Behme > > iX - Magazin fuer professionelle Informationstechnik > Helstorfer Str. 7 * 30625 Hannover * Germany > http://www.heise.de/ix/ * +49 511 5352-374 * f: -361 > ------ White, adj. and n. Black (Ambrose Bierce) ------ > > xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1 To (un)subscribe, mailto:majordomo@i... the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...) xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1 To (un)subscribe, mailto:majordomo@i... the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
|

Cart



