Saxonica Developer Community: Issueshttps://saxonica.plan.io/https://saxonica.plan.io/favicon.ico2024-03-27T11:18:36ZSaxonica Developer Community
Planio Saxon - Bug #6379 (New): Default implementation of fn:deep-equalhttps://saxonica.plan.io/issues/63792024-03-27T11:18:36ZNorm Tovey-Walsh
<p>I happened to trace my way through a call to deep equal in Saxon HE 12.4 and I was a little bit surprised to find that it's using the <code>DeepEqual40</code> implementation. I wonder if that was intentional...</p> SaxonJS - Bug #6374 (New): saxon.compile removed in 2.6+?https://saxonica.plan.io/issues/63742024-03-19T09:54:05ZJai B
<p>Hi,</p>
<p>I've always used the <code>saxon.compile</code> function to generate sef files in code. I know it's undocumented but IIRC it was shown in the command line docs or something.</p>
<p>Basically I cache the compiled sef so I don't have to recompile everytime I want to do a transform and I don't want to pre-transform my XSLT files on the command line, nor do I have any desire to use the Java version for that part, the JS compiler has worked amazingly!</p>
<p>My web app does server side transformations with node; anytime it sees the XSLT change, it runs a compile to generate and cache a new sef to use for subsequent transformations. I can't cache the result of the transformation either since the data is dynamic, of course.</p>
<p>Perhaps I'm missing something or missing some changes, but this has worked awesome for years and only just noticed things breaking when redeploying some stuff and npm updating to 2.6.0 and getting an error that the function doesn't exist.</p>
<p>When I was initially implementing this, I know I spent a fair bit of time trying to figure this part out and ensure I was doing things right; I think I scoped the code that generates the sef on command line to find the function in the first place and was surprised it wasn't actually documented/available anyway.</p>
<p>Thanks again for SaxonJS!</p> SaxonC - Bug #6351 (In Progress): Getting the line number is not available via the API on XdmNodehttps://saxonica.plan.io/issues/63512024-02-17T11:32:24ZO'Neil Delprattoneil@saxonica.com
<p>Reported by user here: <a href="https://stackoverflow.com/questions/78008394/how-do-i-get-the-line-numbers-of-a-saxonc-xpath-match/78009287#78009287" class="external">https://stackoverflow.com/questions/78008394/how-do-i-get-the-line-numbers-of-a-saxonc-xpath-match/78009287#78009287</a></p>
<p>There is no straight forward way to get the line number on a XdmNode in C++, PHP and Python.</p>
<p>For example, the Python PyXdmNode (see: <a href="https://www.saxonica.com/saxon-c/doc12/html/saxonc.html#PyXdmNode" class="external">https://www.saxonica.com/saxon-c/doc12/html/saxonc.html#PyXdmNode</a>) currently does not support getting line numbers as its Java equivalent class XdmNode: <a href="https://www.saxonica.com/html/documentation12/javadoc/net/sf/saxon/s9api/XdmNode.html#getLineNumber()" class="external">https://www.saxonica.com/html/documentation12/javadoc/net/sf/saxon/s9api/XdmNode.html#getLineNumber()</a></p> SaxonJS - Bug #6346 (New): NPE with replace() on SaxonJS2.6 when exported under 4.0-support condi...https://saxonica.plan.io/issues/63462024-02-14T14:05:50ZJohn Lumleyjohn@saxonica.com
<p>When exporting a stylesheet (either 3.0 or 4.0) for SaxonJS 2.6, using SaxonEE 12.4 running under <code> --allowSyntaxExtensions:on</code>,
a three-argument call on <code>replace()</code> (that is with the fourth <code>$flags</code> argument to default to the empty string), at runtime a null pointer expection is thrown when attempting to retrieve the flags:</p>
<pre><code class="javascript syntaxhl" data-language="javascript"><span class="kd">const</span> <span class="nx">flags</span> <span class="o">=</span> <span class="nx">args</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="p">?</span> <span class="nx">args</span><span class="p">[</span><span class="mi">3</span><span class="p">].</span><span class="nx">next</span><span class="p">().</span><span class="nx">toString</span><span class="p">()</span> <span class="p">:</span> <span class="dl">""</span><span class="p">;</span>
</code></pre>
<p>The <code>next()</code> returns a null.</p>
<p>Without <code>allowSyntaxExtensions</code> or with the fourth argument supplied, the function behaves as expected.</p>
<p>Sample stylesheet, compiled SEF and web page attached</p> Saxon - Bug #6323 (AwaitingInfo): Nullpointer Exceptionhttps://saxonica.plan.io/issues/63232024-01-18T15:48:06ZUrvish Amin
<p>We are getting NullPointerException , see below. It doesnt give much information about which attribute or specific item it fails. Let us know what could be an issue or how to debug this issue. Can we get source code so we can debug code and see for which element it fails? I have attached our xslt files.</p>
<h2>--
Caused by: java.lang.NullPointerException: Cannot invoke "net.sf.saxon.om.Sequence.makeRepeatable()" because "value" is null
at net.sf.saxon.expr.XPathContextMinor.setLocalVariable(XPathContextMinor.java:374) ~[Saxon-EE-11.6.jar:?]</h2>
<p>2024-01-17T05:44:13,566 ERROR [ESLA] [TEMLC-W-CSP_tst821_ESLA_REQUEST_IO_CSS-FROM-ULDD_COMPLETED_IN-5] ?#:
Handling Message: bpid=IOUTILITY 1000 bpMsgId=5f964850-5841-4fee-beef-cc2ef745f25e entityNameType=request.io.css-from-uldd entityState=COMPLETED entityIdentifiers=RequestIdentifier=WebService-FRE_1.13.1_FRM_3138W9X88_201309_10L_1of1_P1W_SWCWI_ONE__V11.3_14.2_14.1_02272017_ShelfOnly_DATA.xml
Transformation failure for RqstPrcsID::10184
com.css.csp.interfaces.transform.InterfacesWrapperTransformerException: Error transforming with compiled templates
at com.css.csp.interfaces.transform.XSLTTransformer.transformCompiled(XSLTTransformer.java:682) ~[interfaces-transformer-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.transform.XSLTTransformer.transformCompiled(XSLTTransformer.java:649) ~[interfaces-transformer-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.transform.service.TransformationService.transform(TransformationService.java:63) ~[interfaces-transformer-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.processor.TransformerAndValidatorUtil.transformAndValidate(TransformerAndValidatorUtil.java:146) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.processor.SplitterAndTransformer.processMessage(SplitterAndTransformer.java:93) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.processor.GenericSplitterAndTransformer.processMessage(GenericSplitterAndTransformer.java:92) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.eventmgmt.impl.EventHandler.processMessage(EventHandler.java:100) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.eventmgmt.EventRouter.processMessage(EventRouter.java:77) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at jdk.internal.reflect.GeneratedMethodAccessor189.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:64) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:241) ~[spring-aop-5.3.29.jar:5.3.29]
at jdk.proxy3.$Proxy97.processMessage(Unknown Source) ~[?:?]
at com.css.csp.interfaces.spring.EventObjectListener.onMessage(EventObjectListener.java:42) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at jdk.internal.reflect.GeneratedMethodAccessor192.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:169) ~[spring-messaging-5.3.29.jar:5.3.29]
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:119) ~[spring-messaging-5.3.29.jar:5.3.29]
at org.springframework.integration.handler.support.MessagingMethodInvokerHelper$HandlerMethod.invoke(MessagingMethodInvokerHelper.java:1103) ~[spring-integration-core-5.5.18.jar:5.5.18]
at org.springframework.integration.handler.support.MessagingMethodInvokerHelper.invokeHandlerMethod(MessagingMethodInvokerHelper.java:585) ~[spring-integration-core-5.5.18.jar:5.5.18]
at org.springframework.integration.handler.support.MessagingMethodInvokerHelper.processInternal(MessagingMethodInvokerHelper.java:480) ~[spring-integration-core-5.5.18.jar:5.5.18]
at org.springframework.integration.handler.support.MessagingMethodInvokerHelper.process(MessagingMethodInvokerHelper.java:358) ~[spring-integration-core-5.5.18.jar:5.5.18]
at org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:110) ~[spring-integration-core-5.5.18.jar:5.5.18]
at org.springframework.integration.handler.ServiceActivatingHandler.handleRequestMessage(ServiceActivatingHandler.java:105) ~[spring-integration-core-5.5.18.jar:5.5.18]
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:136) ~[spring-integration-core-5.5.18.jar:5.5.18]
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:55) ~[spring-integration-core-5.5.18.jar:5.5.18]
at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:115) ~[spring-integration-core-5.5.18.jar:5.5.18]
at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:133) ~[spring-integration-core-5.5.18.jar:5.5.18]
at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:106) ~[spring-integration-core-5.5.18.jar:5.5.18]
at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:72) ~[spring-integration-core-5.5.18.jar:5.5.18]
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:317) ~[spring-integration-core-5.5.18.jar:5.5.18]
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:272) ~[spring-integration-core-5.5.18.jar:5.5.18]
at com.css.csp.interfaces.spring.ChannelMessageSender.sendOutMessage(ChannelMessageSender.java:40) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.eventmgmt.EventRouter.sendMessage(EventRouter.java:112) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.eventmgmt.impl.EventHandler.extractAndSendImmediateEvents(EventHandler.java:222) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.eventmgmt.impl.EventHandler.processMessage(EventHandler.java:114) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.eventmgmt.EventRouter.processMessage(EventRouter.java:77) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at jdk.internal.reflect.GeneratedMethodAccessor189.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:64) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:241) ~[spring-aop-5.3.29.jar:5.3.29]
at jdk.proxy3.$Proxy97.processMessage(Unknown Source) ~[?:?]
at com.css.csp.interfaces.eventmgmt.EventRouterInvoker.processMessage(EventRouterInvoker.java:47) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.processor.IOEventExtractorProcessor.createULDDEvent(IOEventExtractorProcessor.java:118) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.processor.IOEventExtractorProcessor.processMessage(IOEventExtractorProcessor.java:66) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.eventmgmt.impl.EventHandler.processMessage(EventHandler.java:100) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.eventmgmt.EventRouter.processMessage(EventRouter.java:77) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at jdk.internal.reflect.GeneratedMethodAccessor189.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:64) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.29.jar:5.3.29]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:241) ~[spring-aop-5.3.29.jar:5.3.29]
at jdk.proxy3.$Proxy97.processMessage(Unknown Source) ~[?:?]
at com.css.csp.interfaces.appframework.handlers.AbstractEventHandler.dispatchTask(AbstractEventHandler.java:137) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.appframework.handlers.RequestIoCssFromUlddReceivedToCompletedEventHandler.handleEvent(RequestIoCssFromUlddReceivedToCompletedEventHandler.java:56) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.appframework.handlers.RequestIoCssFromUlddReceivedToCompletedEventHandler.handleEvent(RequestIoCssFromUlddReceivedToCompletedEventHandler.java:31) ~[interfaces-base-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.appframework.internal.jms.handling.DefaultEventLifecycleHandler.handle(DefaultEventLifecycleHandler.java:131) ~[appframework-core-24.3.0.jar:24.3.0]
at com.css.csp.appframework.internal.jms.EventLifecycleManager.processEvent(EventLifecycleManager.java:211) ~[appframework-core-24.3.0.jar:24.3.0]
at com.css.csp.appframework.internal.messaging.aws.AwsMessagingListener.onMessage(AwsMessagingListener.java:94) ~[appframework-core-24.3.0.jar:24.3.0]
at jdk.internal.reflect.GeneratedMethodAccessor196.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:169) ~[spring-messaging-5.3.29.jar:5.3.29]
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:119) ~[spring-messaging-5.3.29.jar:5.3.29]
at org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.handleMatch(AbstractMethodMessageHandler.java:569) ~[spring-messaging-5.3.29.jar:5.3.29]
at org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.handleMessageInternal(AbstractMethodMessageHandler.java:524) ~[spring-messaging-5.3.29.jar:5.3.29]
at org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.handleMessage(AbstractMethodMessageHandler.java:458) ~[spring-messaging-5.3.29.jar:5.3.29]
at com.css.csp.appframework.internal.messaging.aws.TransactionEmulatedMessageListenerContainer.executeMessage(TransactionEmulatedMessageListenerContainer.java:338) ~[appframework-core-24.3.0.jar:24.3.0]
at com.css.csp.appframework.internal.messaging.aws.TransactionEmulatedMessageListenerContainer$MessageExecutor.run(TransactionEmulatedMessageListenerContainer.java:711) ~[appframework-core-24.3.0.jar:24.3.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.IllegalStateException: java.lang.RuntimeException: Internal error evaluating template rule at line 7 in module jar:file:/opt/catalina/webapps/interfaces-web/WEB-INF/lib/interfaces-transformer-24.3.0-RC4.jar!/stylesheets/facade/Int-1.13.1-SecurityReadyPayloadBuilderFacade.xsl
at net.sf.saxon.resource.ActiveSAXSource.deliver(ActiveSAXSource.java:233) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.event.Sender.send(Sender.java:105) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.jaxp.IdentityTransformer.transform(IdentityTransformer.java:364) ~[Saxon-EE-11.6.jar:?]
at com.css.csp.interfaces.transform.XSLTTransformer._transform(XSLTTransformer.java:836) ~[interfaces-transformer-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.transform.XSLTTransformer._transform(XSLTTransformer.java:867) ~[interfaces-transformer-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.transform.XSLTTransformer.transformCompiled(XSLTTransformer.java:680) ~[interfaces-transformer-24.3.0-RC4.jar:24.3.0-RC4]
... 94 more
Caused by: java.lang.RuntimeException: Internal error evaluating template rule at line 7 in module jar:file:/opt/catalina/webapps/interfaces-web/WEB-INF/lib/interfaces-transformer-24.3.0-RC4.jar!/stylesheets/facade/Int-1.13.1-SecurityReadyPayloadBuilderFacade.xsl
at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:411) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:551) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.trans.XsltController.applyTemplates(XsltController.java:685) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.s9api.AbstractXsltTransformer.applyTemplatesToSource(AbstractXsltTransformer.java:422) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:359) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.jaxp.TransformerImpl.transform(TransformerImpl.java:75) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.jaxp.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:185) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.event.ContentHandlerProxy.close(ContentHandlerProxy.java:298) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.event.ProxyReceiver.close(ProxyReceiver.java:104) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.event.SequenceNormalizer.close(SequenceNormalizer.java:160) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.event.ReceivingContentHandler.endDocument(ReceivingContentHandler.java:269) ~[Saxon-EE-11.6.jar:?]
at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
at net.sf.saxon.resource.ActiveSAXSource.deliver(ActiveSAXSource.java:190) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.event.Sender.send(Sender.java:105) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.jaxp.IdentityTransformer.transform(IdentityTransformer.java:364) ~[Saxon-EE-11.6.jar:?]
at com.css.csp.interfaces.transform.XSLTTransformer._transform(XSLTTransformer.java:836) ~[interfaces-transformer-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.transform.XSLTTransformer._transform(XSLTTransformer.java:867) ~[interfaces-transformer-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.transform.XSLTTransformer.transformCompiled(XSLTTransformer.java:680) ~[interfaces-transformer-24.3.0-RC4.jar:24.3.0-RC4]
... 94 more
Caused by: java.lang.NullPointerException: Cannot invoke "net.sf.saxon.om.Sequence.makeRepeatable()" because "value" is null
at net.sf.saxon.expr.XPathContextMinor.setLocalVariable(XPathContextMinor.java:374) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:747) ~[Saxon-EE-11.6.jar:?]
at com.saxonica.ee.bytecode.ByteCodeCandidate.processLeavingTail(ByteCodeCandidate.java:192) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:266) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:384) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:357) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:357) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) ~[Saxon-EE-11.6.jar:?]
at com.saxonica.ee.bytecode.ByteCodeCandidate.processLeavingTail(ByteCodeCandidate.java:192) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:266) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:384) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:357) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) ~[Saxon-EE-11.6.jar:?]
at com.saxonica.ee.bytecode.ByteCodeCandidate.processLeavingTail(ByteCodeCandidate.java:192) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:266) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:384) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.CallTemplate.processLeavingTail(CallTemplate.java:446) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:755) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:142) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:357) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:392) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:551) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.trans.XsltController.applyTemplates(XsltController.java:685) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.s9api.AbstractXsltTransformer.applyTemplatesToSource(AbstractXsltTransformer.java:422) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:359) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.jaxp.TransformerImpl.transform(TransformerImpl.java:75) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.jaxp.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:185) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.event.ContentHandlerProxy.close(ContentHandlerProxy.java:298) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.event.ProxyReceiver.close(ProxyReceiver.java:104) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.event.SequenceNormalizer.close(SequenceNormalizer.java:160) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.event.ReceivingContentHandler.endDocument(ReceivingContentHandler.java:269) ~[Saxon-EE-11.6.jar:?]
at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
at net.sf.saxon.resource.ActiveSAXSource.deliver(ActiveSAXSource.java:190) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.event.Sender.send(Sender.java:105) ~[Saxon-EE-11.6.jar:?]
at net.sf.saxon.jaxp.IdentityTransformer.transform(IdentityTransformer.java:364) ~[Saxon-EE-11.6.jar:?]
at com.css.csp.interfaces.transform.XSLTTransformer._transform(XSLTTransformer.java:836) ~[interfaces-transformer-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.transform.XSLTTransformer._transform(XSLTTransformer.java:867) ~[interfaces-transformer-24.3.0-RC4.jar:24.3.0-RC4]
at com.css.csp.interfaces.transform.XSLTTransformer.transformCompiled(XSLTTransformer.java:680) ~[interfaces-transformer-24.3.0-RC4.jar:24.3.0-RC4]
... 94 more</p> SaxonC - Bug #6317 (In Progress): The cwd is limited to 256 charactershttps://saxonica.plan.io/issues/63172024-01-12T13:05:40ZNorm Tovey-Walsh
<ol>
<li>What lengths should we use for the various platforms?</li>
<li>Where is this documented?</li>
</ol> Saxon - Bug #6307 (New): Saxon (HE; Java) trace missing xsl:accumulator and xsl:accumulator-rule,...https://saxonica.plan.io/issues/63072023-12-27T21:52:00ZA Galtman
<ul>
<li>Is the trace supposed to mark xsl:accumulator as hit?</li>
<li>Is the trace supposed to mark xsl:accumulator-rule as hit?</li>
<li>I definitely expect descendant elements of xsl:accumulator-rule to be marked as hit, and I'm not seeing them in Saxon 12.4. Saxon 9.9.1.8 correctly lists the descendants of xsl:accumulator-rule.</li>
</ul>
<p>I'm attaching a file that includes the code, the Saxon arguments I used, and the traces I got from Saxon 9.9.1.8 and 12.4.</p> Saxon - Bug #6305 (New): XPathException "The stylesheet module includes/imports itself directly o...https://saxonica.plan.io/issues/63052023-12-22T15:02:48ZGerben Abbinkgerben.abbink@gmail.com
<p>I use an ErrorReporter with XsltCompiler, like this:</p>
<pre><code>XsltCompiler compiler = processor.newXsltCompiler();
compiler.setErrorReporter(...);
</code></pre>
<p>Usually, XPathExceptions have a Location to identify the error in the file.</p>
<p>But, when I use this template, there is no location information:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=""/>
</xsl:stylesheet>
</code></pre> Saxon - Bug #6302 (New): Saxon (HE; Java) trace not well-formed when XSLT uses transform functionhttps://saxonica.plan.io/issues/63022023-12-21T19:56:45ZA Galtman
<p>(I alluded to this in my 12/21/23 comment in <a href="https://saxonica.plan.io/issues/6295" class="external">https://saxonica.plan.io/issues/6295</a> but it seems different enough that I'm making a separate issue for it rather than assume that the fix for 6295 is enough.)</p>
<p>The <code>transform()</code> function seems to cause the Saxon trace not to be well-formed.</p>
<a name="Sample-XSLT-1-transform-functionxsl"></a>
<h3 >Sample XSLT 1, transform-function.xsl<a href="#Sample-XSLT-1-transform-functionxsl" class="wiki-anchor">¶</a></h3>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:my="my-ns"
exclude-result-prefixes="#all"
version="3.0">
<xsl:template name="xsl:initial-template">
<xsl:variable name="transform-options" as="map(xs:string, item()*)">
<xsl:map>
<xsl:map-entry key="'delivery-format'" select="'raw'"/>
<xsl:map-entry key="'stylesheet-location'">target-stylesheet-small.xsl</xsl:map-entry>
<xsl:map-entry key="'function-params'" select="[()]"/>
<xsl:map-entry key="'initial-function'" select="QName('my-ns', 'my:fcn')"/>
</xsl:map>
</xsl:variable>
<xsl:sequence select="transform($transform-options)?output"/>
</xsl:template>
</xsl:stylesheet>
</code></pre>
<a name="Sample-XSLT-2-target-stylesheet-smallxsl"></a>
<h3 >Sample XSLT 2, target-stylesheet-small.xsl<a href="#Sample-XSLT-2-target-stylesheet-smallxsl" class="wiki-anchor">¶</a></h3>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:my="my-ns"
exclude-result-prefixes="#all"
version="3.0">
<xsl:function name="my:fcn" visibility="public" as="xs:string">
<xsl:param name="p" as="empty-sequence()"/>
<xsl:sequence select="'output'"/>
</xsl:function>
</xsl:stylesheet>
</code></pre>
<a name="Saxon-command"></a>
<h3 >Saxon command<a href="#Saxon-command" class="wiki-anchor">¶</a></h3>
<pre><code>java -cp "%SAXON_CP%" net.sf.saxon.Transform -opt:0 -T -Tlevel:high -it -xsl:transform-function.xsl 2>transform-function-traceresult.xml
</code></pre>
<p>I'm using Saxon-HE 12.4.</p>
<a name="Trace-Result"></a>
<h3 >Trace Result<a href="#Trace-Result" class="wiki-anchor">¶</a></h3>
<pre><code><trace saxon-version="12.4" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name="xsl:initial-template" line="9" column="45" module="transform-function.xsl">
<xsl:variable name="transform-options" line="10" column="73" module="transform-function.xsl">
<trace text="target-stylesheet-small.xsl" line="13" column="52" module="transform-function.xsl">
</trace>
<trace saxon-version="12.4" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:function arity="1" name="my:fcn" line="9" column="66" module="target-stylesheet-small.xsl">
</xsl:function>
</xsl:variable>
</xsl:template>
</trace>
</code></pre> SaxonJS - Bug #6298 (New): base-uri() value does not update together with DOMhttps://saxonica.plan.io/issues/62982023-12-19T23:34:51ZMartynas Jusevicius
<p>My SaxonJS code replaces large chunks of DOM with content loaded from different documents. DOM's baseURI property returns the source document's URL, but <code>base-uri()</code> does not always seem to do that. Which can lead to a stale value, probably because the DOM is updated?</p>
<p>This is my observation of the discrepancy:</p>
<pre><code>ixsl:get(., 'baseURI'): https://localhost:4443/7b386331-5a82-46ab-820b-38df78a91456/ SaxonJS2.rt.js:785:84
base-uri(): https://localhost:4443/ SaxonJS2.rt.js:785:84
ixsl:location(): https://localhost:4443/7b386331-5a82-46ab-820b-38df78a91456/
</code></pre> SaxonJS - Bug #6250 (New): SyntaxError: Unexpected token '='https://saxonica.plan.io/issues/62502023-11-11T13:53:59ZPrasad Kuppa
<p>Hi Team,
Getting below error while running xslt3 from command line.</p>
<p>/usr/local/lib/node_modules/xslt3/node_modules/saxon-js/SaxonJS2N.js:4290
q("not a node"),Error.tg&&Error.tg(),q("wrong node kind "+p.nodeType)}const k=fc;a(E,"indent","boolean",!1);return d(u)}}}();const Td=function(){function a(r,g,e,n,y){e="xml"===e?g.fixed.gb:g.fixed.$b;g=g.fixed.hd;var u=e[r];if(!u||u instanceof H){u=g[r];if(!u){try{u=n()}catch(E){u=E}g[r]=u}u=y(u);e[r]=u}if(u instanceof H)throw u;return u}function b(r,g){g||="utf-8";r=void 0===r.Ob?r:r.Ob;if(g.startsWith("utf")&&0<=r.indexOf("\ufffd"))throw new H("External file contains non-Unicode characters","FOUT1190");return r}function h(r){if(0<=r.indexOf("\x00"))throw new H("External file contains non-XML characters","FOUT1190");
^</p>
<p>SyntaxError: Unexpected token '='
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/usr/local/lib/node_modules/xslt3/xslt3.js:43:357)
at Object. (/usr/local/lib/node_modules/xslt3/xslt3.js:93:95)
at Module._compile (internal/modules/cjs/loader.js:999:30)</p>
<p>OS: Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-70-generic x86_64)
Node Version: v12.22.9
NPM Version: 8.5.1
SaxonJS Versions tried: 2.3.0, 2.4.0, 2.5.0 & 2.6.0</p>
<p>Thank you for your support.</p> SaxonJS - Bug #6245 (New): broken links in SaxonJS documentation https://saxonica.plan.io/issues/62452023-11-08T14:13:28ZMartin Honnenmartin.honnen@gmx.de
<p><a href="https://www.saxonica.com/saxon-js/documentation2/index.html#!conformance/xslt30" class="external">https://www.saxonica.com/saxon-js/documentation2/index.html#!conformance/xslt30</a> has (at least) two not working links, in the row for <code>vendor-options</code> it says</p>
<blockquote>
<p>Enables syntax extensions for XSLT and XPath, specifically the conditional XSLT extensions described here and the XPath otherwise operator</p>
</blockquote>
<p>where</p>
<ol>
<li>"conditional XSLT extensions described here" links to <a href="https://www.saxonica.com/documentation12/index.html#!extensions/xslt-syntax-extensions" class="external">https://www.saxonica.com/documentation12/index.html#!extensions/xslt-syntax-extensions</a> which gives the error "Error in URI hash-path: Section 'xslt-syntax-extensions' not found in path: extensions/xslt-syntax-extensions"</li>
<li>"otherwise" links to <a href="https://www.saxonica.com/documentation12/index.html#!extensions/syntax-extensions/otherwise" class="external">https://www.saxonica.com/documentation12/index.html#!extensions/syntax-extensions/otherwise</a> which gives a similar error "Error in URI hash-path: Section 'syntax-extensions' not found in path: extensions/syntax-extensions/otherwise"</li>
</ol> SaxonJS - Bug #6234 (New): map call with sequence of more than one item as argument doesn't give ...https://saxonica.plan.io/issues/62342023-10-28T21:38:53ZMartin Honnenmartin.honnen@gmx.de
<p>In a test I tried to call an XPath 3.1 map as a function, passing in a sequence of two items as the argument; SaxonJ gives an error but SaxonJS happily runs the code e.g.</p>
<pre><code class="xml syntaxhl" data-language="xml"><span class="cp"><?xml version="1.0" encoding="utf-8"?></span>
<span class="nt"><xsl:stylesheet</span> <span class="na">xmlns:xsl=</span><span class="s">"http://www.w3.org/1999/XSL/Transform"</span>
<span class="na">version=</span><span class="s">"3.0"</span>
<span class="na">xmlns:xs=</span><span class="s">"http://www.w3.org/2001/XMLSchema"</span>
<span class="na">exclude-result-prefixes=</span><span class="s">"#all"</span>
<span class="na">expand-text=</span><span class="s">"yes"</span><span class="nt">></span>
<span class="nt"><xsl:param</span> <span class="na">name=</span><span class="s">"id-map"</span> <span class="na">select=</span><span class="s">"map { 1 : 2, 2 : (), 3 : 2, 4 : 3 }"</span><span class="nt">/></span>
<span class="nt"><xsl:template</span> <span class="na">match=</span><span class="s">"/"</span> <span class="na">name=</span><span class="s">"xsl:initial-template"</span><span class="nt">></span>
<span class="nt"><test></span>{$id-map((3, 4))}<span class="nt"></test></span>
<span class="nt"><xsl:comment></span>Run with {system-property('xsl:product-name')} {system-property('xsl:product-version')} {system-property('Q{http://saxon.sf.net/}platform')}<span class="nt"></xsl:comment></span>
<span class="nt"></xsl:template></span>
<span class="nt"></xsl:stylesheet></span>
</code></pre>
<p>when run with <code>xslt3 -it -xsl:test1.xsl</code> outputs</p>
<pre><code class="xml syntaxhl" data-language="xml"><span class="cp"><?xml version="1.0" encoding="UTF-8"?></span><span class="nt"><test></span>2<span class="nt"></test></span><span class="c"><!--Run with SaxonJS 2.6 Node.js--></span>
</code></pre>
<p>As <a href="https://www.w3.org/TR/xpath-31/#id-maps" class="external">https://www.w3.org/TR/xpath-31/#id-maps</a> defines calling a map as doing <code>map:get</code> with the signature (<a href="https://www.w3.org/TR/xpath-functions-31/#func-map-get" class="external">https://www.w3.org/TR/xpath-functions-31/#func-map-get</a>) <code>map:get($map as map(*), $key as xs:anyAtomicType) as item()*</code> the code should give an error "XPTY0004 A sequence of more than one item is not allowed as the first argument of map".</p>
<p>Interestingly enough, for a direct call <code>map:get($id-map, (3, 4))</code> SaxonJS gives the error "Required cardinality of second argument of map:get() is exactly one; supplied value contains 2 items (xs:integer('3'), xs:integer('4'))".</p> SaxonJS - Bug #6233 (New): ReferenceError: abstractNode is not definedhttps://saxonica.plan.io/issues/62332023-10-26T09:24:04ZThomas Barnekow
<p>I am trying to use SaxonJS 2.6.0 within a Next.js 13 project. I am using code that works on the Node.js runtime in Azure Functions. However, the same code leads to the following exception in Next.js:</p>
<p>⨯ node_modules/.pnpm/saxon-js@2.6.0/node_modules/saxon-js/SaxonJS2N.js (4640:147) @ abstractNode
⨯ ReferenceError: abstractNode is not defined
at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/saxon-js@2.6.0/node_modules/saxon-js/SaxonJS2N.js:277426:14)
at (rsc)/./node_modules/.pnpm/saxon-js@2.6.0/node_modules/saxon-js/SaxonJS2N.js (/Users/thomas/Source/Repos/platforms-starter-kit/.next/server/vendor-chunks/<a href="mailto:saxon-js@2.6.0.js" class="email">saxon-js@2.6.0.js</a>:20:1)
at <strong>webpack_require</strong> (/Users/thomas/Source/Repos/platforms-starter-kit/.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/./app/api/render-service-levels/route.ts:5:66)</p> SaxonJS - Bug #6132 (New): documentPool passed to SaxonJS.transform doesn't seem to be used if th...https://saxonica.plan.io/issues/61322023-07-18T16:53:41ZMartin Honnenmartin.honnen@gmx.de
<p>For SaxonJS.transform, I can pass a <code>documentPool</code>, mapping URLs to resources, to allow preloading resources or loading resources from a string.</p>
<p>An example of that is e.g. a stylesheet (shown here as XSLT, for SaxonJS it will be compiled to sef.json)</p>
<pre><code class="xml syntaxhl" data-language="xml"><span class="cp"><?xml version="1.0" encoding="utf-8"?></span>
<span class="nt"><xsl:stylesheet</span> <span class="na">xmlns:xsl=</span><span class="s">"http://www.w3.org/1999/XSL/Transform"</span>
<span class="na">version=</span><span class="s">"3.0"</span>
<span class="na">xmlns:xs=</span><span class="s">"http://www.w3.org/2001/XMLSchema"</span>
<span class="na">exclude-result-prefixes=</span><span class="s">"#all"</span>
<span class="na">expand-text=</span><span class="s">"yes"</span><span class="nt">></span>
<span class="nt"><xsl:template</span> <span class="na">name=</span><span class="s">"xsl:initial-template"</span><span class="nt">></span>
<span class="nt"><xsl:sequence</span> <span class="na">select=</span><span class="s">"doc('doc1.xml') => serialize(map{'method':'xml'})"</span><span class="nt">/></span>
<span class="nt"></xsl:template></span>
<span class="nt"></xsl:stylesheet></span>
</code></pre>
<p>and (for Node.js) Javascript code like</p>
<pre><code class="javascript syntaxhl" data-language="javascript"><span class="kd">const</span> <span class="nx">path</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">path</span><span class="dl">'</span><span class="p">);</span>
<span class="kd">const</span> <span class="nx">url</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">url</span><span class="dl">'</span><span class="p">);</span>
<span class="kd">const</span> <span class="nx">SaxonJS</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">saxon-js</span><span class="dl">'</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">xmlResource1</span> <span class="o">=</span> <span class="nx">SaxonJS</span><span class="p">.</span><span class="nx">getResource</span><span class="p">({</span><span class="dl">'</span><span class="s1">type</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">xml</span><span class="dl">'</span><span class="p">,</span> <span class="dl">'</span><span class="s1">text</span><span class="dl">'</span> <span class="p">:</span> <span class="dl">'</span><span class="s1"><root>foo</root></span><span class="dl">'</span> <span class="p">});</span>
<span class="kd">var</span> <span class="nx">doc1Uri</span> <span class="o">=</span> <span class="dl">'</span><span class="s1">doc1.xml</span><span class="dl">'</span><span class="p">;</span>
<span class="kd">var</span> <span class="nx">docPool</span> <span class="o">=</span> <span class="p">{};</span>
<span class="nx">xmlResource1</span><span class="p">.</span><span class="nx">then</span><span class="p">(</span><span class="nx">doc</span> <span class="o">=></span> <span class="p">{</span> <span class="nx">docPool</span><span class="p">[</span><span class="nx">url</span><span class="p">.</span><span class="nx">pathToFileURL</span><span class="p">(</span><span class="nx">path</span><span class="p">.</span><span class="nx">resolve</span><span class="p">(</span><span class="dl">'</span><span class="s1">.</span><span class="dl">'</span><span class="p">,</span> <span class="nx">doc1Uri</span><span class="p">))]</span> <span class="o">=</span> <span class="nx">doc</span><span class="p">;</span> <span class="p">})</span>
<span class="p">.</span><span class="nx">then</span><span class="p">(()</span> <span class="o">=></span> <span class="p">{</span>
<span class="c1">//console.log(docPool);</span>
<span class="nx">SaxonJS</span><span class="p">.</span><span class="nx">transform</span><span class="p">({</span> <span class="na">documentPool</span><span class="p">:</span> <span class="nx">docPool</span><span class="p">,</span> <span class="na">stylesheetLocation</span><span class="p">:</span> <span class="dl">'</span><span class="s1">documentPoolTest1.xsl.sef.json</span><span class="dl">'</span> <span class="p">},</span> <span class="dl">'</span><span class="s1">async</span><span class="dl">'</span><span class="p">).</span><span class="nx">then</span><span class="p">(</span><span class="nx">result</span> <span class="o">=></span> <span class="p">{</span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">SaxonJS</span><span class="p">.</span><span class="nx">serialize</span><span class="p">(</span><span class="nx">result</span><span class="p">.</span><span class="nx">principalResult</span><span class="p">));</span>
<span class="p">});</span>
<span class="p">});</span>
</code></pre>
<p>When I run that with Node I get e.g.</p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>&lt;root&gt;foo&lt;/root&gt;
</code></pre>
<p>so the <code>doc1.xml</code> is resolved from my passed in <code>documentPool</code> property.</p>
<p>However, when I do the same with an XSLT stylesheet having a function exposing <code>xsl:evaluate</code> with a public function and then call that function with <code>SaxonJS.transform</code> to pass in e.g. a string doing <code>doc("doc1.xml")</code> it seems the documentPool is not taken into account and instead I get an error that the file <code>doc1.xml</code> is not found:</p>
<pre><code>Transformation failure: Error FODC0002 at exposeXslEvaluate.xsl#17
Cannot read file file:///C:/Users/marti/OneDrive/Documents/xslt/saxonjs-documentPool/doc1.xml - ENOENT: no such file or directory, open 'C:\Users\marti\OneDrive\Documents\xslt\saxonjs-documentPool\doc1.xml'
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
Error
at new L (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4109:549)
at Object.readFile (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4713:171)
at Object.readFile (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4108:74)
at C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4340:316
at a (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4338:294)
at Object.Ec (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4340:280)
at doc (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4513:298)
at C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4632:444
at Object.I [as evaluate] (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4600:203)
at Object.evaluateXDM (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4933:464)
at C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4630:290
at Object.push (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4390:245)
at e (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4987:320)
at C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:5015:342 {
message: "Cannot read file file:///C:/Users/marti/OneDrive/Documents/xslt/saxonjs-documentPool/doc1.xml - ENOENT: no such file or directory, open 'C:\\Users\\marti\\OneDrive\\Documents\\xslt\\saxonjs-documentPool\\doc1.xml'",
name: 'XError',
code: 'FODC0002',
xsltLineNr: '17',
xsltModule: 'exposeXslEvaluate.xsl'
}
</code></pre>
<p>A sample XSLT is e.g.</p>
<pre><code class="xml syntaxhl" data-language="xml"><span class="nt"><xsl:stylesheet</span>
<span class="na">xmlns:xsl=</span><span class="s">"http://www.w3.org/1999/XSL/Transform"</span>
<span class="na">version=</span><span class="s">"3.0"</span>
<span class="na">xmlns:mf=</span><span class="s">"http://example.com/mf"</span>
<span class="na">xmlns:xs=</span><span class="s">"http://www.w3.org/2001/XMLSchema"</span>
<span class="na">exclude-result-prefixes=</span><span class="s">"#all"</span><span class="nt">></span>
<span class="nt"><xsl:function</span> <span class="na">name=</span><span class="s">"mf:eval"</span> <span class="na">as=</span><span class="s">"item()*"</span> <span class="na">visibility=</span><span class="s">"public"</span><span class="nt">></span>
<span class="nt"><xsl:param</span> <span class="na">name=</span><span class="s">"expression"</span> <span class="na">as=</span><span class="s">"xs:string"</span><span class="nt">/></span>
<span class="nt"><xsl:param</span> <span class="na">name=</span><span class="s">"context-item"</span> <span class="na">as=</span><span class="s">"item()?"</span><span class="nt">/></span>
<span class="nt"><xsl:param</span> <span class="na">name=</span><span class="s">"params"</span> <span class="na">as=</span><span class="s">"map(xs:QName, item()*)"</span><span class="nt">/></span>
<span class="nt"><xsl:evaluate</span> <span class="na">xpath=</span><span class="s">"$expression"</span> <span class="na">context-item=</span><span class="s">"$context-item"</span> <span class="na">with-params=</span><span class="s">"$params"</span><span class="nt">/></span>
<span class="nt"></xsl:function></span>
<span class="nt"><xsl:function</span> <span class="na">name=</span><span class="s">"mf:eval"</span> <span class="na">as=</span><span class="s">"item()*"</span> <span class="na">visibility=</span><span class="s">"public"</span><span class="nt">></span>
<span class="nt"><xsl:param</span> <span class="na">name=</span><span class="s">"expression"</span> <span class="na">as=</span><span class="s">"xs:string"</span><span class="nt">/></span>
<span class="nt"><xsl:evaluate</span> <span class="na">xpath=</span><span class="s">"$expression"</span> <span class="na">context-item=</span><span class="s">"()"</span> <span class="na">with-params=</span><span class="s">"map{}"</span><span class="nt">/></span>
<span class="nt"></xsl:function></span>
<span class="nt"><xsl:function</span> <span class="na">name=</span><span class="s">"mf:eval"</span> <span class="na">as=</span><span class="s">"item()*"</span> <span class="na">visibility=</span><span class="s">"public"</span><span class="nt">></span>
<span class="nt"><xsl:param</span> <span class="na">name=</span><span class="s">"expression"</span> <span class="na">as=</span><span class="s">"xs:string"</span><span class="nt">/></span>
<span class="nt"><xsl:param</span> <span class="na">name=</span><span class="s">"context-item"</span> <span class="na">as=</span><span class="s">"item()?"</span><span class="nt">/></span>
<span class="nt"><xsl:evaluate</span> <span class="na">xpath=</span><span class="s">"$expression"</span> <span class="na">context-item=</span><span class="s">"$context-item"</span> <span class="na">with-params=</span><span class="s">"map{}"</span><span class="nt">/></span>
<span class="nt"></xsl:function></span>
<span class="nt"></xsl:stylesheet></span>
</code></pre>
<p>the Javascript code is e.g.</p>
<pre><code class="javascript syntaxhl" data-language="javascript"><span class="kd">const</span> <span class="nx">path</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">path</span><span class="dl">'</span><span class="p">);</span>
<span class="kd">const</span> <span class="nx">url</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">url</span><span class="dl">'</span><span class="p">);</span>
<span class="kd">const</span> <span class="nx">SaxonJS</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">saxon-js</span><span class="dl">'</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">xmlResource1</span> <span class="o">=</span> <span class="nx">SaxonJS</span><span class="p">.</span><span class="nx">getResource</span><span class="p">({</span><span class="dl">'</span><span class="s1">type</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">xml</span><span class="dl">'</span><span class="p">,</span> <span class="dl">'</span><span class="s1">text</span><span class="dl">'</span> <span class="p">:</span> <span class="dl">'</span><span class="s1"><root>foo</root></span><span class="dl">'</span> <span class="p">});</span>
<span class="kd">var</span> <span class="nx">doc1Uri</span> <span class="o">=</span> <span class="dl">'</span><span class="s1">doc1.xml</span><span class="dl">'</span><span class="p">;</span>
<span class="kd">var</span> <span class="nx">docPool</span> <span class="o">=</span> <span class="p">{};</span>
<span class="nx">xmlResource1</span><span class="p">.</span><span class="nx">then</span><span class="p">(</span><span class="nx">doc</span> <span class="o">=></span> <span class="p">{</span> <span class="nx">docPool</span><span class="p">[</span><span class="nx">url</span><span class="p">.</span><span class="nx">pathToFileURL</span><span class="p">(</span><span class="nx">path</span><span class="p">.</span><span class="nx">resolve</span><span class="p">(</span><span class="dl">'</span><span class="s1">.</span><span class="dl">'</span><span class="p">,</span> <span class="nx">doc1Uri</span><span class="p">))]</span> <span class="o">=</span> <span class="nx">doc</span><span class="p">;</span> <span class="p">})</span>
<span class="p">.</span><span class="nx">then</span><span class="p">(()</span> <span class="o">=></span> <span class="p">{</span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">docPool</span><span class="p">);</span>
<span class="nx">SaxonJS</span><span class="p">.</span><span class="nx">transform</span><span class="p">({</span>
<span class="na">documentPool</span><span class="p">:</span> <span class="nx">docPool</span><span class="p">,</span>
<span class="na">stylesheetLocation</span><span class="p">:</span> <span class="dl">'</span><span class="s1">exposeXslEvaluate.xsl.sef.json</span><span class="dl">'</span><span class="p">,</span>
<span class="na">stylesheetBaseURI</span><span class="p">:</span> <span class="nx">url</span><span class="p">.</span><span class="nx">pathToFileURL</span><span class="p">(</span><span class="nx">path</span><span class="p">.</span><span class="nx">resolve</span><span class="p">(</span><span class="dl">'</span><span class="s1">.</span><span class="dl">'</span><span class="p">,</span> <span class="dl">'</span><span class="s1">exposeXslEvaluate.xsl</span><span class="dl">'</span><span class="p">)),</span>
<span class="na">initialFunction</span><span class="p">:</span> <span class="dl">'</span><span class="s1">Q{http://example.com/mf}eval</span><span class="dl">'</span><span class="p">,</span>
<span class="na">functionParams</span><span class="p">:</span> <span class="p">[</span><span class="dl">'</span><span class="s1">doc("doc1.xml")</span><span class="dl">'</span><span class="p">],</span>
<span class="na">destination</span><span class="p">:</span> <span class="dl">'</span><span class="s1">raw</span><span class="dl">'</span>
<span class="p">},</span> <span class="dl">'</span><span class="s1">async</span><span class="dl">'</span><span class="p">).</span><span class="nx">then</span><span class="p">(</span><span class="nx">result</span> <span class="o">=></span> <span class="p">{</span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">SaxonJS</span><span class="p">.</span><span class="nx">serialize</span><span class="p">(</span><span class="nx">result</span><span class="p">.</span><span class="nx">principalResult</span><span class="p">));</span>
<span class="p">});</span>
<span class="p">});</span>
</code></pre>