Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - namespace using conventions >Thread Next - Re: namespace using conventions Re: namespace using conventionsTo: NULL Date: 5/1/2004 1:48:00 PM
Pavils Jurjans wrote:
> I am developing my own template XML language. For it's special tags I am
> going to use my own namespace, say, "my:".
my: is not a namespace, it is a prefix that you could associate with a
namespace but the namespace should look different.
> The XML code that is heavily
> mixed with the template tags, is mostly XHTML. I have question regarding use
> of attributes in the foreign tags:
>
> For example, I have this markup:
>
> <my:special value="ABC">
> <div>Some HTML content here</div>
> </my:special>
>
> Here I have a tag from "my:" namespace, but within this tag I am using
> "value" attribute from (default?) unnamed namespace. The question is, what
> would be "more correct" way - using
>
> <my:special value="ABC">....
>
> or
>
> <my:special my:value="ABC">
>
> the "value" attribute in this particular case is consumed solely by
> my:special tag, and not directly parsed into "value" attribute of some html
> tag. The latter approac, using namespace def with attribute name, of course,
> is more ugly, and likes me less than the first. However, I'd certainly like
> to know the "philosofy" behind attribute namespaces within foreigh namespace
> tags.
If you really want to use XHTML then you should use the right namespace
for those elements like the <div> element e.g.
<my:special xmlns:my="http://example.com/2004/05/pavel"
value="ABC">
<div xmlns="http://www.w3.org/1999/xhtml">Some HTML content here</div>
</my:special>
As for the attributes as long as you don't want to apply one of your
attributes to elements from a different namespace you don't need to have
your attributes declared to have a qualified name.
--
Martin Honnen
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
