Re: XML Namespaces

2003-02-11 Thread Colin Goodier
Go to www.xml.com and type 'namespaces' in the searchbox. Lots of stuff
there.

Colin

On Tue, 2003-02-11 at 14:48, Eddie Roosenmaallen wrote:
 Hi all!
 
 From reading the documentation on AxKit and XSP, it seems that XML 
 namespaces are a must for making full use of AxKit. Problem is, I've been 
 totally unable to find any documentation on namespaces.
 
 Can anyone point me to a good tutorial on using and writing XML namespaces, 
 or at least give me a quick run-down on how they are built, and the 
 internal structure (if any) of a namespace?
 
 Thanks,
   Eddie
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: XML Namespaces

2003-02-11 Thread Robin Berjon
Eddie Roosenmaallen wrote:

From reading the documentation on AxKit and XSP, it seems that XML 
namespaces are a must for making full use of AxKit.

Yes, in fact they are a must for anything XML. Imho the fact that namespace-less 
XML is even possible is a bug, as I have yet to find one single occasion on 
which I've bumped into a namespace-less vocabulary that didn't cause me to be 
limited in some way down the line. Such vocabularies encourage very poor coding 
standards and render eXtensibility impossible, which is kind of a pity since 
that's what the X stands for.
EORANT

Problem is, I've 
been totally unable to find any documentation on namespaces.

Err, Google has tons... A selection of the first results that should prove 
sufficient:

http://www.jclark.com/xml/xmlns.htm
http://www.xml.com/pub/1999/01/namespaces.html
http://www.rpbourret.com/xml/NamespacesFAQ.htm

Can anyone point me to a good tutorial on using and writing XML 
namespaces, or at least give me a quick run-down on how they are built, 
and the internal structure (if any) of a namespace?

10% of the problems with namespaces stem from the fact that they don't default 
the same way for elements (they default), attributes (they don't default), and 
QNames-in-content (depends on which spec you're reading -- it's a complete mess).

90% are due to the user expecting more from them than they do. They don't have 
structure. They don't point to anything. They don't import child elements or 
attributes. They don't define a schema. They're simple, and stupid.

--
Robin Berjon [EMAIL PROTECTED]
Research Engineer, Expwayhttp://expway.fr/
7FC0 6F5F D864 EFB8 08CE  8E74 58E6 D5DB 4889 2488


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: XML Namespaces

2003-02-11 Thread Tod Harter
The concept is pretty simple. Anywhere in a document you can declare a 
namespace. The syntax is like an attribute declaration, that is it occurs 
inside a tag, so it looks something like:

myprefix:mytag xmlns:myprefix=whateveruristringidentifiesthis/

In the above example you just put mytag into a namespace identified by a URI 
(which is just anything you want it to be, most authors of XML based 
vocabularies will specify what this URI is for their tag set, since they are 
URI's they SHOULDN'T ever overlap). Note that the URI is NOT a URL and need 
not point to anything that can actually be fetched, it is just a unique 
identifier.

Note that prefixes are optional, but they make it a LOT easier to deal with 
stuff later on. The prefix can be anything you want, and the xmlns= 
declaration binds that prefix to that namespace. More than one prefix can 
bind to the same namespace, and in that case both prefixes are 
interchangeable.

XML processors, such as XSLT, require a matching namespace, that is the 
namespace is PART OF THE TAG's NAME in essence, so an XSLT template would 
have to say something like

xslt:template match=somprefix:mytag 
xmlns:someprefix=whateveruristringidentifiesthis

/xslt:template

Notice I used a different prefix in the XSLT, but since the binding is to the 
same namespace URI they are equivalent and the processor should match the 
template to the tag.

Namespace declarations have a scope which includes the tag where they are 
defined and all its children. Thus you commonly see xmlns declarations in the 
root tag of XML documents, especially things like XSLT stylesheets.

The point of namespaces is that if 2 authors utilize the same tag names for 
different purposes it is still possible for a single document to contain 
markup complying with both syntaxes and a processor can tell them apart. Thus 
Fubar Markup Language, with URI 'http://xml.fubar.torpedo.org; will not 
overlap with Gremlin Markup Language with URI http://gml.gremlinsareus.org; 
even though they both have a tag fubared / since the author of a document 
combining both languages can simply use a different prefix for each.  

I guess thats the basics of it. Attributes have their own quirks WRT 
namespaces. I can only refer you to books such as the one by Michael Kay 
which go into it in nauseating detail! 

And yes, namespaces are vital for AxKit, each XSP taglib lives in a unique 
namespace, and XSLT depends on them heavily as well. Its hard to do much 
serious XML processing without them really

On Tuesday 11 February 2003 09:48 am, Eddie Roosenmaallen wrote:
 Hi all!

 From reading the documentation on AxKit and XSP, it seems that XML
 namespaces are a must for making full use of AxKit. Problem is, I've been
 totally unable to find any documentation on namespaces.

 Can anyone point me to a good tutorial on using and writing XML namespaces,
 or at least give me a quick run-down on how they are built, and the
 internal structure (if any) of a namespace?

 Thanks,
   Eddie

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Tod Harter
Giant Electronic Brain

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: XML Namespaces

2003-02-11 Thread Kip Hampton
Eddie Roosenmaallen wrote:


Can anyone point me to a good tutorial on using and writing XML 
namespaces, or at least give me a quick run-down on how they are built, 
and the internal structure (if any) of a namespace?

Zvon.org has a nice XML Namespaces intro [1] with links to more info.

HTH,
-kip

[1] http://www.zvon.org/xxl/NamespaceTutorial/Output/contents.html


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]