Hi, I have started working on a project with XML/XSLT and am really confused about the list of namespaces in the xml docs and the xsl stylesheets. What do declarations like <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns sw="http://xml.orbital.co.uk/organik/ui-data" xmlns:customisation="xalan://com.orbitalsw.customisation.stdclient.XalanClient" extension-element-prefixes="customisation"> these mean? Can anybody explain the basics of the namespaces to me? Thanks Sunetra
While I am not sure I can do a good job explaining NameSpaces, I would suggest this FAQ which maybe helpful...http://www.rpbourret.com/xml/NamespacesFAQ.htm Trust me I have some trouble understanding it myself. regds. - satya
Take a Minute, Donate an Hour, Change a Life
The text Madhav pointed to has the best known for today explanations on namespaces in general. However, in your case there is some specifics. xmlns:xsl="http://www.w3.org/1999/XSL/Transform" here you tell the XSLT processor that all element with xsl prefix are XSLT elements and shold be dealt as such, i.e. executed xmlns:osw="http://xml.orbital.co.uk/organik/ui-data" Your XSLT probably has some elements with osw prefix. These will be copied into output as is, but you have to declare prefix to make XSLT processor happy. xmlns:customisation="xalan://com.orbitalsw.customisation.stdclient.XalanClient" extension-element-prefixes="customisation"> here you declare prefix for so-called extension elements: they are not standard XSLT elements, but elements supported by certain XSLT processor (Xalan in your case). They will be executed like "normal" XSLT elements, but if you run your stylesheet with another XSLT processor, most likely they will not work. [This message has been edited by Mapraputa Is (edited August 08, 2001).]
Hello I am myself new in XML. But whatever I have understood from Namespaces I `ll try to tell in lucid language. When you use , say in xsl, tags like <xsl:value-of select..>. How is it known first of all that there does exist a tag like value-of, (associated with xsl) and if does, what should be interpreted by it, i.e what is it supposed to do??? Herein comes the Namespaces. When you write:
It means that the tag belongs to xsl and what is to be interpreted from it is given at : http://www.w3.org/1999/XSL/Transform"... and so on I would request the experts to please enhance our knowledge by adding their comments \ correction to this. Thanks, Regards,
posted 17 years ago
Thanks, all of you. Will go thru the FAQ suggested by Madhav.
Namespaces are a simple and straightforward way to distinguish names used in XML documents, no matter where they come from. Here's a tiny sample of what we might do:
In this example, the elements prefixed with xdc are associated with a namespace whose name is http://www.xml.com/books, while those prefixed with h are associated with a namespace whose name is http://www.w3.org/HTML/1998/html4. The prefixes are linked to the full names using the attributes on the top element whose names begin. xmlns:. The prefixes don't mean anything at all - they are just shorthand placeholders for the full names. Those full names, you will have noticed, are URLs, i.e. Web addresses. One of the confusing things about all this is that namespace names are URLs; it's easy to assume that since they're Web addresses, they must be the address of something. They're not; these are URLs, but the namespace draft doesn't care what (if anything) they point at. Think about the example of the XML.com programmer looking for book titles; that works fine without the namespace name pointing at anything. The reason that the W3C decided to use URLs as namespace names is that they contain domain names (e.g. www.xml.com), which work globally across the Internet.