From: Dan M. <dan...@gm...> - 2013-03-01 22:30:28
|
Hi all, I have been trying to get some basic SVG graphs working in eXist 2.0 and I am attempting to port graph2svg into a EXPath package. The packaging tools are working fine, but the XSLT transforms seem to be failing in XSLT math functions which are part of an exslt extension. Chris Wallace did get this to work in the past. Is there any special configuration we need to configure to get the math extension functions to run? Thanks - Dan The following transform works in Saxon but fails in eXist 2.0: <xsl:stylesheet xmlns:math="http://exslt.org/math" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <results> <log1> <xsl:value-of select="math:log(1)"/> </log1> <sin1> <xsl:value-of select="math:sin(1)"/> </sin1> <cos1> <xsl:value-of select="math:cos(1)"/> </cos1> </results> </xsl:template> </xsl:stylesheet> The error I get is: <exception> <path>/db/apps/graph2svg/unit-tests/test-math-functions.xq</path> <message>exerr:ERROR Exception while transforming node: Cannot find a matching 1-argument function named {http://exslt.org/math}log() [at line 8, column 5]</message> </exception> Sample driver here: https://github.com/dmccreary/graph2svg/blob/master/unit-tests/test-math-functions.xq https://github.com/dmccreary/graph2svg/blob/master/unit-tests/test-math-functions.xsl -- Dan McCreary NoSQL Evangelist office: (952) 931-9198 cell: (612) 986-1552 |
From: Joe W. <jo...@gm...> - 2013-03-02 04:41:55
|
Hi Dan, > The error I get is: > > <exception> > <path>/db/apps/graph2svg/unit-tests/test-math-functions.xq</path> > <message>exerr:ERROR Exception while transforming node: Cannot find a > matching 1-argument function named {http://exslt.org/math}log() [at > line 8, column 5]</message> > </exception> Do you see anything more detailed in exist.log? Joe |
From: Dannes W. <da...@ex...> - 2013-03-02 10:12:20
|
Dan, which XSLT processor are you using? I guess Saxon, but that does not allow extension functions these days? and: I never heard of "http://exslt.org/math" , where is it installed, how is it implemented, how do you pass it to the processor? Is your assumption you use the one in exist-db? cheers Dannes On 2 Mar 2013, at 5:41 , Joe Wicentowski <jo...@gm...> wrote: >> The error I get is: >> >> <exception> >> <path>/db/apps/graph2svg/unit-tests/test-math-functions.xq</path> >> <message>exerr:ERROR Exception while transforming node: Cannot find a >> matching 1-argument function named {http://exslt.org/math}log() [at >> line 8, column 5]</message> >> </exception> > > Do you see anything more detailed in exist.log? |
From: Dannes W. <da...@ex...> - 2013-03-02 10:20:43
|
On 1 Mar 2013, at 23:30 , Dan McCreary <dan...@gm...> wrote: > The following transform works in Saxon but fails in eXist 2.0: what does this mean in detail? - which version of Saxon? - "Saxon": it works with saxon@oxygen or saxon-standalone as commandline? - "eXist-db" : is it the 'native' XSLT2 processor that is actually in eXist-db or do you mean the standard "Saxon vX.Y in eXist-db" ? cheers Dannes |
From: Dan M. <dan...@gm...> - 2013-03-02 13:10:48
|
Hi Dannes, Thanks for offering to help. Here is an XSLT that displays the version information: show-xslt-version.xsl <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <results> <system-property-version> <xsl:value-of select="system-property('xsl:version')"/> </system-property-version> <system-property-vendor> <xsl:value-of select="system-property('xsl:vendor')"/> </system-property-vendor> <system-property-vendor-url> <xsl:value-of select="system-property('xsl:vendor-url')"/> </system-property-vendor-url> </results> </xsl:template> </xsl:stylesheet> Within the default eXist 2.0 with no change to any configuration files I get the following version information: <results> <system-property-version>2.0</system-property-version> <system-property-vendor>SAXON 9.2.1.5 from Saxonica</system-property-vendor> <system-property-vendor-url>http://www.saxonica.com/</system-property-vendor-url> </results> When I run the same within oXygen 14.2 using the default XSLT transform (there are 7 other options available) I get: <results> <system-property-version>1</system-property-version> <system-property-vendor>SAXON 6.5.5 from Michael Kay</system-property-vendor> <system-property-vendor-url>http://saxon.sf.net/</system-property-vendor-url> </results> I used this XQuery program to test: xquery version "1.0"; let $input := doc('empty-file.xml') let $xslt-file := doc('show-xslt-version.xsl') return transform:transform ($input, $xslt-file,())} Can anyone else reproduce the error? - Dan On Sat, Mar 2, 2013 at 3:15 AM, Dannes Wessels <da...@ex...> wrote: > > On 1 Mar 2013, at 23:30 , Dan McCreary <dan...@gm...> wrote: > > The following transform works in Saxon but fails in eXist 2.0: > > > what does this mean in detail? > - which version of Saxon? > - "Saxon": it works with saxon@oxygen or saxon-standalone as commandline? > - "eXist-db" : is it the 'native' XSLT2 processor that is actually in > eXist-db or do you mean the standard "Saxon vX.Y in eXist-db" ? > > cheers > > Dannes > > -- Dan McCreary NoSQL Evangelist office: (952) 931-9198 cell: (612) 986-1552 |
From: Dan M. <dan...@gm...> - 2013-03-02 14:35:28
|
Hi Joe, Thanks for reminding me to check this! > Do you see anything more detailed in exist.log? Here is the error from exist.log: 2013-03-02 08:31:15,511 [eXistThread-32] WARN (Transform.java [fatalError]:779) - XSL transform reports fatal error: Cannot find a matching 1-argument function named {http://exslt.org/math}log() ; Line#: -1; Column#: -1 net.sf.saxon.trans.XPathException: Cannot find a matching 1-argument function named {http://exslt.org/math}log() at net.sf.saxon.expr.ErrorExpression.evaluateItem(ErrorExpression.java:58) at net.sf.saxon.expr.ErrorExpression.iterate(ErrorExpression.java:71) at net.sf.saxon.expr.Atomizer.iterate(Atomizer.java:180) at net.sf.saxon.expr.FirstItemExpression.evaluateItem(FirstItemExpression.java:96) at net.sf.saxon.expr.CastExpression.evaluateItem(CastExpression.java:316) at net.sf.saxon.instruct.ValueOf.processLeavingTail(ValueOf.java:246) at net.sf.saxon.instruct.Instruction.process(Instruction.java:93) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:301) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:619) at net.sf.saxon.instruct.Instruction.process(Instruction.java:93) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:301) at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:229) at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:354) at net.sf.saxon.Controller.transformDocument(Controller.java:1849) at net.sf.saxon.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:144) at org.exist.util.serializer.ReceiverToSAX.endDocument(ReceiverToSAX.java:85) at org.exist.storage.serializers.XIncludeFilter.endDocument(XIncludeFilter.java:165) at org.exist.storage.serializers.Serializer.toSAX(Serializer.java:937) at org.exist.xquery.functions.transform.Transform.eval(Transform.java:267) at org.exist.xquery.BasicFunction.eval(BasicFunction.java:70) at org.exist.xquery.InternalFunctionCall.eval(InternalFunctionCall.java:55) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) at org.exist.xquery.PathExpr.eval(PathExpr.java:264) at org.exist.xquery.EnclosedExpr.eval(EnclosedExpr.java:80) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) at org.exist.xquery.PathExpr.eval(PathExpr.java:264) at org.exist.xquery.ElementConstructor.eval(ElementConstructor.java:307) at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:57) at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:64) at org.exist.xquery.LetExpr.eval(LetExpr.java:189) at org.exist.xquery.LetExpr.eval(LetExpr.java:187) at org.exist.xquery.BindingExpression.eval(BindingExpression.java:156) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) at org.exist.xquery.PathExpr.eval(PathExpr.java:264) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) at org.exist.xquery.XQuery.execute(XQuery.java:257) at org.exist.xquery.XQuery.execute(XQuery.java:204) at org.exist.http.RESTServer.executeXQuery(RESTServer.java:1525) at org.exist.http.RESTServer.doGet(RESTServer.java:502) at org.exist.http.servlets.EXistServlet.doGet(EXistServlet.java:222) at javax.servlet.http.HttpServlet.service(HttpServlet.java:735) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:578) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:229) at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:103) at org.exist.http.urlrewrite.Forward.doRewrite(Forward.java:47) at org.exist.http.urlrewrite.XQueryURLRewrite.doRewrite(XQueryURLRewrite.java:555) at org.exist.http.urlrewrite.XQueryURLRewrite.service(XQueryURLRewrite.java:336) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1336) at de.betterform.agent.web.filter.XFormsFilter.doFilter(XFormsFilter.java:173) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:365) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:485) at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:926) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:988) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) at java.lang.Thread.run(Thread.java:662) On Fri, Mar 1, 2013 at 10:41 PM, Joe Wicentowski <jo...@gm...> wrote: > Hi Dan, > >> The error I get is: >> >> <exception> >> <path>/db/apps/graph2svg/unit-tests/test-math-functions.xq</path> >> <message>exerr:ERROR Exception while transforming node: Cannot find a >> matching 1-argument function named {http://exslt.org/math}log() [at >> line 8, column 5]</message> >> </exception> > > Do you see anything more detailed in exist.log? > > Joe -- Dan McCreary NoSQL Evangelist office: (952) 931-9198 cell: (612) 986-1552 |
From: Dannes W. <da...@ex...> - 2013-03-02 15:36:26
Attachments:
smime.p7s
|
so..... the saxon processor does not know the exslt.org namespace...... which is probably true since the free version of Saxon does not allow extension functions anymore? cheers Dannes On 2 Mar 2013, at 15:35 , Dan McCreary <dan...@gm...> wrote: > Thanks for reminding me to check this! > >> Do you see anything more detailed in exist.log? > > Here is the error from exist.log: > > 2013-03-02 08:31:15,511 [eXistThread-32] WARN (Transform.java > [fatalError]:779) - XSL transform reports fatal error: Cannot find a > matching 1-argument function named {http://exslt.org/math}log() > ; Line#: -1; Column#: -1 > net.sf.saxon.trans.XPathException: Cannot find a matching 1-argument > function named {http://exslt.org/math}log() > at net.sf.saxon.expr.ErrorExpression.evaluateItem(ErrorExpression.java:58) -- Dannes Wessels eXist-db Open Source Native XML Database e: da...@ex... w: http://www.exist-db.org t: #existdb |
From: Dan M. <dan...@gm...> - 2013-03-02 15:53:43
|
Hi Dannes, Yes, you are right! This does makes sense! If you read here: http://saxon.sourceforge.net/ *professional edition.. adds a number of features to Saxon-HE, including support for Saxon extensions and extensibility mechanisms* I am now considering abandoning this project since I don't think others will want to pay for a license to Saxon to create simple bar chart. Does anyone else get the feeling that XSLT is now a very limited technology for the open source world? Do we need a good open source alternatives to XML transformation? Perhaps XQuery 3.0 annotations will make typeswitch style transformations more attractive. Any other suggestions? I like the declarative nature these charts and being able to query the chart specifications<http://www.anychart.com/blog/2011/09/22/building-a-large-chart-ecosystem-with-anychart-and-native-xml-databases/> has help me in the past in many ways. We could revert to another version of XSLT, rewrite the transforms in XQuery typeswitch or use an alternative tool. But I just need a few simple charts for now to compare benchmark query times with current test set. Google charts and D3 are good JavaScript libraries but I will never be able to query the chart specs like "find all chart titles". etc. - Dan On Sat, Mar 2, 2013 at 9:36 AM, Dannes Wessels <da...@ex...> wrote: > so..... the saxon processor does not know the exslt.org namespace...... > which is probably true since the free version of Saxon does not allow > extension functions anymore? > > cheers > > Dannes > > > On 2 Mar 2013, at 15:35 , Dan McCreary <dan...@gm...> wrote: > > Thanks for reminding me to check this! > > Do you see anything more detailed in exist.log? > > > Here is the error from exist.log: > > 2013-03-02 08:31:15,511 [eXistThread-32] WARN (Transform.java > [fatalError]:779) - XSL transform reports fatal error: Cannot find a > matching 1-argument function named {http://exslt.org/math}log() > ; Line#: -1; Column#: -1 > net.sf.saxon.trans.XPathException: Cannot find a matching 1-argument > function named {http://exslt.org/math}log() > at net.sf.saxon.expr.ErrorExpression.evaluateItem(ErrorExpression.java:58) > > > -- > Dannes Wessels > eXist-db Open Source Native XML Database > e: da...@ex... w: http://www.exist-db.org t: #existdb > > > > > > -- Dan McCreary NoSQL Evangelist office: (952) 931-9198 cell: (612) 986-1552 |
From: George C. B. <ge...@ox...> - 2013-03-03 00:39:37
|
Hi Dan, Saxon HE supports extensions, but they need to be "integrated extension functions" http://www.saxonica.com/documentation/extensibility/integratedfunctions.xml and you can install them by implementing an Initializer. This can be set also from the command line though the -init option, see http://www.saxonica.com/documentation/using-xsl/commandline.xml *** -init:initializer The value is the name of a user-supplied class that implements the interface net.sf.saxon.Initializer; this initializer will be called during the initialization process, and may be used to set any options required on the Configuration programmatically. It is particularly useful for such tasks as registering extension functions, collations, or external object models, especially in Saxon-HE where the option does not exist to do this via a configuration file. *** So, Saxon HE does not directly support extensions but if you are willing to write some Java code then you can add the extensions you need as integrated extensions. Hope that helps! Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 3/2/13 5:53 PM, Dan McCreary wrote: > Hi Dannes, > > Yes, you are right! This does makes sense! > > If you read here: > > http://saxon.sourceforge.net/ > > /professional edition.. adds a number of features to Saxon-HE, including > support for Saxon extensions and extensibility mechanisms/ > > I am now considering abandoning this project since I don't think others > will want to pay for a license to Saxon to create simple bar chart. Does > anyone else get the feeling that XSLT is now a very limited technology > for the open source world? Do we need a good open source alternatives > to XML transformation? Perhaps XQuery 3.0 annotations will make > typeswitch style transformations more attractive. > > Any other suggestions? I like the declarative nature these charts and > being able to query the chart specifications > <http://www.anychart.com/blog/2011/09/22/building-a-large-chart-ecosystem-with-anychart-and-native-xml-databases/> has > help me in the past in many ways. We could revert to another version of > XSLT, rewrite the transforms in XQuery typeswitch or use an alternative > tool. But I just need a few simple charts for now to compare benchmark > query times with current test set. Google charts and D3 are good > JavaScript libraries but I will never be able to query the chart specs > like "find all chart titles". etc. > > - Dan > > On Sat, Mar 2, 2013 at 9:36 AM, Dannes Wessels <da...@ex... > <mailto:da...@ex...>> wrote: > > so..... the saxon processor does not know the exslt.org > <http://exslt.org> namespace...... > > which is probably true since the free version of Saxon does not allow > > extension functions anymore? > > > > cheers > > > > Dannes > > > > > > On 2 Mar 2013, at 15:35 , Dan McCreary <dan...@gm... > <mailto:dan...@gm...>> wrote: > > > > Thanks for reminding me to check this! > > > > Do you see anything more detailed in exist.log? > > > > > > Here is the error from exist.log: > > > > 2013-03-02 08:31:15,511 [eXistThread-32] WARN (Transform.java > > [fatalError]:779) - XSL transform reports fatal error: Cannot find a > > matching 1-argument function named {http://exslt.org/math}log() > > ; Line#: -1; Column#: -1 > > net.sf.saxon.trans.XPathException: Cannot find a matching 1-argument > > function named {http://exslt.org/math}log() > > at > net.sf.saxon.expr.ErrorExpression.evaluateItem(ErrorExpression.java:58) > > > > > > -- > > Dannes Wessels > > eXist-db Open Source Native XML Database > > e: da...@ex... <mailto:da...@ex...> w: > http://www.exist-db.org t: #existdb > > > > > > > > > > > > > > > > -- > Dan McCreary > NoSQL Evangelist > office: (952) 931-9198 > cell: (612) 986-1552 > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > > > > _______________________________________________ > Exist-development mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-development > |