This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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
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.
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.
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
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
Joined: Jun 12, 2001
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).]