Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: namespace using conventions >Thread Next - Re: namespace using conventions Re: namespace using conventionsTo: NULL Date: 5/5/2004 7:17:00 PM Hello Martin,
Thanks for your comments.
> my: is not a namespace, it is a prefix that you could associate with a
> namespace but the namespace should look different.
Of course, that's true. I am sort of new to the use of XML terms. I use to
say, "let's have this kind of tag in "my" namespace, etc, etc. On one hand,
it's much handier, since most of XML documents standards prefer to use some
"default" prefix. On the other hand, it of course does not guarantee that
"svg" prefix is not linked to some very different namespace.
>
> 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>
>
Is there some way how to define all the namespaces in the very beginning of
the XML file, so that XML code is less messed up wil all those URNs?
Would this be the right way? ("template" tag is the document object tag)
<my:template xmlns:my="http://www.domain.com/xml/ns/my">
...
<my:whatever>Now I can use "my" prefix without defining xmlns:my
attribute</my:whatever>
...
<xhtml:div xmlns:xhtml="http://www.w3.org/1999/xhtml">Some HTML content
here</div>
...
<xhtml:div>May I skip the namespace attribute now?</div>
...
<div>Can I somewhere tell the XML treat all tags without explicit prefix
being in xhtml namespace?</div>
...
</my:template>
Actually, what's the convention - what to put in the namespace URN? Would
that be an existing web page? I've seen namespaces not refering to any http
source at all.
Regards,
Pavils
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
