Saxonica Developer Community: Issueshttps://saxonica.plan.io/https://saxonica.plan.io/favicon.ico2024-03-15T13:57:04ZSaxonica Developer Community
Planio SaxonC - Bug #6372 (In Progress): Unable to parse Windows-1252 encoded XML files on Linuxhttps://saxonica.plan.io/issues/63722024-03-15T13:57:04ZMatt Patterson
<p>From the forum (<a href="https://saxonica.plan.io/boards/4/topics/9617" class="external">https://saxonica.plan.io/boards/4/topics/9617</a>):</p>
<blockquote>
<p>working with version 12.4.2 on Linux and having this simplified C++ code to explain what I do:</p>
<pre><code class="cpp syntaxhl" data-language="cpp"> <span class="n">SaxonProcessor</span> <span class="o">*</span><span class="n">processor</span> <span class="o">=</span> <span class="k">new</span> <span class="nf">SaxonProcessor</span><span class="p">(</span><span class="nb">true</span><span class="p">);</span>
<span class="n">Xslt30Processor</span> <span class="o">*</span><span class="n">trans</span> <span class="o">=</span> <span class="n">processor</span><span class="o">-></span><span class="n">newXslt30Processor</span><span class="p">();</span>
<span class="n">XsltExecutable</span> <span class="o">*</span><span class="n">executable</span> <span class="o">=</span> <span class="n">executable</span> <span class="o">=</span> <span class="n">trans</span><span class="o">-></span><span class="n">compileFromFile</span><span class="p">(</span><span class="s">"/tmp/test.xsl"</span><span class="p">);</span>
<span class="n">executable</span><span class="o">-></span><span class="n">setInitialMatchSelectionAsFile</span><span class="p">(</span><span class="s">"/tmp/file.xml"</span><span class="p">);</span>
<span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">output</span> <span class="o">=</span> <span class="n">executable</span><span class="o">-></span><span class="n">applyTemplatesReturningString</span><span class="p">();</span>
</code></pre>
<p>My file.xml header is like this:</p>
<pre><code class="xml syntaxhl" data-language="xml"><span class="cp"><?xml version="1.0" encoding="windows-1252" standalone="no"?></span>
</code></pre>
<p>I get the following exception running my program:</p>
<pre><code class="cpp syntaxhl" data-language="cpp"> <span class="n">SXXP0003</span> <span class="n">I</span><span class="o">/</span><span class="n">O</span> <span class="n">error</span> <span class="n">reported</span> <span class="n">by</span> <span class="n">XML</span> <span class="n">parser</span> <span class="n">processing</span>
<span class="n">file</span><span class="o">:</span><span class="c1">///tmp/file1.xml. Caused by</span>
<span class="n">java</span><span class="p">.</span><span class="n">io</span><span class="p">.</span><span class="n">UnsupportedEncodingException</span><span class="o">:</span> <span class="n">Cp1252</span>
</code></pre>
<p>My Linux its locale is en_US.UTF-8. Using XML files with utf-8 or iso-8859-1 encodings all work fine.</p>
<p>The same program and input files with windows-1252 encoding on Windows work though. I face this problem only on Linux.</p>
</blockquote> Saxon - Bug #6361 (In Progress): XPath parser continously looping to find Xpath function library ...https://saxonica.plan.io/issues/63612024-02-27T09:32:05ZManikandan S
<ul>
<li>I am trying to load a custom library of XPath functions in my project using a custom build jar. However when the function is called to load the XPath functions i get redirected to XPathParser.java class which is present in the package net.sf.saxon.expr.parser, where a function is called - reportMissingFunction which consist of the following loop and it never exits this loop even though it could not find the a particular XPath function.</li>
<li>Jar file is located in classpath under JVM_PARAMS, Xpath function is able to find that jar from classPath.</li>
</ul>
<pre><code class="java syntaxhl" data-language="java"> <span class="k">if</span> <span class="o">(</span><span class="n">config</span><span class="o">.</span><span class="na">getBooleanProperty</span><span class="o">(</span><span class="nc">Feature</span><span class="o">.</span><span class="na">ALLOW_EXTERNAL_FUNCTIONS</span><span class="o">))</span> <span class="o">{</span>
<span class="kt">boolean</span> <span class="n">existsWithDifferentArity</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
<span class="k">for</span><span class="o">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="n">i</span> <span class="o"><</span> <span class="n">arguments</span><span class="o">.</span><span class="na">length</span> <span class="o">+</span> <span class="mi">5</span><span class="o">;</span> <span class="o">++</span><span class="n">i</span><span class="o">)</span> <span class="o">{</span>
<span class="k">if</span> <span class="o">(</span><span class="n">i</span> <span class="o">!=</span> <span class="n">arguments</span><span class="o">.</span><span class="na">length</span><span class="o">)</span> <span class="o">{</span>
<span class="nc">SymbolicName</span><span class="o">.</span><span class="na">F</span> <span class="n">sn</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">SymbolicName</span><span class="o">.</span><span class="na">F</span><span class="o">(</span><span class="n">functionName</span><span class="o">,</span> <span class="n">i</span><span class="o">);</span>
<span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="na">env</span><span class="o">.</span><span class="na">getFunctionLibrary</span><span class="o">().</span><span class="na">isAvailable</span><span class="o">(</span><span class="n">sn</span><span class="o">))</span> <span class="o">{</span>
<span class="n">existsWithDifferentArity</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
<span class="k">break</span><span class="o">;</span>
<span class="o">}</span>
<span class="o">}</span>
<span class="o">}</span>
<span class="k">if</span> <span class="o">(</span><span class="n">existsWithDifferentArity</span><span class="o">)</span> <span class="o">{</span>
<span class="n">sb</span><span class="o">.</span><span class="na">append</span><span class="o">(</span><span class="s">". The namespace URI and local name are recognized, but the number of arguments is wrong"</span><span class="o">);</span>
<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
<span class="n">supplementary</span> <span class="o">=</span> <span class="n">getMissingFunctionExplanation</span><span class="o">(</span><span class="n">functionName</span><span class="o">,</span> <span class="n">config</span><span class="o">);</span>
<span class="k">if</span> <span class="o">(</span><span class="n">supplementary</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
<span class="n">sb</span><span class="o">.</span><span class="na">append</span><span class="o">(</span><span class="s">". "</span><span class="o">).</span><span class="na">append</span><span class="o">(</span><span class="n">supplementary</span><span class="o">);</span>
<span class="o">}</span>
<span class="o">}</span>
<span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
<span class="n">sb</span><span class="o">.</span><span class="na">append</span><span class="o">(</span><span class="s">". External function calls have been disabled"</span><span class="o">);</span>
<span class="o">}</span>
</code></pre>
<ul>
<li>I do not understand whats going on and my application freezes since it is always stuck in the for-loop.</li>
<li>I am expecting either the function to be found and exit the for-loop and continue the normal behavior of my application or some timeout to be set or an error message to be thrown if the XPath functions are not found in that loop.</li>
<li>Please let me know your suggestion on how to proceed.</li>
<li>I'm using Saxon 10.6 and Xpath 3.0</li>
</ul>
<p><strong>Note:</strong> Here I'm using custom library(External Jar file) which inside the class path contains some Xpath functions, not modified anything on Saxon FunctionLibrary interface.</p>
<p><strong>Stack overflow ticket :</strong> <a href="https://stackoverflow.com/questions/78001210/xpath-parser-continously-looping-to-find-xpath-function-library-in-a-given-custo?noredirect=1#comment137514388_78001210" class="external">https://stackoverflow.com/questions/78001210/xpath-parser-continously-looping-to-find-xpath-function-library-in-a-given-custo?noredirect=1#comment137514388_78001210</a></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> SaxonC - Bug #6333 (In Progress): Representing empty sequencehttps://saxonica.plan.io/issues/63332024-01-29T17:52:37ZO'Neil Delprattoneil@saxonica.com
<p>SaxonC currently does not properly represent empty sequences via the API. What we need is an <code>XdmEmptySequence</code> class similar to its Java counterpart. Moreover, In SaxonJ (Java) an empty <code>XdmValue</code> is also an empty sequence which can be passed as a parameter to an expression of stylesheet, but this fails in SaxonC.</p>
<p>For example:</p>
<pre><code class="python syntaxhl" data-language="python"> <span class="n">xp</span> <span class="o">=</span> <span class="n">saxonproc</span><span class="p">.</span><span class="n">new_xpath_processor</span><span class="p">()</span>
<span class="n">xp</span><span class="p">.</span><span class="n">declare_namespace</span><span class="p">(</span><span class="s">"fn"</span><span class="p">,</span> <span class="s">"http://www.w3.org/2005/xpath-functions"</span><span class="p">)</span>
<span class="n">xp</span><span class="p">.</span><span class="n">declare_variable</span><span class="p">(</span><span class="s">'p'</span><span class="p">)</span>
<span class="n">xdm_value</span> <span class="o">=</span> <span class="n">PyXdmValue</span><span class="p">()</span>
<span class="n">xp</span><span class="p">.</span><span class="n">set_parameter</span><span class="p">(</span><span class="s">'p'</span><span class="p">,</span> <span class="n">xdm_value</span><span class="p">)</span>
<span class="k">assert</span> <span class="n">xp</span><span class="p">.</span><span class="n">effective_boolean_value</span><span class="p">(</span><span class="s">"fn:empty($p)"</span><span class="p">)</span>
</code></pre>
<p>Crashes out with the following exception:</p>
<pre><code>java.lang.IllegalArgumentException: Invalid handle
at com.oracle.svm.core.handles.ObjectHandlesImpl.doGet(ObjectHandlesImpl.java:232)
at com.oracle.svm.core.handles.ObjectHandlesImpl.get(ObjectHandlesImpl.java:220)
at net.sf.saxon.option.cpp.ProcessorDataAccumulator.addProcessorDataPair(ProcessorDataAccumulator.java:93)
</code></pre>
<p>This is probably because the empty <code>PyXdmValue()</code> object is not internally getting converted to an empty sequence.</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 #6183 (In Progress): "fallback=no" on UCA collation not working in EE editionhttps://saxonica.plan.io/issues/61832023-08-23T01:29:51ZTrevor Lawrence
<p>We are using a licensed (as of 05/04/23) edition of SaxonJ-EE 11.5.</p>
<p>We're using the <code><xsl:sort></code> instruction within an <code><xsl:for-each-group></code> with a custom-defined UCA collation URI. While debugging an issue with it we decided to add the <code>fallback=no</code> parameter to see if we were misusing one of the options, and instead got a message saying it's not supported in Saxon-HE.</p>
<p>Attached to this issue is a minimal stylesheet that reproduces the issue. Invoking it with this command:</p>
<pre><code class="shell syntaxhl" data-language="shell">java <span class="nt">-cp</span> <path_to_xml_resolver_4.6.4>:<path_to_saxon_EE_11.5> <span class="se">\</span>
net.sf.saxon.Transform <span class="se">\</span>
<span class="nt">-xsl</span>:transform-with-EE-feature.xsl <span class="se">\</span>
<span class="nt">-o</span>:file.xml <span class="se">\</span>
<span class="nt">-it</span> <span class="se">\</span>
<span class="nt">-config</span>:<path_to_our_config_and_license>
</code></pre>
<p>gives:</p>
<pre><code>Error at xsl:sort on line 9 column 141 of transform-with-EE-feature.xsl:
XTDE1035 Failed to load collation
http://www.w3.org/2013/collation/UCA?lang=en;maxVariable=symbol;strength=4;alternate=shifted;fallback=no: Error in UCA Collation URI http://www.w3.org/2013/collation/UCA?lang=en;maxVariable=symbol;strength=4;alternate=shifted;fallback=no: fallback=no is not supported in Saxon-HE
Errors were reported during stylesheet compilation
</code></pre>
<p>We currently pull down Saxon-EE from your new Maven repo and XML Resolver from Maven central.</p> SaxonC - Bug #6182 (In Progress): UTF-8 in string based C API functionshttps://saxonica.plan.io/issues/61822023-08-22T16:25:00ZOmar Siam
<p>I tried to get the following code running and the encoding of the return value seems off.</p>
<pre><code class="cpp syntaxhl" data-language="cpp"><span class="kt">void</span> <span class="nf">testUTF8StringTemplate</span><span class="p">(</span><span class="n">SaxonProcessor</span> <span class="o">*</span><span class="n">proc</span><span class="p">,</span> <span class="n">Xslt30Processor</span> <span class="o">*</span><span class="n">trans</span><span class="p">,</span>
<span class="n">sResultCount</span> <span class="o">*</span><span class="n">sresult</span><span class="p">)</span> <span class="p">{</span>
<span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">source</span> <span class="o">=</span>
<span class="s">"<?xml version='1.0' encoding='UTF8'?> <xsl:stylesheet "</span>
<span class="s">"xmlns:xsl='http://www.w3.org/1999/XSL/Transform' "</span>
<span class="s">"xmlns:xs='http://www.w3.org/2001/XMLSchema' version='3.0'> "</span>
<span class="s">"<xsl:template match='*'> <xsl:sequence select='&apos;تيست&apos;'/> </xsl:template> </xsl:stylesheet>"</span><span class="p">;</span>
<span class="n">cout</span> <span class="o"><<</span> <span class="n">endl</span> <span class="o"><<</span> <span class="s">"Test:testUTF8StringTemplate"</span> <span class="o"><<</span> <span class="n">endl</span><span class="p">;</span>
<span class="n">XsltExecutable</span> <span class="o">*</span><span class="n">executable</span> <span class="o">=</span> <span class="n">trans</span><span class="o">-></span><span class="n">compileFromString</span><span class="p">(</span><span class="n">source</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="n">executable</span> <span class="o">==</span> <span class="nb">nullptr</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="n">trans</span><span class="o">-></span><span class="n">exceptionOccurred</span><span class="p">())</span> <span class="p">{</span>
<span class="n">cout</span> <span class="o"><<</span> <span class="s">"Error: "</span> <span class="o"><<</span> <span class="n">trans</span><span class="o">-></span><span class="n">getErrorMessage</span><span class="p">()</span> <span class="o"><<</span> <span class="n">endl</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">return</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">_in</span> <span class="o">=</span> <span class="s">"<?xml version='1.0' encoding='UTF8'?><e>تيست</e>"</span><span class="p">;</span>
<span class="n">XdmNode</span> <span class="o">*</span><span class="n">node</span> <span class="o">=</span> <span class="n">proc</span><span class="o">-></span><span class="n">parseXmlFromString</span><span class="p">(</span><span class="n">_in</span><span class="p">);</span>
<span class="n">executable</span><span class="o">-></span><span class="n">setResultAsRawValue</span><span class="p">(</span><span class="nb">false</span><span class="p">);</span>
<span class="n">std</span><span class="o">::</span><span class="n">map</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">,</span> <span class="n">XdmValue</span> <span class="o">*></span> <span class="n">parameterValues</span><span class="p">;</span>
<span class="n">executable</span><span class="o">-></span><span class="n">setInitialTemplateParameters</span><span class="p">(</span><span class="n">parameterValues</span><span class="p">,</span> <span class="nb">false</span><span class="p">);</span>
<span class="n">executable</span><span class="o">-></span><span class="n">setInitialMatchSelection</span><span class="p">(</span><span class="n">node</span><span class="p">);</span>
<span class="n">XdmValue</span> <span class="o">*</span><span class="n">result</span> <span class="o">=</span> <span class="n">executable</span><span class="o">-></span><span class="n">applyTemplatesReturningValue</span><span class="p">();</span>
<span class="k">if</span> <span class="p">(</span><span class="n">result</span> <span class="o">!=</span> <span class="nb">nullptr</span><span class="p">)</span> <span class="p">{</span>
<span class="n">sresult</span><span class="o">-></span><span class="n">success</span><span class="o">++</span><span class="p">;</span>
<span class="n">cout</span> <span class="o"><<</span> <span class="s">"Input="</span> <span class="o"><<</span> <span class="n">_in</span><span class="p">;</span>
<span class="n">cout</span> <span class="o"><<</span> <span class="s">"Result="</span> <span class="o"><<</span> <span class="n">result</span><span class="o">-></span><span class="n">getHead</span><span class="p">()</span><span class="o">-></span><span class="n">getStringValue</span><span class="p">()</span> <span class="o"><<</span> <span class="n">endl</span> <span class="o"><<</span> <span class="n">node</span><span class="o">-></span><span class="n">toString</span><span class="p">()</span> <span class="o"><<</span> <span class="n">endl</span><span class="p">;</span>
<span class="k">delete</span> <span class="n">result</span><span class="p">;</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="n">sresult</span><span class="o">-></span><span class="n">failure</span><span class="o">++</span><span class="p">;</span>
<span class="n">sresult</span><span class="o">-></span><span class="n">failureList</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="s">"testUTF8StringTemplate"</span><span class="p">);</span>
<span class="p">}</span>
<span class="k">delete</span> <span class="n">executable</span><span class="p">;</span>
<span class="k">delete</span> <span class="n">node</span><span class="p">;</span>
<span class="n">parameterValues</span><span class="p">.</span><span class="n">clear</span><span class="p">();</span>
<span class="p">}</span>
</code></pre>
<pre><code class="shell syntaxhl" data-language="shell">Compiled with VS 2017:
cl /utf-8 /EHsc <span class="s2">"-I%graalvmdir%"</span> testXSLT30.cpp ../../Saxon.C.API/SaxonCGlue.c ../../Saxon.C.API/SaxonCXPath.c ../../Saxon.C.API/SaxonProcessor.cpp ../../Saxon.C.API/XdmValue.cpp ../../Saxon.C.API/XdmItem.cpp ../../Saxon.C.API/XdmAtomicValue.cpp ../../Saxon.C.API/DocumentBuilder.cpp ../../Saxon.C.API/XdmNode.cpp ../../Saxon.C.API/XdmFunctionItem.cpp ../../Saxon.C.API/XdmArray.cpp ../../Saxon.C.API/XdmMap.cpp ../../Saxon.C.API/SaxonApiException.cpp ../../Saxon.C.API/XQueryProcessor.cpp ../../Saxon.C.API/Xslt30Processor.cpp ../../Saxon.C.API/XsltExecutable.cpp ../../Saxon.C.API/XPathProcessor.cpp ../../Saxon.C.API/SchemaValidator.cpp /link ..<span class="se">\.</span>.<span class="se">\l</span>ibs<span class="se">\w</span><span class="k">in</span><span class="se">\l</span>ibsaxon-hec-12.3.lib
</code></pre>
<p>Result in an UTF-8 enabled powershell window:</p>
<pre><code>Test:testUTF8StringTemplate
Input=<?xml version='1.0' encoding='UTF8'?><e>تيست</e>Result=تيست
<e>تيست</e>
</code></pre>
<p>Any ideas how to fix this? It seems the UTF-8 string is encoded twice.</p> SaxonC - Bug #6073 (In Progress): Documentation on the C API is missinghttps://saxonica.plan.io/issues/60732023-06-12T11:01:41ZO'Neil Delprattoneil@saxonica.com
<p>Reported by a user that the documentation on the C API is missing. We only have some example code available</p> SaxonJS - Bug #6069 (AwaitingInfo): "Unexpected XSLT error" "Cannot add item to tree: (object)"https://saxonica.plan.io/issues/60692023-06-09T05:31:07ZConal Tuohy
<p>I've encountered a strange error running a compiled stylesheet under SaxonJS 2.5 in NodeJS v18.16.0. The stylesheet is compiled on the same platform with the <code>xslt3</code> utility.</p>
<p>This all used to work at some point in the past and I'm not sure what has changed, but I have managed to cut the stylesheet down to a fairly minimal example that reproduces the problem.</p>
<p>My JS code invokes the stylesheet using <code>SaxonJS.transform</code>, and passes parameters to it using <code>stylesheetParams</code>. One of the parameters (<code>$source-uri</code>) is an absolute <code>file:</code> which the stylesheet passes to the <code>doc</code> function, and then applies templates to the result.</p>
<p>The stylesheet implements a pipeline of several transformations by applying templates to a document, capturing the result as a variable, then applying templates to the variable, capturing the result as another variable, applying templates to that, etc. Without that pipeline the stylesheet works OK (i.e. if in the stylesheet below I replace <code><xsl:copy-of select="$phase-1"/></code> with <code><xsl:copy-of select="$source"/></code>, then I get the result I expect; a copy of the source document).</p>
<pre><code class="xml syntaxhl" data-language="xml"><span class="nt"><xsl:transform</span> <span class="na">version=</span><span class="s">"3.0"</span> <span class="na">xmlns:xsl=</span><span class="s">"http://www.w3.org/1999/XSL/Transform"</span><span class="nt">></span>
<span class="c"><!--
Test of weird SaxonJS regression
--></span>
<span class="nt"><xsl:param</span> <span class="na">name=</span><span class="s">"source-uri"</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="c"><!-- read the document --></span>
<span class="nt"><xsl:variable</span> <span class="na">name=</span><span class="s">"source"</span> <span class="na">select=</span><span class="s">"doc($source-uri)"</span><span class="nt">/></span>
<span class="c"><!-- transform the document with an identity mode --></span>
<span class="nt"><xsl:variable</span> <span class="na">name=</span><span class="s">"phase-1"</span><span class="nt">></span>
<span class="nt"><xsl:apply-templates</span> <span class="na">mode=</span><span class="s">"identity"</span> <span class="na">select=</span><span class="s">"$source"</span><span class="nt">/></span>
<span class="nt"></xsl:variable></span>
<span class="c"><!-- write the document --></span>
<span class="nt"><xsl:result-document</span> <span class="na">href=</span><span class="s">"/tmp/regression-test-output.xml"</span> <span class="na">method=</span><span class="s">"xml"</span> <span class="na">indent=</span><span class="s">"no"</span><span class="nt">></span>
<span class="nt"><xsl:copy-of</span> <span class="na">select=</span><span class="s">"$phase-1"</span><span class="nt">/></span>
<span class="nt"></xsl:result-document></span>
<span class="nt"></xsl:template></span>
<span class="nt"><xsl:mode</span> <span class="na">name=</span><span class="s">"identity"</span> <span class="na">on-no-match=</span><span class="s">"shallow-copy"</span><span class="nt">/></span>
<span class="nt"></xsl:transform></span>
</code></pre>
<p>Here's the JS API call I use to invoke the stylesheet (my minimal example uses only the <code>source-uri</code> parameter, but the real stylesheet needs those other two):</p>
<pre><code class="javascript syntaxhl" data-language="javascript"><span class="kd">const</span> <span class="nx">transformationResults</span> <span class="o">=</span> <span class="k">await</span> <span class="nx">SaxonJS</span><span class="p">.</span><span class="nx">transform</span><span class="p">(</span>
<span class="p">{</span>
<span class="na">stylesheetFileName</span><span class="p">:</span> <span class="dl">"</span><span class="s2">/srv/tasks/src/xslt/document-function-regression-test.xsl.sef.json</span><span class="dl">"</span><span class="p">,</span>
<span class="c1">//stylesheetFileName: "/srv/tasks/src/xslt/process-tei-to-page-files.xsl.sef.json",</span>
<span class="na">stylesheetParams</span><span class="p">:</span> <span class="p">{</span>
<span class="na">identifier</span><span class="p">:</span> <span class="nx">identifier</span><span class="p">,</span>
<span class="dl">"</span><span class="s2">source-uri</span><span class="dl">"</span><span class="p">:</span> <span class="nx">sourceURI</span><span class="p">,</span>
<span class="dl">"</span><span class="s2">page-identifier-regex</span><span class="dl">"</span><span class="p">:</span> <span class="nx">configuration</span><span class="p">.</span><span class="nx">ui</span><span class="p">.</span><span class="nx">filename</span><span class="p">.</span><span class="nx">checkNameStructure</span><span class="p">,</span>
<span class="p">},</span>
<span class="na">baseOutputURI</span><span class="p">:</span> <span class="nx">output</span> <span class="p">?</span> <span class="nx">output</span> <span class="p">:</span> <span class="nx">sourceURI</span><span class="p">,</span> <span class="c1">// output into the same folder as the source data file</span>
<span class="p">},</span>
<span class="dl">"</span><span class="s2">async</span><span class="dl">"</span>
<span class="p">);</span>
</code></pre>
<p>Logging the error thrown by SaxonJS.transform produces:</p>
<pre><code> console.error
L {
message: 'An unexpected error occurred in XSLT code. Please report the following information: \n' +
'Error SXJS0004 in document-function-regression-test.xsl line 11:\n' +
'Internal error: Cannot add item to tree (object) <TEI xmlns="http://www.tei-c.org/ns/1.0">\n' +
' <teiHeader>\n' +
' <fileDesc>\n' +
' <titleStmt>\n' +
' <title/>\n' +
' <author/>\n' +
' </titleStmt>\n' +
' <editionStmt>\n' +
' <edition>\n' +
' <date>2022-04-04</date>\n' +
' </edition>\n' +
' </editionStmt>\n' +
' <publicationStmt>\n' +
' <p>unknown</p>\n' +
' </publicationStmt>\n' +
' <sourceDesc>\n' +
' <p>Converted from a Word document</p>\n' +
' </sourceDesc>\n' +
' </fileDesc>\n' +
' <encodingDesc>\n' +
' <appInfo>\n' +
' <application xml:id="docxtotei" ident="TEI_fromDOCX" version="2.15.0">\n' +
' <label>DOCX to TEI</label>\n' +
' </application>\n' +
' </appInfo>\n' +
' </encodingDesc>\n' +
' <revisionDesc>\n' +
' <listChange>\n' +
' <change>\n' +
' <date>2022-04-13T04:31:35Z</date>\n' +
' <name/>\n' +
' </change>\n' +
' </listChange>\n' +
' </revisionDesc>\n' +
' </teiHeader>\n' +
' <text>\n' +
' <body>\n' +
' <p rend="Normal" style="text-align: left; ">\n' +
' <hi rend="Page">msword_example-001</hi> Text of page 1</p>\n' +
' <p rend="Normal" style="text-align: left; ">\n' +
' <pb/>\n' +
' </p>\n' +
' <p rend="Normal" style="text-align: left; ">\n' +
' <hi rend="Page">msword_example-002</hi> Text of page 2 starts here</p>\n' +
' <p rend="Normal" style="text-align: left; ">More page 2 text.<pb/>\n' +
' </p>\n' +
' <p rend="Normal" style="text-align: left; ">\n' +
' <hi rend="Page">msword_example-003</hi> Finally this we have this, the transcription of page 3; the third page of the document, i.e. the page which follows immediately after the second page, also known as “page 2”.</p>\n' +
' <p rend="Normal" style="text-align: left; ">This is more of the third page.<pb/>\n' +
' </p>\n' +
' <p rend="Normal" style="text-align: left; ">\n' +
' <hi rend="Page">msword_example_2-001</hi> This is the first page of transcript of a different item; an item called msword_example_2; this page should not be extracted from the file.</p>\n' +
' </body>\n' +
' </text>\n' +
'</TEI>',
stack: 'Error: \n' +
' at new L (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4109:549)\n' +
' at Object.a [as ga] (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4110:349)\n' +
' at a.append (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4372:52)\n' +
' at Object.q [as gh] (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4362:243)\n' +
' at SC (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4971:310)\n' +
' at e.hf (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4976:85)\n' +
' at /srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4973:289\n' +
' at wc.Object.<anonymous>.ca.forEachItem (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4206:583)\n' +
' at e.Bb (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4973:256)\n' +
' at /srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4376:8\n' +
' at /srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4358:33\n' +
' at Array.forEach (<anonymous>)\n' +
' at /srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4358:6\n' +
' at /srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4379:17\n' +
' at Object.push (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4390:143)\n' +
' at /srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4600:290\n' +
' at /srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4386:258\n' +
' at /srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4386:309\n' +
' at Object.push (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4390:143)\n' +
' at e (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4988:69)\n' +
' at /srv/tasks/node_modules/saxon-js/SaxonJS2N.js:5015:342',
name: 'UnexpectedXSLTError',
code: 'SXJS0004',
xsltLineNr: '11',
xsltModule: 'document-function-regression-test.xsl'
}
</code></pre>
<p>The TEI XML content in that error message is indeed the content of the file identified by the <code>$source-uri</code> parameter.</p>
<p>The stylesheet succeeds when launched from the command line:</p>
<pre><code>node /srv/tasks/node_modules/xslt3 -it -t -xsl:/srv/tasks/src/xslt/document-function-regression-test.xsl source-uri=file:///srv/tasks/src/test-data/Succeeds-word_doc_upload/fake-msword-example/msword_example-tei.xml
SaxonJS 2.5 from Saxonica
Node.js version v18.16.0
Compiling stylesheet /srv/tasks/src/xslt/document-function-regression-test.xsl
Stylesheet compilation time: 0.284s
Initial template: Q{http://www.w3.org/1999/XSL/Transform}initial-template
Asynchronous transform with options: stylesheetText={"N":"package","version":"30",(string), stylesheetBaseURI=file:///srv/tasks/src/xslt/doc(string), stylesheetParams=[object Object](string), outputProperties=[object Object](string), extraOptions=[object Object](string), destination=stdout(string), baseOutputURI=file:///srv/tasks/(string), logLevel=2(string), initialTemplate=Q{http://www.w3.org/1999/XSL/T(string),
SEF generated by SaxonJS 2.5 at 2023-06-09T05:22:48.208Z
Promising to write to file:///tmp/regression-test-output.xml
<?xml version="1.0" encoding="UTF-8"?>
Execution time: 0.147s
Memory used: 29.21Mb
Transformation complete
</code></pre>
<p>The output file <code>ile:///tmp/regression-test-output.xml</code> is there and is a copy of the input file <code>file:///srv/tasks/src/test-data/Succeeds-word_doc_upload/fake-msword-example/msword_example-tei.xml</code></p>
<p>Naturally I can also run the stylesheet successfully under SaxonJ.</p> Saxon - Bug #6042 (AwaitingInfo): Xerces occasionally throws ArrayIndexOutOfBoundsExceptionhttps://saxonica.plan.io/issues/60422023-05-21T17:29:54ZNorm Tovey-Walsh
<p>Can't reproduce this locally and debugging through the narrow opening provided by CI is awfully painful, but FYI:</p>
<p>This is <code>xspec.bat</code> (slightly hacked) from the DocBook xslTNG project running on Windows CI in GitHub. I've instrumented the batch file with:</p>
<pre><code> echo "XSLT:"
echo %*
</code></pre>
<p>The full command is:</p>
<pre><code> java ^
-Dfile.encoding=UTF-8 ^
-Dxspec.coverage.ignore="%TEST_DIR%" ^
-Dxspec.coverage.xml="%COVERAGE_XML%" ^
-Dxspec.home="%XSPEC_HOME%" ^
-Dxspec.xspecfile="%XSPEC%" ^
-Dorg.docbook.xsltng.extensions.pygmentize="%PYGMENTIZE%" ^
-Dorg.docbook.xsltng.verbose="%VERBOSE%" ^
-cp "%CP%" net.sf.saxon.Transform %CATALOG% ^
-init:org.docbook.xsltng.extensions.Register %*
</code></pre>
<p>With Saxon 11.5:</p>
<pre><code>Formatting Report...
"XSLT:"
-o:"D:\a\xslTNG\xslTNG\build\default-result.html" -s:"D:\a\xslTNG\xslTNG\build\default-result.xml" -xsl:"D:\a\xslTNG\xslTNG\build\xspec-2.2.4\bin\..\src\reporter\format-xspec-report.xsl" inline-css=true
java.lang.IllegalStateException: java.lang.ArrayIndexOutOfBoundsException: 2048
at net.sf.saxon.resource.ActiveSAXSource.deliver(ActiveSAXSource.java:233)
at net.sf.saxon.resource.ActiveStreamSource.deliver(ActiveStreamSource.java:65)
at net.sf.saxon.event.Sender.send(Sender.java:105)
at net.sf.saxon.Configuration.buildDocumentTree(Configuration.java:4138)
at net.sf.saxon.s9api.DocumentBuilder.build(DocumentBuilder.java:334)
at net.sf.saxon.Transform.processFile(Transform.java:1346)
at net.sf.saxon.Transform.doTransform(Transform.java:871)
at net.sf.saxon.Transform.main(Transform.java:81)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 2048
at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.scanContent(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanContent(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at net.sf.saxon.resource.ActiveSAXSource.deliver(ActiveSAXSource.java:190)
... 7 more
Fatal error during transformation: java.lang.IllegalStateException: java.lang.ArrayIndexOutOfBoundsException: 2048
*** Error formatting the report
</code></pre>
<p>with Saxon 12.2:</p>
<pre><code>Formatting Report...
"XSLT:"
-o:"D:\a\xslTNG\xslTNG\build\default-result.html" -s:"D:\a\xslTNG\xslTNG\build\default-result.xml" -xsl:"D:\a\xslTNG\xslTNG\build\xspec-2.2.4\bin\..\src\reporter\format-xspec-report.xsl" inline-css=true
java.lang.ArrayIndexOutOfBoundsException: 2048
at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.scanContent(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanContent(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at net.sf.saxon.resource.ActiveSAXSource.deliver(ActiveSAXSource.java:190)
at net.sf.saxon.resource.ActiveStreamSource.deliver(ActiveStreamSource.java:65)
at net.sf.saxon.event.Sender.send(Sender.java:104)
at net.sf.saxon.Configuration.buildDocumentTree(Configuration.java:4210)
at net.sf.saxon.s9api.DocumentBuilder.build(DocumentBuilder.java:334)
at net.sf.saxon.Transform.processFile(Transform.java:1345)
at net.sf.saxon.Transform.doTransform(Transform.java:879)
at net.sf.saxon.Transform.main(Transform.java:83)
Fatal error during transformation: java.lang.ArrayIndexOutOfBoundsException: 2048
*** Error formatting the report
</code></pre>
<p>It's particularly annoying that this looks like an encoding issue but I have explicitly specified the <code>file.encoding</code> and the same code on my local Windows machine does not fail.</p> SaxonC - Bug #6009 (In Progress): cppTests/testXSLT30 exampleTransformToString fails, probably du...https://saxonica.plan.io/issues/60092023-05-03T05:56:59ZMartin Honnenmartin.honnen@gmx.de
<p>Using SaxonC EE 12.2 under Linux, I find that one test of cppTests/testXSLT30 fails, namely then one named <code>exampleTransformToString</code> outputs e.g.</p>
<pre><code><b>exampleTransformToString:</b><br/>
baseURI = file:///home/mh/libsaxon-EEC-linux-v12.2/samples/cppTests
producing sheet
exampleTransformToString =
The file output.xml does not exist
</code></pre>
<p>where the baseURI is constructed and output with e.g.</p>
<pre><code class="cpp syntaxhl" data-language="cpp"> <span class="n">string</span> <span class="n">baseURI</span> <span class="o">=</span> <span class="n">string</span><span class="p">(</span><span class="s">"file://"</span><span class="p">)</span><span class="o">+</span><span class="n">sproc</span><span class="o">-></span><span class="n">getcwd</span><span class="p">();</span>
<span class="n">cerr</span><span class="o"><<</span><span class="s">"baseURI = "</span><span class="o"><<</span><span class="n">baseURI</span><span class="o"><<</span><span class="n">endl</span><span class="p">;</span>
<span class="n">executable</span><span class="o">-></span><span class="n">setBaseOutputURI</span><span class="p">(</span><span class="n">baseURI</span><span class="p">.</span><span class="n">c_str</span><span class="p">());</span>
</code></pre>
<p>a stylesheet then creates an output file <code>output.xml</code> relative to the baseURI e.g. it creates <code>file:///home/mh/libsaxon-EEC-linux-v12.2/samples/output.xml</code> but the code checks with</p>
<pre><code class="cpp syntaxhl" data-language="cpp"> <span class="n">cout</span><span class="o"><<</span> <span class="s">"exampleTransformToString = "</span><span class="o"><<</span><span class="n">result</span><span class="o"><<</span><span class="n">endl</span><span class="p">;</span>
<span class="n">string</span> <span class="n">filename</span> <span class="o">=</span> <span class="n">baseURI</span><span class="o">+</span><span class="s">"/output.xml"</span><span class="p">;</span>
<span class="k">if</span> <span class="p">(</span><span class="n">CppTestUtils</span><span class="o">::</span><span class="n">exists</span><span class="p">(</span><span class="n">filename</span><span class="p">.</span><span class="n">c_str</span><span class="p">()))</span> <span class="p">{</span>
<span class="n">cout</span> <span class="o"><<</span> <span class="s">"The file output.xml exists"</span> <span class="o"><<</span> <span class="n">endl</span><span class="p">;</span>
<span class="n">remove</span><span class="p">(</span><span class="s">"output.xml"</span><span class="p">);</span>
<span class="n">sresult</span><span class="o">-></span><span class="n">success</span><span class="o">++</span><span class="p">;</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="n">cout</span> <span class="o"><<</span> <span class="s">"The file output.xml does not exist"</span> <span class="o"><<</span> <span class="n">endl</span><span class="p">;</span>
<span class="n">sresult</span><span class="o">-></span><span class="n">failure</span><span class="o">++</span><span class="p">;</span>
<span class="n">sresult</span><span class="o">-></span><span class="n">failureList</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="s">"exampleTransformToString"</span><span class="p">);</span>
<span class="p">}</span>
</code></pre>
<p>and finds the file <code>file:///home/mh/libsaxon-EEC-linux-v12.2/samples/cppTests/output.xml</code> doesn't exist and counts the test as failed.</p>
<p>Therefore I think the base output URI needs to be set to <code>string baseURI = string("file://")+sproc->getcwd() + "/";</code>, if that test is supposed to pass.</p> SaxonC - Bug #5943 (AwaitingInfo): XSLT through SaxonC PHP gives "Segmentation fault"https://saxonica.plan.io/issues/59432023-03-28T14:12:39ZYouri Lefers
<p>Hi all,</p>
<p>We've upgraded our SaxonC PHP library to Saxon 12(.1), but it gives a segmentation fault (error code 139 with PHPUnit) when it runs 2 or more transformations after each other. This happens in version 12.1, but also happened in version 12. We use PHP 8.1 (FPM).</p>
<p>We use a factory to construct and destruct a <code>SaxonProcessor</code> instance:</p>
<pre><code class="php syntaxhl" data-language="php"><span class="kn">use</span> <span class="nc">Saxon\SaxonProcessor</span><span class="p">;</span>
<span class="kd">class</span> <span class="nc">SaxonProcessorFactory</span>
<span class="p">{</span>
<span class="k">private</span> <span class="kt">?SaxonProcessor</span> <span class="nv">$saxonProcessor</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
<span class="k">public</span> <span class="k">function</span> <span class="n">__destruct</span><span class="p">()</span>
<span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="kc">null</span> <span class="o">!==</span> <span class="nv">$this</span><span class="o">-></span><span class="n">saxonProcessor</span><span class="p">)</span> <span class="p">{</span>
<span class="nv">$this</span><span class="o">-></span><span class="n">saxonProcessor</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="k">public</span> <span class="k">function</span> <span class="n">get</span><span class="p">():</span> <span class="kt">SaxonProcessor</span>
<span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="kc">null</span> <span class="o">===</span> <span class="nv">$this</span><span class="o">-></span><span class="n">saxonProcessor</span><span class="p">)</span> <span class="p">{</span>
<span class="nv">$this</span><span class="o">-></span><span class="n">saxonProcessor</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="nf">create</span><span class="p">();</span>
<span class="p">}</span>
<span class="k">return</span> <span class="nv">$this</span><span class="o">-></span><span class="n">saxonProcessor</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">private</span> <span class="k">function</span> <span class="n">create</span><span class="p">():</span> <span class="kt">SaxonProcessor</span>
<span class="p">{</span>
<span class="nv">$saxonProcessor</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">SaxonProcessor</span><span class="p">();</span>
<span class="nv">$saxonProcessor</span><span class="o">-></span><span class="nf">setConfigurationProperty</span><span class="p">(</span><span class="s1">'http://saxon.sf.net/feature/recognize-uri-query-parameters'</span><span class="p">,</span> <span class="s1">'true'</span><span class="p">);</span>
<span class="k">return</span> <span class="nv">$saxonProcessor</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">}</span>
</code></pre>
<p>Then we use that processor to do XSLT transformations:</p>
<pre><code class="php syntaxhl" data-language="php"><span class="nv">$saxonProcessor</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="n">saxonProcessorFactory</span><span class="o">-></span><span class="nf">get</span><span class="p">();</span>
<span class="nv">$transformer</span> <span class="o">=</span> <span class="nv">$saxonProcessor</span><span class="o">-></span><span class="nf">newXslt30Processor</span><span class="p">();</span>
<span class="k">foreach</span> <span class="p">(</span><span class="nv">$parameters</span> <span class="k">as</span> <span class="nv">$key</span> <span class="o">=></span> <span class="nv">$value</span><span class="p">)</span> <span class="p">{</span>
<span class="nv">$transformer</span><span class="o">-></span><span class="nf">setParameter</span><span class="p">(</span><span class="nv">$key</span><span class="p">,</span> <span class="nv">$saxonProcessor</span><span class="o">-></span><span class="nf">createAtomicValue</span><span class="p">(</span><span class="nv">$value</span><span class="p">));</span>
<span class="p">}</span>
<span class="nv">$transformer</span><span class="o">-></span><span class="nf">transformFileToFile</span><span class="p">(</span><span class="nv">$tmpFilePath</span><span class="p">,</span> <span class="nv">$xsltFilePath</span><span class="p">,</span> <span class="nv">$outputFile</span><span class="o">-></span><span class="nf">getPath</span><span class="p">());</span>
<span class="k">if</span> <span class="p">(</span><span class="nv">$transformer</span><span class="o">-></span><span class="nf">exceptionOccurred</span><span class="p">())</span> <span class="p">{</span>
<span class="nv">$exception</span> <span class="o">=</span> <span class="nc">SaxonXsltTransformException</span><span class="o">::</span><span class="nf">forXslTransformation</span><span class="p">(</span><span class="nv">$transformer</span><span class="p">,</span> <span class="nv">$tmpFilePath</span><span class="p">,</span> <span class="nv">$xsltFilePath</span><span class="p">);</span>
<span class="nv">$transformer</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
<span class="k">throw</span> <span class="nv">$exception</span><span class="p">;</span>
<span class="p">}</span>
<span class="nv">$transformer</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
</code></pre>
<p>The first time it runs fine (through for example unit tests), but the second time it gives a segmentation fault. I'm unable to debug this into a specific line or something that created the segmentation fault.</p>
<p>Are you guys able to help us out?</p> SaxonC - Bug #5344 (In Progress): java.lang.UnsatisfiedLinkError: Can't load library: /C:/Progra...https://saxonica.plan.io/issues/53442022-02-21T23:01:47ZO'Neil Delprattoneil@saxonica.com
<p>Reported by user in the forum post: <a href="https://saxonica.plan.io/boards/4/topics/8562" class="external">https://saxonica.plan.io/boards/4/topics/8562</a></p>
<p>Writing an extension function on Windows C++ and PHP currently fails with the following error message:</p>
<pre><code> java.lang.UnsatisfiedLinkError: Can't load library: /C:/Program Files/Saxonica/SaxonC EE 11.2/samples/cppTests/cppExtensionFunction.dll
</code></pre>
<p>The failure is in the Java code. We incorrectly create a leading slash: We are failing resolve the file path. Specifically the cwd is not currently been passed and we fail the fallback of using the SAXONC_HOME environment variable.</p> SaxonJS - Bug #4990 (AwaitingInfo): saxon-js 2.2 no longer reads stylesheet URIs from web contexthttps://saxonica.plan.io/issues/49902021-05-14T14:39:04ZJohn Dziurlaj
<p>I am working on upgrading a project from SaxonJS 2.0 to 2.2. However, when upgrading this <code>webpack</code> project, I am getting an error regarding the resolution of the stylesheet, which is passed via URI:</p>
<p><code>[10:32:49 AM] uncaught exception: XError:Failed URI resolution: href=xslt/cvr_v1_json2xml.sef.json base=undefined -- TypeError: k is not a constructor; code:FODC0005</code></p>
<pre><code class="typescript syntaxhl" data-language="typescript"> <span class="nx">saxon</span><span class="p">.</span><span class="nx">transform</span><span class="p">({</span>
<span class="na">sourceText</span><span class="p">:</span> <span class="nx">wrappedJson</span><span class="p">,</span>
<span class="na">stylesheetLocation</span><span class="p">:</span> <span class="s2">`xslt/</span><span class="p">${</span><span class="nx">sefFile</span><span class="p">}</span><span class="s2">`</span><span class="p">,</span>
<span class="na">initialTemplate</span><span class="p">:</span> <span class="dl">"</span><span class="s2">start</span><span class="dl">"</span><span class="p">,</span>
<span class="na">destination</span><span class="p">:</span> <span class="dl">"</span><span class="s2">application</span><span class="dl">"</span>
<span class="p">},</span> <span class="nx">cb</span><span class="p">);</span>
</code></pre>
<p>I have checked by entering the SEF URL manually, and it resolves (Firefox and Chrome).</p>
<p>(see <code>cdftransformer.ts</code>) Full codebase <a href="https://github.com/HiltonRoscoe/CDFConverter/tree/saxonjs-upgrade" class="external">here</a></p>