Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: namespace using conventions

From: Martin Honnen <mahotrash@-----.-->
To: 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/



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent