Subject: Re: [xsl] Code to Translate XSLT Functions to XQuery Functions? From: "Marc van Grootel marc.van.grootel@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Fri, 29 Aug 2014 00:39:32 -0000 |
.. and Saxon has http://www.saxonica.com/documentation/extensions/instructions/import-query.ht ml which lets you import XQuery modules. So you can share code between XSLT and XQuery. Not in HE though. --Marc > On 28 aug. 2014, at 23:17, "Dimitre Novatchev dnovatchev@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > > On Thu, Aug 28, 2014 at 11:03 AM, Eliot Kimber ekimber@xxxxxxxxxxxx > <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: >> For the most part my functions >> are relatively simple and except for one that uses analyze-string, they >> are all implemented XPath expressions that will work as written in XQuery. > > > > The <xsl:analyze-string> instruction now has its analogue as an XSLT > 3.0 function: analyze-string(), > http://www.w3.org/TR/xpath-functions-30/#func-analyze-string > > As for "translating" XSLT functions to XQuery functions, this may not > be generally possible, especially in the cases when the source > functions use functionality that is absent in XQuery, such as applying > templates. > > If one writes their functions as XPath 3.0 inline function items, then > these are immediately usable both from XSLT and from XQuery, and from > any other language that hosts XPath 3.0. I would recommend this > approach, especially for writing future functions. Among other > benefits, one achieves a single and non-redundant source, that is used > by many hosting languages. > > More on writing XPath 3.0 functions, and generally on XPath > programming, can be found here: > > http://www.balisage.net/Proceedings/vol10/html/Novatchev01/BalisageVol10-Nova tchev01.html > > > -- > Cheers, > Dimitre Novatchev > --------------------------------------- > Truly great madness cannot be achieved without significant intelligence. > --------------------------------------- > To invent, you need a good imagination and a pile of junk > ------------------------------------- > Never fight an inanimate object > ------------------------------------- > To avoid situations in which you might make mistakes may be the > biggest mistake of all > ------------------------------------ > Quality means doing it right when no one is looking. > ------------------------------------- > You've achieved success in your field when you don't know whether what > you're doing is work or play > ------------------------------------- > To achieve the impossible dream, try going to sleep. > ------------------------------------- > Facts do not cease to exist because they are ignored. > ------------------------------------- > Typing monkeys will write all Shakespeare's works in 200yrs.Will they > write all patents, too? :) > ------------------------------------- > I finally figured out the only reason to be alive is to enjoy it.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Code to Translate XSLT Fu, Dimitre Novatchev dn | Thread | Re: [xsl] Code to Translate XSLT Fu, Dimitre Novatchev dn |
Re: [xsl] Code to Translate XSLT Fu, Dimitre Novatchev dn | Date | Re: [xsl] Code to Translate XSLT Fu, Dimitre Novatchev dn |
Month |