axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anne Thomas Manes" <atma...@gmail.com>
Subject Re: namespace different
Date Wed, 19 Apr 2006 22:19:38 GMT
A namespace declaration that specifies a prefix (e.g., xmlns:foo="urn:
foo.bar") allows you to refer to that namespace by its declared prefix
("foo"). A namespace declaration that does not specify a prefix (e.g.
xmlns="urn:foo.bar") establishes a default namespace. Any element within the
scope of such a declaration that does not specify a prefix is assumed to be
in the default namespace. If you have an element that does not have a
qualified name, then you must override the default namespace.

For example, lets assume that we have an element called "foo" that is in the
"urn:foo.bar" namespace, and it has a child element called "bar", which is a
local element to "foo" and therefore is in no namespace. You could represent
it like so:

<tns:foo xmlns:tns="urn:foo.bar">
   <bar>foobar</bar>
</tns:foo>

or

<foo xmlns="urn:foo.bar">
   <bar xmlns="">foobar</bar>
</foo>

but this would not be valid:

<foo xmlns="urn:foo.bar">
   <bar>foobar</bar>
</foo>

Anne

On 4/19/06, Daniel Destro <danieldestro@gmail.com> wrote:
>
> What is the difference between the two namespaces
>
> xmlns="urn:SacSilog"
>
> and
>
> xmlns:ns1="urn:SacSilog">
>
> Why one or other?
>
> thanks
>
>

Mime
View raw message