[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: namespaces
Hi, Sven Ewert wrote: > hi all, > > is it "valid" when i use a namespace in the root element of > an xml file and then in no other element? > or is it totaly false and non standart ? > > like: > <name:blub xmlns:name="URI"> > <element> > <foo/> > <bar/> > </element> > </name:blub> This is perfectly valid per the Namespaces in XML recommendation. Now, the question you need to ask to yourself is if you prefer this for your application rather than: <blub xmlns="URI"> <element> <foo/> <bar/> </element> </name:blub> In the first case, blub will be considered to be in the "URI" namespace and all the other elements will be considered to have no namespace while in the second one all the elements will be considered to be in the "URI" namespace. The main difference is that generic namespace applications will find the information about the namespace only in the document element in the first case and in every element node in the second one. I would say that this is not a FAQ since no definite answer can be given, but that this is certainly a frequent question! In fact, I think that in practice, namespaces fade out... and the color of an element is not only its color but also the color of its ancestors... To take the often used metaphor, if the namespace "URI" is blue, your element "foo" will not be white but light blue! Now, it may be more difficult for some applications to recognize "light blue" than plain "blue" but you may also think that you will use much less painting and be less agressive for the eyes if you just paint the document element... Eric -- See you in Barcelona. http://www.xmleurope.com/2002/schedule.asp ------------------------------------------------------------------------ Eric van der Vlist http://xmlfr.org http://dyomedea.com http://xsltunit.org http://4xt.org http://examplotron.org ------------------------------------------------------------------------
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|