In XML Schema, when we define the elements with the target namespace, does it imply that we are defining the name space with the elements defined in the schema?
By associating a target namespace, you are simply telling the parser that the tags defined in the Schema belongs to the specified namespace. This will help the parser distinguish your symbols ie., yourNameSpace:YourTag elements from other tags that may be in the document having the same tag name ie., YourTag. Note that you are defining a new namespace by associating an URI with the namespace. This target namespace is not a resource that actually contains definitions of the tags used. It is simply an unique identifier, a kind of UUID.
When we define an XML document like the following:
<xsl:root xmlns:xsl='http://www.w3.org/XSLT'>
<xsl:child>HELLO</xsl:child>
</xsl:root>
From the above it means that the elements root and child belong to
the namespace http://www.w3.org/XSLT. Right? How does an XSLT application(Transformer) really differentiate the elements that are inbuilt belonging to the w3c XSLT namespace and the elements that i have defined saying that it belongs to the w3c XSLT namespace. How is it said that these are the elements that are belonging to this namespace(from where will get the list of elements that are belonging to a particular namespace, and suppose i have my own domain and i want to associate some of my own tags(elements) to that namespace?)
You are correct. Standard xsl tags are defined in the W3C namespace (
http://www.w3.org/XSLT) which is some what like a default namespace for stylesheets. You can declare your own tags that belong to your own namespace and use them in the xsl document. Since xsl tags are already defined by W3C XSLT namespace, if you redefine the same tags your own namespace, it will not conflict the standard names since the namespace prefix would help the XSLT engine to distinguish between what you have defined and it understands as the "standard". Ofcourse, you give the XSLT a "hint" to resolve ambiguities by prefixing the tags with namespace. The ones that don't have any prefix naturally would be associated with the default namespace.
Hope that clarifies your doubts.
Cheers!
------------------
Ajith Kallambella M. Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.