File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Namespace Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Namespace" Watch "Namespace" New topic
Author

Namespace

Trina Thach
Greenhorn

Joined: Jun 12, 2001
Posts: 18
I am learning XML, namespace, schema, and XSLT tech for sometimes now... I often see the examples with the following code:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
I keep using it but really do not understand fully what make the http://www.w3.org/1999/XSL/Transform so special from normal URLs?
Could anyone help pls?
------------------
T.T
Nirban Dutta
Greenhorn

Joined: Jun 20, 2001
Posts: 9
This is a namespace for the stylesheet. The browser IE 5.0 onwards, understands it and interprets ur XML document as per that standard. If u give something else in the namespace, the browser will try transform the xml as per that namespace(ie. xsl corresponding to that namespace), if it doesn't understand, then it cannot transform it. There r a few old xsl namespace which u can use in the URI.
Mapraputa Is
Leverager of our synergies
Sheriff

Joined: Aug 26, 2000
Posts: 10065
Hi Trina!
As far as I understand, nothing is really special about this particular URL, besides the fact, that W3C has chosen it for XSLT namespace.
In "XSL Transformations (XSLT) Version 1.0" they said:
"2.1 XSLT Namespace
The XSLT namespace has the URI http://www.w3.org/1999/XSL/Transform."
W3C could choose any other namespace, but I think they have a kind of policy, that their "official" namespaces refers to directory where corresponding specification is located.
There is another "popular" URL for XSLT namespace: xmlns:xsl="http://www.w3.org/TR/WD-xsl"
which was used by old versions of MSXML shipped with IE.
WD-xsl is a Microsoft-proprietary XSLT dialect, used by Microsoft before XSLT specification got "Recommendation" status. It is obsolete now, and I guess most of XSLT processors will give an error message if we try to use this URL. (Xalan and Saxon do). Perhaps only IE browser will "eat" it - for backward compatibility.

Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Amit Ganatra
Greenhorn

Joined: Jun 19, 2001
Posts: 19
Hi Trina,
As quoted by other memebrs the statement, xmlns:xsl="http://www.w3.org/1999/XSL/Transform" means xsl prefix used in the underlying XML document belongs to name space http://www.w3.org/1999/XSL/Transform. Infact name space can be any valid URI.
The URI need not be an URL.
Hope this info helps.
Originally posted by Trina Thach:
I am learning XML, namespace, schema, and XSLT tech for sometimes now... I often see the examples with the following code:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
I keep using it but really do not understand fully what make the http://www.w3.org/1999/XSL/Transform so special from normal URLs?
Could anyone help pls?


------------------
Sun Certified Java Programmer for Java 2 Programming


SCJP2
Alex Ayzin
Ranch Hand

Joined: Apr 10, 2001
Posts: 107
Question for you, guys:
Would it be a false statement to make that the realm is that we actually don't need to understand namespaces in-depth, as long as we point our files to the W3C recommended URI? In that case, why all XML-related books couldn't stress enough about the importance of namespaces? Don't get me wrong, I'm working with XML related stuff for almost 2 years now, but still don't understand namespaces(not that I gave a lot of thoughts on this issue, but still..). Waht's your opinion on this?
Regards,
--Alex
Trina Thach
Greenhorn

Joined: Jun 12, 2001
Posts: 18
Thank you all very much for your help.
I agree with Alex, every single XML book I read - they all talked about namespace but none of the them could give the readers a better understanding.
[This message has been edited by Trina Thach (edited July 01, 2001).]
 
 
subject: Namespace