cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Naegeli Margrit <margrit.naeg...@ecofin.ch>
Subject RE: xsp:page namespace
Date Wed, 16 Aug 2000 09:39:31 GMT
The following is written by Ronald Bourret, unfortunately my link does not
work anymore, so I copied the summary. I'd like to draw your attention
especially to 1.2 about what namespaces are _not_.

****************************************************************************
*

1) SECTION 1: EXECUTIVE SUMMARY

1.1) Can you give me an executive summary of what XML namespaces are?

Sure. Here it is in five easy bullet points.

The purpose of XML namespaces is to distinguish between duplicate element
type and attribute names. Such duplication might occur, for example, in an
XSLT stylesheet or in a document that contains element types and attributes
from two different DTDs. 

An XML namespace is a collection of element type and attribute names. The
namespace is identified by a URI. Thus, any element type or attribute name
in an XML namespace can be uniquely identified by a two-part name: the URI
of its XML namespace and its local name. This two-part naming system is the
only function of XML namespaces. 
     
XML namespaces are declared with an xmlns attribute, which can associate a
prefix with the namespace. The declaration is in scope for the element
containing the attribute and all its descendants. 
For example: 

       <!-- Declares two XML namespaces. Their scope is the A and B
elements. -->
       <A xmlns:foo="http://www.foo.org/" xmlns="http://www.bar.org/">
          <B>abcd</B>
       </A>

If an XML namespace declaration contains a prefix, you refer to element type
and attribute names in that namespace with the prefix. 
For example: 

       <!-- A and B are in the http://www.foo.org/ namespace, which is
associated with the foo prefix. -->
       <foo:A xmlns:foo="http://www.foo.org/">
          <foo:B>abcd</foo:B>
       </foo:A>

If an XML namespace declaration does not contain a prefix, the namespace is
the default XML namespace and you refer to element type names in that
namespace without a prefix. 
For example: 

       <!-- This is equivalent to the previous example but uses a default
namespace instead of the foo prefix. -->
       <A xmlns="http://www.foo.org/">
          <B>abcd<B>
       </A>


1.2) Can you give me an executive summary of what XML namespaces are not?

They aren't a cure of cancer, they aren't a way to win the lottery, and they
aren't a direct cause of world peace. They also aren't very difficult to
understand or use. Two things that XML namespaces are not have caused a lot
of confusion, so we'll mention them here:

XML namespaces are not a technology for joining XML documents that use
different DTDs. Although they might be used in such a technology, they don't
provide it themselves. 
     
XML namespace URIs are not a pointer to schemas, information about the
namespace, or anything else -- they're just identifiers. URIs were used
simply because they're a well-known system for creating unique identifiers.
Don't even think about trying to resolve XML namespace URIs. 

***********************************************************************

maggie


> -----Original Message-----
> From: Jens Lorenz [mailto:jens.lorenz@interface-business.de]
> Sent: Wednesday, August 16, 2000 11:29 AM
> To: cocoon-users@xml.apache.org
> Subject: Re: xsp:page namespace
> 
> 
> Hi,
> 
> > <xsp:page language="java" 
> xmlns:xsp="http://www.apache.org/1999/XSP/Core">
> >
> > in XSP programming we specify the namespace for xsp pointing to
> > http://www.apache.org/1999/xsp/Core,
> > how can i trust Apache that , they will not change the location of
> namespace.
> > Suppose Apache removes
> > the namespace of XSP in his site, our xsp programs will not 
> run. At that
> time
> > what to do ?
> 
> I'm no namespace and XML expert, but your link and the link 
> above simply
> dont work ... both give HTTP 404-Errors ...
> 
> Since I use the same namespace declaration in my XSP pages 
> (and my simple
> examples work just fine) ... why care ?
> 
> AFAIK no xml parser cares about these URIs / URLs anyway ... 
> (XML should
> work without internet connection also)
> 
> 
> If someone knows better please correct me ...
> 
> 
> Regards,
> 
> Jens
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 

Mime
View raw message