Re: Clever idea for func:script (was xmlns:exslt)
Uche Ogbuji <[email protected]>
| Newsgroups | gmane.text.xml.xslt.extensions |
|---|---|
| Organization | Fourthought, Inc. |
| Message-ID | <1088544453.6047.19267.camel@borgia> |
On Tue, 2004-06-29 at 12:06, Kurt Cagle wrote: > > I personally would be all for replacing the specification for > > func:script/@language to be an Internet media type, although I wonder > > whether it should then be renamed func:script/@type, with @language > > immediately deprecated. > > > > I also wonder how problematic this would be on deployed legacy. > > > > Thoughts, anyone? > > The @language attribute has always struck me as being too ambiguous - it > could refer either to > the language designator "en-us", the language character encoding "UTF-16" or > the computer language > used in scripting, especially since @language (or @xml:lang) carries the > former connotation just > about everywhere EXCEPT with Microsoft. Moving to script/@type and a > mime-encoding makes more sense to me; > consider the stylesheet pi: > <?xml-stylesheet type="text/css" href="foo.xsl"?> > and the HTML style tag: > <style type="text/css"> > > The downside with mime is that it only deals with MIME types that have been > formally recognized by the IETF, so that > experimental types can prove problematic. Namespaces might solve this: Not really. That's where application/x-foobar comes in. No IETF reg required. > <js:script xmlns:js="http://www.ecma.org/javascript" src="myScript.js"/> > > and would also simplify the resolution of specific scripting engines > > <js:script xmlns:js="http://www.ecma.org/javascript/15" src="myScript.js"/> > > but I suspect that the only ones who would want to adopt it would be us > advanced XML geeks. Hmm. I'd rather something like: <func:script type="text/javascript" src="myScript.js"/> <func:script type="application/x-javascript-15" src="myScript.js"/> (Note: my /etc/mime.types specifies application/x-javascript for the .js extension, but I see "text/javascript" in W3C specs and elsewhere) or maybe for the latter <func:script xmlns:js="http://www.ecma.org/javascript" type="text/javascript" js:variant="15" src="myScript.js"/> i.e. allow any qname-non-ncname attribute on the element in order to deliver useful metadata for the script (the variant of Javascript in this case). -- Uche Ogbuji Fourthought, Inc. http://uche.ogbuji.net http://4Suite.org http://fourthought.com A survey of XML standards - http://www-106.ibm.com/developerworks/xml/library/x-stand4/ When to use elements versus attributes - http://www-106.ibm.com/developerworks/xml/library/x-eleatt.html Introducing PyRXP - http://www.xml.com/pub/a/2004/02/11/py-xml.html XML in the financial services industry - http://www-106.ibm.com/developerworks/xml/library/x-think22.html Python Web services developer: The real world, Part 2 - http://www-106.ibm.com/developerworks/webservices/library/ws-pyth16/ Keep your XML clean - http://www.adtmag.com/article.asp?id=9012