Saxonica Developer Community: Issueshttps://saxonica.plan.io/https://saxonica.plan.io/favicon.ico2024-03-22T14:42:37ZSaxonica Developer Community
Planio Saxon - Support #6376 (In Progress): Xslt Map Memory Footprinthttps://saxonica.plan.io/issues/63762024-03-22T14:42:37Zfouad MOUTASSIM
<p>Hello,</p>
<p>We are using Saxonica 10.4 with Java and have noticed that it consumes a lot of memory when running.
For example, when processing a payload of 100MB, the map consumes 1.3GB, which causes memory issues in our application.</p>
<p>We kindly request your support in addressing this matter.</p>
<p>Please find attached the following elements:</p>
<p>The XSLT map.
The Java class.
The input payload.
Thank you in advance for your support.</p> SaxonJS - Feature #6375 (New): Support popular DOM implementationshttps://saxonica.plan.io/issues/63752024-03-19T14:58:59ZMichael Kaymike@saxonica.com
<p>The "barrier to entry" for SaxonJS would be reduced if we were able to promote it as an API for executing XPath 3.1 against popular DOM implementations -- xmldom, jsdom, slimdom, ...</p>
<p>I don't think there's any fundamental barrier to supporting external DOM implementations, it just needs testing.</p> Saxon - Support #6369 (New): Serialization problem of XQuery result using Saxon 12.3https://saxonica.plan.io/issues/63692024-03-06T10:36:34ZRadu Coravuradu_coravu@sync.ro
<p>We run this XQuery as a transformation scenario in Oxygen:</p>
<pre><code>declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
declare option output:method 'text';
declare option output:item-separator ', ';
let $xml:=<xml><element>text1</element><element>text2</element></xml> return $xml/element/string()
</code></pre>
<p>and we get as result:</p>
<pre><code>text1, , text2
</code></pre>
<p>Notice the two commas ", " between the two items.</p>
<p>To serialize we create a tree receiver something like:</p>
<pre><code> SerializerFactory sf = this.queryTransformer.getConfiguration().getSerializerFactory();
PipelineConfiguration pipe = this.queryTransformer.getConfiguration().makePipelineConfiguration();
SerializationProperties props = new SerializationProperties(queryTransformer.getOutputProperties());
Receiver receiver = sf.getReceiver(new StreamResult(sw), props, pipe);
tr = new TreeReceiver(receiver)..
</code></pre>
<p>The "net.sf.saxon.event.SequenceReceiver#decompose" is called for each item "text1" and "text2". The stack trace is something like:</p>
<pre><code> at net.sf.saxon.str.UnicodeWriterToWriter.write(UnicodeWriterToWriter.java:36)
at net.sf.saxon.serialize.TEXTEmitter.characters(TEXTEmitter.java:104)
at net.sf.saxon.event.ProxyReceiver.characters(ProxyReceiver.java:158)
at net.sf.saxon.event.SequenceNormalizer.characters(SequenceNormalizer.java:99)
at net.sf.saxon.event.SequenceNormalizerWithItemSeparator.sep(SequenceNormalizerWithItemSeparator.java:135)
at net.sf.saxon.event.SequenceNormalizerWithItemSeparator.characters(SequenceNormalizerWithItemSeparator.java:75)
at net.sf.saxon.event.TreeReceiver.characters(TreeReceiver.java:176)
at net.sf.saxon.event.SequenceReceiver.decompose(SequenceReceiver.java:178)
</code></pre>
<p>For "text2" which is ATOMIC the code in "net.sf.saxon.event.SequenceReceiver.decompose(Item, Location, int)" does this:</p>
<pre><code> protected void decompose(Item item, Location locationId, int copyNamespaces) throws XPathException {
if (item != null) {
switch (item.getGenre()) {
case ATOMIC:
case EXTERNAL:
if (previousAtomic) {
characters(StringConstants.SINGLE_SPACE, locationId, ReceiverOption.NONE);
}
characters(item.getUnicodeStringValue(), locationId, ReceiverOption.NONE);
</code></pre>
<p>It calls "characters(StringConstants.SINGLE_SPACE, locationId, ReceiverOption.NONE);" which adds a space and a comma before the space as the method "net.sf.saxon.event.SequenceNormalizerWithItemSeparator.characters(UnicodeString, Location, int)" always calls sep().
And then it calls:</p>
<pre><code>characters(item.getUnicodeStringValue(), locationId, ReceiverOption.NONE);
</code></pre>
<p>which again adds a comma before the value. So we get two commas before the actual value is printed.</p> SaxonJS - Feature #6355 (New): A new instruction that makes a document available by the document(...https://saxonica.plan.io/issues/63552024-02-20T15:42:25ZMartynas Jusevicius
<p><code>ixsl:schedule-action</code> supports <code>@document</code> and <code>@http-request</code>. Both approaches have their advantages.
For <code>@schedule-action</code>:</p>
<blockquote>
<p>The called template can access the documents using the <code>doc()</code>, <code>document()</code>, <code>doc-available()</code>, <code>json-doc()</code>, <code>unparsed-text()</code>, <code>unparsed-text-available()</code>, and <code>unparsed-text-lines()</code> functions as appropriate (the documents will be found in a local cache and will not involve another request to the server).</p>
</blockquote>
<p>For <code>@http-request</code> it's the possibility to fully specify the HTTP request headers. That's what I have been using so har</p>
<p>The problem is that the approaches cannot be combined. In other words, it is not possible to specify HTTP request headers, load documents asynchronously <em>and</em> pass them to templates that use document()
What could be the solution to this?</p>
<p>Adding more options to <code>ixsl:schedule-action</code> seems like it would overload the instruction too much. I'm thinking a better idea could be decoupling the HTTP client functionality from the document caching functionality. That could be achieved using a new instruction that caches a document node under the specified URI, thus making it available for <code>document()</code> calls.</p>
<p>For example:</p>
<pre><code class="xml syntaxhl" data-language="xml"> <span class="nt"><xsl:variable</span> <span class="na">name=</span><span class="s">"href"</span> <span class="na">select=</span><span class="s">"http://example.com/doc.xml"</span> <span class="na">as=</span><span class="s">"xs:string"</span><span class="nt">/></span>
<span class="nt"><ixsl:schedule-action</span> <span class="na">http-request=</span><span class="s">"map{ 'href': $href }"</span><span class="nt">></span>
<span class="nt"><xsl:call-template</span> <span class="na">name=</span><span class="s">"response-callback"</span><span class="nt">></span>
<span class="nt"><xsl:with-param</span> <span class="na">name=</span><span class="s">"href"</span> <span class="na">select=</span><span class="s">"$href"</span><span class="nt">/></span>
<span class="nt"></xsl:call-template></span>
<span class="nt"></ixsk:schedule-action></span>
<span class="nt"><xsl:template</span> <span class="na">name=</span><span class="s">"response-callback"</span><span class="nt">></span>
<span class="nt"><xsl:param</span> <span class="na">name=</span><span class="s">"href"</span> <span class="na">as=</span><span class="s">"xs:string"</span><span class="nt">/></span>
<span class="nt"><ixsl:cache-doc</span> <span class="na">href=</span><span class="s">"$href"</span> <span class="na">select=</span><span class="s">"?body"</span><span class="nt">/></span>
<span class="nt"><xsl:call-template</span> <span class="na">name=</span><span class="s">"legacy"</span><span class="nt">/></span>
<span class="nt"></xsl:template></span>
<span class="nt"><xsl:template</span> <span class="na">name=</span><span class="s">"legacy"</span><span class="nt">></span>
<span class="nt"><xsl:message</span> <span class="na">select=</span><span class="s">"document('http://example.com/doc.xml')"</span><span class="nt">/></span> <span class="c"><!-- retrieved from cache --></span>
<span class="nt"></xsl:template></span>
</code></pre> Saxon - Support #6322 (New): Is the old collation URI in EE supposed to rely on the JDK collation...https://saxonica.plan.io/issues/63222024-01-17T16:12:22ZMartin Honnenmartin.honnen@gmx.de
<p>I notice differences in collation dependent sorts whether I use the UCA URI or the legacy Saxon URI.</p>
<p>The documentation at <a href="https://www.saxonica.com/html/documentation12/localization/sorting-and-collations.html" class="external">https://www.saxonica.com/html/documentation12/localization/sorting-and-collations.html</a> says about collations</p>
<blockquote>
<p>For backwards compatibility reasons the standard collation resolver in Saxon also accepts URIs in the form <a href="http://saxon.sf.net/collation" class="external">http://saxon.sf.net/collation</a> followed by query parameters; the query parameters that are recognized are the same as those defined by W3C UCA collation URIs.</p>
</blockquote>
<p>It appears to me, however, that with EE, the use of the legacy collation URI means ICU is not used, only the default JDK collation support, as I get results similar to using HE.</p>
<p>Can anyone confirm that?</p>
<p>Details below:</p>
<p>An XQuery program using the UCA collation URI, run with Saxon 12.4 EE, gives the same result for all sorts, e.g. the following program outputs true:</p>
<pre><code>declare namespace array = "http://www.w3.org/2005/xpath-functions/array";
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
declare option output:method 'text';
declare option output:item-separator '&#10;';
declare variable $strings as array(xs:string*) external := [
('abc', 'abc def', 'abcdef'),
('abc', 'abcdef', 'abc def'),
('abc def', 'abcdef', 'abc'),
('abc def', 'abc', 'abcdef'),
('abcdef', 'abc', 'abc def'),
('abcdef', 'abc def', 'abc')
];
let $sorted :=
array:for-each(
$strings,
function($seq) {
sort($seq, 'http://www.w3.org/2013/collation/UCA?strength=primary;lang=en')
})
return
every $pos in (1 to array:size($sorted))
satisfies
deep-equal($sorted($pos), $strings?1)
</code></pre>
<p>The same program using the legacy Saxon collation URI, however, gives different sort result, much like Saxon HE, e.g. the program outputs false:</p>
<pre><code>declare namespace array = "http://www.w3.org/2005/xpath-functions/array";
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
declare option output:method 'text';
declare option output:item-separator '&#10;';
declare variable $strings as array(xs:string*) external := [
('abc', 'abc def', 'abcdef'),
('abc', 'abcdef', 'abc def'),
('abc def', 'abcdef', 'abc'),
('abc def', 'abc', 'abcdef'),
('abcdef', 'abc', 'abc def'),
('abcdef', 'abc def', 'abc')
];
let $sorted :=
array:for-each(
$strings,
function($seq) {
sort($seq, 'http://saxon.sf.net/collation?strength=primary;lang=en')
})
return
every $pos in (1 to array:size($sorted))
satisfies
deep-equal($sorted($pos), $strings?1)
</code></pre> Saxon - Support #6254 (In Progress): The undeclaration of the default namespace xmlns="" on a chi...https://saxonica.plan.io/issues/62542023-11-16T16:07:02ZJohn Francis
<p>We have a sample file</p>
<pre><code class="xml syntaxhl" data-language="xml"><span class="cp"><?xml version="1.0" encoding="UTF-8"?></span>
<span class="nt"><article</span> <span class="na">xmlns=</span><span class="s">"http://docbook.org/ns/docbook"</span> <span class="na">version=</span><span class="s">"5.0"</span><span class="nt">></span>
<span class="nt"><info></span>
<span class="nt"><title></span>Additional Phrase Container Example<span class="nt"></title></span>
<span class="nt"></info></span>
<span class="nt"><sect1></span>
<span class="nt"><title></span>Additional Phrase Container Example<span class="nt"></title></span>
<span class="nt"><para></span>
<span class="nt"><extension1</span> <span class="na">xmlns=</span><span class="s">""</span><span class="nt">></span>Some text.<span class="nt"></extension1></span>
<span class="nt"></para></span>
<span class="nt"><para></span>
<span class="nt"><myns:extension2</span> <span class="na">xmlns:myns=</span><span class="s">"myns"</span><span class="nt">></span>Some text.<span class="nt"></myns:extension2></span>
<span class="nt"></para></span>
<span class="nt"><para></span>
<span class="nt"><extension3></span>Some text.<span class="nt"></extension3></span>
<span class="nt"></para></span>
<span class="nt"></sect1></span>
<span class="nt"></article></span>
</code></pre>
<p>Prior to Saxon 10 we got a call to <code>org.xml.sax.ContentHandler.startPrefixMapping(String, String)</code> with both arguments Set to "" corresponding to the <code>xmlns=""</code> default namespace un declaration at <code>/article/sect1[1]/para[1]/extension1[1]/@xmlns</code> . From Saxon 10 onwards we no longer get these events when we are using the Saxon API (as opposed to JAXP) and <code>net.sf.saxon.event.ContentHandlerProxy</code> . We do however get the correct arguments to <code>startElement(String, String, String, Attributes)</code> , "", "extension1", "extension1". However if all that our ContentHandler does is pass the events on to Saxon classes ( <code>net.sf.saxon.event.ReceivingContentHandler</code> ) that serializes the result into an XdmNode that XdmNode is invalid. If we then use it as the source for running a <code>net.sf.saxon.s9api.XsltTransformer</code> we get the following error even though it contains virtually not code;</p>
<pre><code>XTDE0440 Cannot output a namespace node for the default namespace
(http://docbook.org/ns/docbook) when the element is in no namespace
</code></pre>
<p><strong>What is the correct way now to call a <code>org.xml.sax.ContentHandler</code> using an XdmNode as a source and producing an XdmNode as a result if it contains <code>xmlns=""</code>?</strong></p>
<hr>
<p>I have included a zip of a standalone Maven project to reproduce the problem. There are 3 tests, <code>com.deltaxml.test.Tests.test1()</code> just does a JAXP version of the test which of course runs fine. <code>com.deltaxml.test.Tests.test2()</code> uses the Saxon APIs to do the same thing and throws the above error. <code>com.deltaxml.test.Tests.test3()</code> tweaks the test ContentHandler <code>com.deltaxml.test.SaxHandler</code> so that it detects when it has received a startElement event which is in a default namespace bound to the null prefix and simulates a prefix mapping. I would be grateful if you could see any problem with this 'workaround'.</p>
<p>FWIW I ran the tests in a debugger with SaxonHE and saw that <code>net.sf.saxon.tree.tiny.TinyTree</code> has a <code>net.sf.saxon.om.NamespaceBinding</code> from prefix "" to nsURI "" in <code>net.sf.saxon.tree.tiny.TinyTree.namespaceBinding</code> array. Whereas in Saxon 12 <code>net.sf.saxon.tree.tiny.TinyTree</code> does not have an entry for it in the<code>net.sf.saxon.tree.tiny.TinyTree.namespaceMaps</code> array. The code in Saxon 10+ seems to implement <code>xmlns=""</code> as the removal of a namespace, but ContentHandlerProxy doesn't do anything to be backward compatible. All of which would be fine for us except that when things are being passed through we end up getting a an XdmNode which cannot be used!</p>
<p>Thanks for your time</p> SaxonJS - Support #6119 (New): Advice on tracking down log warninghttps://saxonica.plan.io/issues/61192023-07-06T19:21:50ZJohn Cotton
<p>I'm processing '00s of XSL files (with the same XML input) with SaxonJS.</p>
<p>Many throw out this console log:</p>
<p>Cannot compare items of types xs:integer and xs:string: the comparison can succeed only if one of the values is an empty sequence.</p>
<p>It doesn't appear to prevent any output. However, it would be great to know what's causing it.</p>
<p>I've logged the code that's making the warning, but the data at that point is (I think) my "compiled" XSLT, so it's impossible to know where the issue is coming from.</p>
<p>Any advice on finding it?</p>
<p>Regards
John</p> Saxon - Support #6072 (New): SaxonCS used package ICU4N.Resources 60.1.0-alpha.402 generates warn...https://saxonica.plan.io/issues/60722023-06-11T16:06:11ZMartin Honnenmartin.honnen@gmx.de
<p>The SaxonCS (12.2) package uses a package ICU4N.Resources 60.1.0-alpha.402 that for me generates lots of warnings in the form of</p>
<pre><code>1>C:\Program Files\dotnet\sdk\7.0.302\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5): warning NETSDK1187: Das Paket ICU4N.Resources 60.1.0-alpha.402 verfügt über eine Ressource mit dem gebietsschema-'bm-ML'. Dieses Gebietsschema wurde auf das Standardformat 'bm-Latn-ML' normalisiert, um Groß-/Kleinschreibungsprobleme im Build zu vermeiden. Erwägen Sie, den Paketautor über dieses Groß-/Kleinschreibungsproblem zu benachrichtigen.
</code></pre>
<p>basically saying that the region schema name of a used resource has been normalized/standardized and the package author of ICUN should be informed about that change in using lower case/upper case.</p>
<p>Perhaps if there is already a fix to ICU4N you can make sure that next maintenance release of SaxonCS includes that.</p> Saxon - Support #5980 (New): Should setting parser property affect XsltCompiler?https://saxonica.plan.io/issues/59802023-04-19T13:28:21ZMartin Honnenmartin.honnen@gmx.de
<p>Using Saxon 12.1 HE, the code</p>
<pre><code class="java syntaxhl" data-language="java"> <span class="nc">Processor</span> <span class="n">processor</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">Processor</span><span class="o">(</span><span class="kc">false</span><span class="o">);</span>
<span class="nc">Configuration</span> <span class="n">configuration</span> <span class="o">=</span> <span class="n">processor</span><span class="o">.</span><span class="na">getUnderlyingConfiguration</span><span class="o">();</span>
<span class="n">configuration</span><span class="o">.</span><span class="na">setParseOptions</span><span class="o">(</span><span class="n">configuration</span><span class="o">.</span><span class="na">getParseOptions</span><span class="o">().</span><span class="na">withParserProperty</span><span class="o">(</span><span class="s">"http://www.oracle.com/xml/jaxp/properties/"</span> <span class="o">+</span> <span class="s">"entityExpansionLimit"</span><span class="o">,</span> <span class="s">"128000"</span><span class="o">));</span>
<span class="nc">XsltCompiler</span> <span class="n">xsltCompiler</span> <span class="o">=</span> <span class="n">processor</span><span class="o">.</span><span class="na">newXsltCompiler</span><span class="o">();</span>
<span class="nc">XsltExecutable</span> <span class="n">xsltExecutable</span> <span class="o">=</span> <span class="n">xsltCompiler</span><span class="o">.</span><span class="na">compile</span><span class="o">(</span><span class="k">new</span> <span class="nc">File</span><span class="o">(</span><span class="s">"C:\\Users\\marti\\Downloads\\entity-expansion-size.xsl"</span><span class="o">));</span>
<span class="nc">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">xsltExecutable</span><span class="o">);</span>
</code></pre>
<p>with the XSLT from <a href="https://saxonica.plan.io/attachments/64064" class="external">https://saxonica.plan.io/attachments/64064</a> gives an exception indicating that the parser property I have set is not taken into account by the parser XsltCompiler uses:</p>
<pre><code>Error on line 1 column 1
SXXP0003 Error reported by XML parser: JAXP00010001: Der Parser hat mehr als 64000
Entityerweiterungen in diesem Dokument gefunden. Dies ist der von JDK vorgeschriebene
Grenzwert.: JAXP00010001: Der Parser hat mehr als 64000 Entityerweiterungen in diesem
Dokument gefunden. Dies ist der von JDK vorgeschriebene Grenzwert.
Exception in thread "main" net.sf.saxon.s9api.SaxonApiException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; JAXP00010001: Der Parser hat mehr als 64000 Entityerweiterungen in diesem Dokument gefunden. Dies ist der von JDK vorgeschriebene Grenzwert.
at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:974)
at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:996)
at org.example.Main2.main(Main2.java:17)
Caused by: net.sf.saxon.trans.XPathException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; JAXP00010001: Der Parser hat mehr als 64000 Entityerweiterungen in diesem Dokument gefunden. Dies ist der von JDK vorgeschriebene Grenzwert.
at net.sf.saxon.resource.ActiveSAXSource.deliver(ActiveSAXSource.java:224)
at net.sf.saxon.resource.ActiveStreamSource.deliver(ActiveStreamSource.java:65)
at net.sf.saxon.event.Sender.send(Sender.java:104)
at net.sf.saxon.style.StylesheetModule.sendStylesheetSource(StylesheetModule.java:157)
at net.sf.saxon.style.StylesheetModule.loadStylesheet(StylesheetModule.java:231)
at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:113)
at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:969)
... 2 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; JAXP00010001: Der Parser hat mehr als 64000 Entityerweiterungen in diesem Dokument gefunden. Dies ist der von JDK vorgeschriebene Grenzwert.
at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:204)
at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:178)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1408)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1332)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEntityReference(XMLDocumentFragmentScannerImpl.java:1844)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2985)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216)
at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635)
at net.sf.saxon.resource.ActiveSAXSource.deliver(ActiveSAXSource.java:190)
... 8 more
</code></pre>
<p>When I change the code to use a DocumentBuilder e.g.</p>
<pre><code class="java syntaxhl" data-language="java"> <span class="nc">Processor</span> <span class="n">processor</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">Processor</span><span class="o">(</span><span class="kc">false</span><span class="o">);</span>
<span class="nc">Configuration</span> <span class="n">configuration</span> <span class="o">=</span> <span class="n">processor</span><span class="o">.</span><span class="na">getUnderlyingConfiguration</span><span class="o">();</span>
<span class="n">configuration</span><span class="o">.</span><span class="na">setParseOptions</span><span class="o">(</span><span class="n">configuration</span><span class="o">.</span><span class="na">getParseOptions</span><span class="o">().</span><span class="na">withParserProperty</span><span class="o">(</span><span class="s">"http://www.oracle.com/xml/jaxp/properties/"</span> <span class="o">+</span> <span class="s">"entityExpansionLimit"</span><span class="o">,</span> <span class="s">"128000"</span><span class="o">));</span>
<span class="nc">DocumentBuilder</span> <span class="n">docBuilder</span> <span class="o">=</span> <span class="n">processor</span><span class="o">.</span><span class="na">newDocumentBuilder</span><span class="o">();</span>
<span class="nc">XdmNode</span> <span class="n">doc</span> <span class="o">=</span> <span class="n">docBuilder</span><span class="o">.</span><span class="na">build</span><span class="o">(</span><span class="k">new</span> <span class="nc">File</span><span class="o">(</span><span class="s">"C:\\Users\\marti\\Downloads\\entity-expansion-size.xsl"</span><span class="o">));</span>
<span class="nc">XsltCompiler</span> <span class="n">xsltCompiler</span> <span class="o">=</span> <span class="n">processor</span><span class="o">.</span><span class="na">newXsltCompiler</span><span class="o">();</span>
<span class="nc">XsltExecutable</span> <span class="n">xsltExecutable</span> <span class="o">=</span> <span class="n">xsltCompiler</span><span class="o">.</span><span class="na">compile</span><span class="o">(</span><span class="n">doc</span><span class="o">.</span><span class="na">asSource</span><span class="o">());</span>
<span class="nc">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="n">xsltExecutable</span><span class="o">);</span>
</code></pre>
<p>the code runs fine and the file is parsed and compiled fine, meaning the parser property is taken into account.</p>
<p>Shouldn't that also happen for the direct use of XsltCompiler.compile(file)?</p> Saxon - Support #5469 (New): Combining Configuration Fileshttps://saxonica.plan.io/issues/54692022-05-03T15:25:55ZScott Louzon
<p>To whom it may concern,</p>
<p>I have moved my XSLT creation methodology, in part, to using XSLT packages.
This has been a great new feature over the include/import flow I was previously using.</p>
<p>My last issue is with the encapsulation of the configuration files for pointing to the packages on the cmd-line "-config:".
<a href="https://www.saxonica.com/documentation9.5/configuration/configuration-file/" class="external">https://www.saxonica.com/documentation9.5/configuration/configuration-file/</a>
Unfortunately, I don't see mention of in the example.</p>
<p>Take the following example:
Car package is at the top.
Car package uses Frame, Engine, Wheels, etc.. packages.
Each of the Frame, Engine, Wheel packages could use many other packages, and so on below that.
However, when using the Car package, I don't want to care about the location or structure of everything downstream when building my configuration file for the Car package.</p>
<p>I am wondering what the current methodology recommendation is for building this hierarchy of configuration XML files when using XSLT packages?</p>
<ul>
<li>Always have a "massive" top-level package specify the location of everything you could possibly need to use?</li>
<li>Have a tool (possibly an XSLT) combine all the XML configuration files before-hand, and then use the generated combined file on the command-line?</li>
<li>Some better built in way of pointing to a lower-level configuration file, which in turn can point to the packages it needs, as well as more configuration files?</li>
<li>Don't use configurations files at all, potentially better way to specify package locations and connections?</li>
</ul>
<p>Based on all the information you could pass into a configuration file besides , like XSLT versions and such, I imagine combining configuration files could get tricky.</p>
<p>In general, I want to avoid making a tool to combine XML configuration files in an encapsulated manner, if there is already a better built-in way to do what I want.</p> SaxonJS - Support #5225 (New): While using xslt 3.0 function "xml-to-json" would like to avoid es...https://saxonica.plan.io/issues/52252022-01-24T10:51:15ZJuhi Gupta
<p>We are trying to convert xml to json, while using function "xml-to-json" it is trying to escape '/' by adding '' before it. We would like to avoid doing that and translate as is.</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">xmlns=</span><span class="s">"http://www.w3.org/2005/xpath-functions"</span>
<span class="na">xmlns:func=</span><span class="s">"http://ingka.ikea.com/"</span>
<span class="na">xmlns:xs=</span><span class="s">"http://www.w3.org/2001/XMLSchema"</span>
<span class="na">version=</span><span class="s">"3.0"</span><span class="nt">></span>
<span class="nt"><xsl:output</span> <span class="na">method=</span><span class="s">"text"</span><span class="nt">/></span>
<span class="nt"><xsl:template</span> <span class="na">match=</span><span class="s">"/"</span><span class="nt">></span>
<span class="nt"><xsl:variable</span> <span class="na">name=</span><span class="s">"transformed-xml"</span><span class="nt">></span>
<span class="nt"><xsl:call-template</span> <span class="na">name=</span><span class="s">"SamplBody"</span> <span class="nt">/></span>
<span class="nt"><xsl:copy-of</span> <span class="na">select=</span><span class="s">"/map"</span><span class="nt">/></span>
<span class="nt"></xsl:variable></span>
<span class="nt"><xsl:value-of</span> <span class="na">select=</span><span class="s">"xml-to-json($transformed-xml, map { 'indent' : true() })"</span><span class="nt">/></span>
<span class="nt"></xsl:template></span>
<span class="nt"><xsl:template</span> <span class="na">name=</span><span class="s">"SamplBody"</span> <span class="nt">></span>
<span class="nt"><map></span>
<span class="nt"><string</span> <span class="na">key=</span><span class="s">"SamplString"</span><span class="nt">></span>n/a<span class="nt"></string></span>
<span class="nt"></map></span>
<span class="nt"></xsl:template></span>
<span class="nt"></xsl:stylesheet></span>
</code></pre>
<p>and the result of this xslt is</p>
<pre><code class="json syntaxhl" data-language="json"><span class="w">
</span><span class="p">{</span><span class="w"> </span><span class="nl">"SamplString"</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="s2">"n</span><span class="se">\/</span><span class="s2">a"</span><span class="w"> </span><span class="p">}</span><span class="w">
</span></code></pre>
<p>We would like the result to look like</p>
<pre><code class="json syntaxhl" data-language="json"><span class="w">
</span><span class="p">{</span><span class="w"> </span><span class="nl">"SamplString"</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="s2">"n/a"</span><span class="w"> </span><span class="p">}</span><span class="w">
</span></code></pre>
<p>Can you suggest a solution for this?</p> SaxonJS - Support #4809 (New): How to use collections in Saxon-JS?https://saxonica.plan.io/issues/48092020-10-26T21:19:33ZJerry Jackson
<p>I have a very simple stylesheet:</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="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:apply-templates</span> <span class="na">select=</span><span class="s">"collection('file:/C:/temp/mydir')"</span><span class="nt">/></span>
<span class="nt"></xsl:template></span>
<span class="nt"></xsl:stylesheet></span>
</code></pre>
<p>When I run this with Saxon-JS on the command-line (xslt3 "-xsl:test.xsl"), I get this error:</p>
<pre><code>Transformation failure: Error FODC0002 at test.xsl#4
Unknown collection (no collectionFinder supplied)
Transformation failed: Error FODC0002 at test.xsl#4
Unknown collection (no collectionFinder supplied)
</code></pre>
<p>I have tried to run it with the API, and reading the documentation I see I can supply a collectionFinder in the transform method, but i'm not sure on how to implement it to get the same result as when running it in Saxon-Java.</p> SaxonC - Support #2136 (In Progress): php_saxon.dll on WAMPhttps://saxonica.plan.io/issues/21362014-08-26T15:02:11ZMark Forstermark@loadsbetter.com
<p>Hi,</p>
<p>This is my first support issue so I'll try to do it properly but I may get things muddle up a bit.</p>
<p>I've developed a lot with XSLT 1.0 and I've started developing with Saxon CE to learn more about XSLT 2.0 and now I want to do more, like schema-aware processing.</p>
<p>I've tried to get Saxon HE to work on WAMP server 2.4. I think I've done everything correctly but I get this error that appears in the Apache error log.</p>
<p>c:/wamp/bin/php/php5.4.12/ext/php_saxon.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0</p>
<p>I've tried to search for an answer but I haven't found anything that helps.</p>
<p>I'm not particularly expert at WAMP. I've installed it so I can develop with PHP on my Windows PC, which has Windows 7 Home Premium Service Pack 1 64-bit operating system.</p>
<p>Many thanks for any help you can give me.</p>
<p>Mark</p> SaxonC - Support #1962 (New): Saxon/C and pkg-confighttps://saxonica.plan.io/issues/19622013-12-16T10:41:57ZO'Neil Delprattoneil@saxonica.com
<p>Reported by Tony Graham:</p>
<blockquote>
<p>From the 'pkg-config' page at [1]:</p>
</blockquote>
<p>pkg-config is a helper tool used when compiling applications</p>
<p>and libraries.</p>
<p>See also "Guide to pkg-config" at [2].</p>
<p>If Saxon/C is to play nicely with other Linux, etc., packages, you may</p>
<p>want to look at producing a 'pkg-config' file to make it easier for people</p>
<p>building the other packages -- particularly but not limited to people</p>
<p>building using Autotools -- to find how to refer to Saxon/C when compiling</p>
<p>and linking.</p>
<p>Here's what I've been faking as 'saxon-c.pc':</p>
<hr>
<pre><code>prefix=/usr/local/src/saxon-c/Saxonica/Saxon-HEC0.1
exec_prefix=${prefix}
libdir=${exec_prefix}
pkgincludedir=${prefix}/Saxon-C-API
Name: Saxon/C
Description: Saxon/C
Version: 0.1
Libs: -L${libdir} -lsaxon
Cflags: -I${pkgincludedir} -I/usr/lib/jvm/java-6-openjdk-amd64/include
</code></pre>
<hr>
<p>and here's what I've put in 'configure.ac' for xmlroff:</p>
<hr>
<pre><code>#
# Checks for Saxon/C
#
SAXON_C_PACKAGES=saxon-c
SAXON_C_REQUIRED_VERSION=0.1
AH_TEMPLATE([ENABLE_SAXON_C],
[Enable support for Saxon/C XSLT 2.0 processor.])
AC_ARG_ENABLE(saxon_c,
AC_HELP_STRING([--enable-saxon-c],
[build Saxon/C XSLT processor capability (default=yes)]),
enable_saxon_c_arg="$enableval",
enable_saxon_c_arg=yes)
if test "x$enable_saxon_c_arg" != "xyes" ; then
enable_saxon_c_arg=no
fi
enable_saxon_c=false
SAXON_C_REQUIRES=""
have_saxon_c=false
if test "x$enable_saxon_c_arg" = "xyes" ; then
#
# Check for Saxon/C support requirement
#
have_saxon_c=false
PKG_CHECK_MODULES(SAXON_C,
$SAXON_C_PACKAGES >= $SAXON_C_REQUIRED_VERSION,
have_saxon_c=true,
if $have_saxon_c; then
enable_saxon_c=true
AC_DEFINE(ENABLE_SAXON_C,1)
else
AC_DEFINE(ENABLE_SAXON_C,0)
SAXON_C_LIBS=""
SAXON_C_CFLAGS=""
fi
fi
AC_SUBST(SAXON_C_ENABLED, [$enable_saxon_c])
AC_SUBST(SAXON_C_REQUIRES)
AC_SUBST(SAXON_C_LIBS)
AC_SUBST(SAXON_C_CFLAGS)
AC_SUBST(ENABLE_SAXON_C, [$enable_saxon_c])
AM_CONDITIONAL(ENABLE_SAXON_C, [$enable_saxon_c])
</code></pre>
<hr>
<p>Tony Graham <a href="mailto:tgraham@mentea.net" class="email">tgraham@mentea.net</a></p>
<p>Consultant <a href="http://www.mentea.net" class="external">http://www.mentea.net</a></p>
<p>Mentea 13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland</p>
<hr>
<pre><code>XML, XSL-FO and XSLT consulting, training and programming
Chair, Print and Page Layout Community Group @ W3C
</code></pre>
<p>[1] <a href="http://www.freedesktop.org/wiki/Software/pkg-config/" class="external">http://www.freedesktop.org/wiki/Software/pkg-config/</a></p>
<p>[2] <a href="http://people.freedesktop.org/~dbn/pkg-config-guide.html" class="external">http://people.freedesktop.org/~dbn/pkg-config-guide.html</a></p> SaxonC - Support #1960 (In Progress): PHP Windows builds required for the different compiler vers...https://saxonica.plan.io/issues/19602013-12-16T09:26:00ZO'Neil Delprattoneil@saxonica.com
<p>Bug reported by Vasil Rangelov,</p>
<p>I've tried all of the combos with this DDL, and sadly, it's only</p>
<p>useful for PHP 5.4.* TS VC9 x86 builds, and nothing else (that is,</p>
<p>other combos don't even register at phpinfo()).</p>
<p>The necessary binaries for addressing all common Windows PHP setups would be:</p>
<p>PHP 5.4 TS VC9</p>
<p>PHP 5.4 NTS VC9</p>
<p>PHP 5.5 TS VC11</p>
<p>PHP 5.5 NTS VC11</p>
<p>(all x86)</p>
<p>I also tested PHP 5.3 (N)TS VC9 x86, and that too doesn't work. While</p>
<p>I see no reason not to also make PHP 5.3 VC9 (N)TS binaries, the PHP</p>
<p>5.3 is now in "security fixes only" mode, soon to be completely</p>
<p>EOL-ed, so IMHO, it's OK to not have it... it would hopefully</p>
<p>encourage more people to upgrade.</p>