Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] improving Rebol

From: bry::itnisk::com at: 12-Dec-2002 10:34

I suppose this should just be a perma-thread. There have been a lot of suggestions for improving Rebol recently, including added functionalities of various sorts, among which was Rebol in multimedia. I'm still a hobbyist level at Rebol(I find I have less and less time nowadays to devote to learning new things), so it's difficult for me to address the technical issues but the one thing I suppose that would improve the language and gain it wider usage would be not just the improved xml support that many have asked for but improved xml support with the focus of making it easy to write processors/viewers for xml languages, by which I mean: XSL-T, XSL-FO, SVG, SMIL, XHTML, SOAP, UBL and so forth. This might or might not only be available with the SDK. I was thinking that the way to handle this would be to have rebol remember a block of namespaces and the files that interpret them, sort of ["xslt.r" "" "svg.r" "smil20.r" ] now of course there are languages, such as SMIL 1.0 which were not namespaced, but this is vanishing; pretty much any serious xml language nowadays has a namespace associated with it. An improved version of parse-xml would find namespaces in a document, load in all found, if there were a number that you didn't want loaded you could specify which namespaces you wanted to keep from loading but the default would be to load all found. I suppose that the improved version of parse-xml instead of reading in the xml document as blocks of strings, would read in the namespaced elements and attributes as functions. Any namespaced element or attribute that did not match a namespace in the namespace block, or any element or attribute in the default empty namespace would be read in as a string. So the result of reading in an xslt document with parse-xml-processor with the following structure: <xsl:stylesheet version "1.0" xmlns:xsl="" xmlns:it="" it:somevalue="this is the value of somevalue"> <it:namespacedelement>the value of it:namespaceelement</it:namespacedelement> <xsl:param name "myparam"/> <xsl:param name="otherparam" select="'test'"/> <xsl:template match="/"> textnode <xsl:apply-templates/> </xsl:template> </xsl:stylesheet> Would be the following [xsl:stylesheet[version "1.0" xmlns:xsl "" xmlns:it "" it:somevalue "this is the value of somevalue"] it:namespacedelement "the value of it:namespaceelement" xsl:param[name "myparam"] xsl:param[name "otherparam" select "'test'"] xsl:template[match "/" textnode xsl:apply-templates[] ] ]] there would have to be functions for keeping track of the original read xml document and relating from a block across to the original tag so that one could do some sort of error-checking against the tag, although I assume that the parse-xml-processor will do the checking that a document is well-formed etc. The reason should be evident in the example above that xsl:template[] can only allow certain attributes in the xslt namespace on the element so there needs to be checking. Obviously if something like this was in play then inside of a document for a processor to interpret the : would no longer indicate the end of a word. Anyway this is just off the top of my head stuff and as such not much more than a vague itching after some functionality, but I wonder if anyone else thinks this might be a doable thing and what the benefits might be?