Saxon-CE: Saxon-CE helphttps://saxonica.plan.io/https://saxonica.plan.io/favicon.ico2019-08-22T19:22:46ZSaxonica Developer Community
Planio Saxon-CE help: RE: Looking for saxon:evaluate() example codehttps://saxonica.plan.io/boards/1/topics/7371?r=7588#message-75882019-08-22T19:22:46ZAnonymous
<p>Actually, I thoroughly concur with creator feeling about this subject and I imagine that it would be truly fascinating to make such exchange with different site visitors.Personally, I absolutely concur with creator assessment about <a href="https://www.bestdiscountcouponcode.com/hostgator-coupons/" class="external">hostgator coupon code 80 off</a> subject and I believe that it would be truly intriguing to make such discourse with different site guests.</p> Saxon-CE help: RE: Looking for saxon:evaluate() example codehttps://saxonica.plan.io/boards/1/topics/7371?r=7373#message-73732018-12-17T17:53:27ZMichael Kaymike@saxonica.com
<p>I suspect you're asking on the wrong forum - Saxon-CE is no longer supported, but I don't think that's what you're using.</p>
<p>In recent releases of Saxon (9.8, 9.9) we implement the XSLT 3.0 xsl:evaluate instruction, and I would encourage you to use that in place of the old saxon:evaluate() -- it's standard, and it's much more comprehensive. The saxon:evaluate() function is still there and is described at <a href="http://www.saxonica.com/documentation/index.html#!functions/saxon/evaluate" class="external">http://www.saxonica.com/documentation/index.html#!functions/saxon/evaluate</a></p>
<p>One difference between xsl:evaluate and saxon:evaluate is that saxon:evaluate expressions can only use the ten variables $p1, $p2, etc, whereas with xsl:evaluate you can have arbitrary variables with names of your own choosing. So for this example you clearly need xsl:evaluate.</p>
<p>If you're having trouble getting something working then it's best to show us your code, explaining what you want to achieve and how your attempt failed. We can then see where you went wrong and explain the problem. Otherwise, you're essentially asking us to write additional documentation for you, without a clear idea of why the existing documentation is inadequate.</p> Saxon-CE help: Looking for saxon:evaluate() example codehttps://saxonica.plan.io/boards/1/topics/73712018-12-17T16:31:34Znirmalya sinha
<p>I have a transform.xsl file with will process a input.xml. But there is also an additional config.xml file which will define additional clauses. For e.g. this is the content of the config.xml.</p>
<p><code><Location > <DisplayName> <Attribute1>ABC</Attribute1> <Attribute2>XYZ</Attribute2> <action>concat($Attribute1,$Attribute2)</action> </DisplayName> </Location ></code></p>
<p>So when transform.xsl will encounter the DisplayName variable within the input.xml, then it will form the value with the RESULT of the action expression defined in the config.xml file. transform.xml will call the config.xml just to get the result. (The action can be modified by the end user and hence these are placed outside the xsl file, within the config.xml).</p>
<p>We are using saxon xml processor version 9 and xslt 2.0. So we need to use saxon:evaluate(). I tried to find more examples of saxon:evaluate(), but couldn't find it more. Can anyone show me some examples of how to use it?</p>
<p>Thanks in advance.</p> Saxon-CE help: RE: Trying to convert SVG to JSONhttps://saxonica.plan.io/boards/1/topics/6814?r=6816#message-68162017-06-15T15:07:57Zarniwarp Sklinb
<p>Hello Kay,</p>
<pre><code>I deeply appreciate your guidance and instant response.
I will try to use Saxon-JS for the transformation of JSON format.
XSLT 2.0 and XPath 2.0 4th Edition is a great reference book.
Thanks a lot.
</code></pre> Saxon-CE help: RE: Trying to convert SVG to JSONhttps://saxonica.plan.io/boards/1/topics/6814?r=6815#message-68152017-06-15T14:44:11ZMichael Kaymike@saxonica.com
<p>Very hard to tell from this, I'm afraid.</p>
<p>I would strongly suggest that you migrate from Saxon-CE to Saxon-JS, which we are in a much better position to support. Saxon-CE is a dead end.</p>
<p>Also, Saxon-JS supports XSLT 3.0 which has a lot of built-in support for JSON (so you might be able to use the custom XML-to-JSON conversion as an alternative to the stylesheets you are running - though it would still need tailoring to your specific needs).</p> Saxon-CE help: Trying to convert SVG to JSONhttps://saxonica.plan.io/boards/1/topics/68142017-06-15T14:19:46Zarniwarp Sklinb
<p>Hi,</p>
<pre><code> I want to convert an SVG file with [[https://github.com/JayDaley/XML-to-JSON-in-XSLT]] to JSON format.
The SVG input, html and xsl files are as attached. Because xml-to-json.xsl requires an XSLT 2.0 processor,
I need to use Saxon-CE; but there's an error in Chrome's console message:
SaxonCE.XSLT20Processor 21: 20: 24.613 SEVERE: Exception java.lang.IllegalArgumentException in invokeTransform: non-integral
Who could kindly help me with some hints?
</code></pre> Saxon-CE help: RE: SaxonCE not loadinghttps://saxonica.plan.io/boards/1/topics/6736?r=6740#message-67402017-03-21T16:04:49ZMax Chemtov
<p>Unfortunately, I can't do the $600 for SaxonEE, and the stylesheet would have to be re-compiled regularly. But thanks.</p> Saxon-CE help: RE: SaxonCE not loadinghttps://saxonica.plan.io/boards/1/topics/6736?r=6739#message-67392017-03-21T15:31:41ZMichael Kaymike@saxonica.com
<p>If this is something new you're developing (or even if it isn't) I'd suggest strongly moving to Saxon-JS as a much more modern product that offers all the same capability, plus we're much better placed to support it!</p> Saxon-CE help: RE: SaxonCE not loadinghttps://saxonica.plan.io/boards/1/topics/6736?r=6738#message-67382017-03-21T15:26:20ZMax Chemtov
<p>Thanks for the quick response.
I am completely new to this, and so just blindly copied what was in the documentation and figured that onSaxonLoad was some kind of event. But it makes sense that it would still need to be called somewhere.</p>
<p>I've added the call, but Saxon.run() still doesn't seem to be doing anything...</p> Saxon-CE help: RE: SaxonCE not loadinghttps://saxonica.plan.io/boards/1/topics/6736?r=6737#message-67372017-03-21T15:17:20ZMichael Kaymike@saxonica.com
<p>I'm afraid we're not really able to offer much in the way of Saxon-CE support any more, as all our efforts are going into the replacement product Saxon-JS.</p>
<p>I can see that you've taken sample.boot.xsl straight from the documentation, but I can't see how it is supposed to work. All the script does is bind a variable onSaxonLoad to a function, it doesn't actually invoke that function. I would have expected to see, for example</p>
<p>@</p>@ Saxon-CE help: SaxonCE not loadinghttps://saxonica.plan.io/boards/1/topics/67362017-03-21T14:29:56ZMax Chemtov
<p>When I try to run a simple test code, it seems that the function onSaxonLoad never executes. I'm not sure what I'm doing wrong, any help would be appreciated. I am trying to open test.xml in a browser through python's SimpleHTTPServer.</p>
<p>I've attached the relevant files. All three files are in a directory which also contains the Saxonce directory.</p> Saxon-CE help: RE: Processor Lifecycle, or Can I Cache a Processor?https://saxonica.plan.io/boards/1/topics/6483?r=6493#message-64932016-08-02T13:22:47ZChris Despopoulosdespopoulos_chriss@yahoo.com
<p>Fair enough. By any chance, is there a way for me to get hold of the source to see if I can fix it locally? (Probably not, but I have to ask...)</p>
<p>I might want to use Saxon-JS, then. Will it be open source as well? And can I see a Beta?</p>
<p>This is why I asked about lifecycle... I believe you manage XML files as placeholders under the covers, and then get them synchronously or asynchronously depending on the need. So do you perform any sort of under-the-covers management of the processor as well? Like when you execute the NEW, do you see that one already exists and use it? Or does every NEW create a unique object, and it's up to garbage collection to get rid of them all?</p> Saxon-CE help: RE: Processor Lifecycle, or Can I Cache a Processor?https://saxonica.plan.io/boards/1/topics/6483?r=6491#message-64912016-08-01T23:13:21ZMichael Kaymike@saxonica.com
<p>I'm not sure what's going on here.</p>
<p>I'm also sorry to say that I'm not sure there is all that much point in investigating it. Even before the launch of Saxon-JS, it has become increasingly unlikely that we will ever ship a maintenance release of Saxon-CE, because it takes about a month just to test it, and with the passage of time and changes in the browser environment, and increasing number of the tests that we have are no longer valid. One of the aims of the Saxon-JS development has been to put this situation behind us and create a product that is much more readily testable. So even if we do isolate the bug, I don't think it is likely to be fixed. I'm afraid that's a price you pay with open source licenses.</p> Saxon-CE help: RE: Processor Lifecycle, or Can I Cache a Processor?https://saxonica.plan.io/boards/1/topics/6483?r=6490#message-64902016-08-01T21:07:42ZChris Despopoulosdespopoulos_chriss@yahoo.com
<p>Sadly, I believe the processor does not update with a new stylesheet. I put a test together that minimizes the variables. I call two different stylesheets to run against the same XML. One is supposed to only deliver the short description, and the other delivers the whole topic. I prove that I'm getting a different stylesheet. Then I prove that the processor delivers the same result no matter which stylesheet I use. So the results I get indicate that I can't reset the stylesheet. Am I doing something wrong?</p>
<p>Here's the HTML with two links to transform the XML. Note that the XSLT files, the XML File, and the test.js file are all in the same directory, to keep things simple.</p>
<script type="text/javascript" src="./Saxon-CE_1_1/SaxonceDebug/Saxonce.nocache.js"></script>
<script type="text/javascript" src="./test.js"></script>
<a href="#">Short Desc</a><br>
<a href="#">Task</a><br>
<p>Now here's test.js which creates the processor to init, and then reuses it for further calls. :</p>
<p>var myTest = {
_processor : undefined,</p>
<pre><code>transformToHtmlString : function(content, transform) {
if(this._processor === undefined) {
alert("CREATING PROCESSOR: "+transform);
this._processor = Saxon.newXSLT20Processor(Saxon.requestXML(transform));
} else {
alert("USING EXISTING PROCESSOR: "+transform);
}
this._processor.reset();
this._processor.importStylesheet(Saxon.requestXML(transform));
var result = this._processor.transformToDocument(Saxon.requestXML(content));
alert(Saxon.serializeXML(result));
}
</code></pre>
<p>};</p> Saxon-CE help: RE: Processor Lifecycle, or Can I Cache a Processor?https://saxonica.plan.io/boards/1/topics/6483?r=6485#message-64852016-07-25T18:05:48ZChris Despopoulosdespopoulos_chriss@yahoo.com
<p>So to recap, there's no reason that one CANNOT create a singleton processor and reuse it at arbitrary times in an app. Correct?</p>
<p>I need to make sure I have eliminated any scoping issues that AngularJS might cause. But I have verified:</p>
<ul>
<li>I am reusing the same processor</li>
<li>I am passing in a unique URI to the XSLT</li>
</ul>
<p>I don't see any obvious way to ask the processor what stylesheet is thinks it's using -- is there something I can look at in the processor?</p>
<p>Thanks cud</p>