Invoking saxon from javascript

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Invoking saxon from javascript

Ruprecht von Waldenfels
Dear All,
I hope this is not a very stupid question, but I can't seem to find the
answer myself.

I want to invoke Saxon-ce using javascript, that is, with one of the
four methods described here:
http://www.saxonica.com/ce/user-doc/1.1/index.html#!starting/running

However, I understand all these methods presuppose a file with the input
data. However, I am calling this from php and have my data in a variable
and would prefer not write it to a file, so as to stay thread-safe. I
can't see how this is done without installing the php extension which,
however, I would prefer not to, so to make my code more portable.

I'd appreciate your help,
best,
Ruprecht

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Invoking saxon from javascript

Michael Kay
Saxon-CE only works in the browser. Your PHP code, I assume is running on the server. So you can't invoke Saxon-CE directly from your PHP code.

I think you should probably be looking at the Saxon/C product (sorry about the confusing naming). Either that, or I'm very confused about what you are trying to do.

Michael Kay
Saxonica
[hidden email]
+44 (0) 118 946 5893




On 8 Dec 2014, at 12:21, Ruprecht von Waldenfels <[hidden email]> wrote:

> Dear All,
> I hope this is not a very stupid question, but I can't seem to find the
> answer myself.
>
> I want to invoke Saxon-ce using javascript, that is, with one of the
> four methods described here:
> http://www.saxonica.com/ce/user-doc/1.1/index.html#!starting/running
>
> However, I understand all these methods presuppose a file with the input
> data. However, I am calling this from php and have my data in a variable
> and would prefer not write it to a file, so as to stay thread-safe. I
> can't see how this is done without installing the php extension which,
> however, I would prefer not to, so to make my code more portable.
>
> I'd appreciate your help,
> best,
> Ruprecht
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help 


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Invoking saxon from javascript

Ruprecht von Waldenfels
I think you might be right, but to make sure, let me clarify.

I would like the web server to send a file to the client which should
then be transformed using an XSLT 2.0 stylesheet. So this is exactly
what I would usually do with the boot-stylesheet approach, as on the
web, namely
<?xml-stylesheet type="text/xsl" href="sample.boot.xsl"?> <dt:data-set
xmlns:dt="urn:system.logging.data.xml"> <dt:rows name="test-data">...

However, I want to use parameters, so I want to use the script approach
<script> var onSaxonLoad = function() { Saxon.run( { stylesheet:
"books.xsl", source: "books.xml" }); </script>

However, doing this, I need to explicitely give the source file; but
this is dynamically generated, so there is no file name.

So I would need the flexibility of using the first approach
(stylesheet-declaration), but with an parameter, and without referencing
a static data file on the server.

I hope I am clearer now.

Best, Ruprecht






Am 08.12.2014 um 13:47 schrieb Michael Kay:

> Saxon-CE only works in the browser. Your PHP code, I assume is running on the server. So you can't invoke Saxon-CE directly from your PHP code.
>
> I think you should probably be looking at the Saxon/C product (sorry about the confusing naming). Either that, or I'm very confused about what you are trying to do.
>
> Michael Kay
> Saxonica
> [hidden email]
> +44 (0) 118 946 5893
>
>
>
>
> On 8 Dec 2014, at 12:21, Ruprecht von Waldenfels <[hidden email]> wrote:
>
>> Dear All,
>> I hope this is not a very stupid question, but I can't seem to find the
>> answer myself.
>>
>> I want to invoke Saxon-ce using javascript, that is, with one of the
>> four methods described here:
>> http://www.saxonica.com/ce/user-doc/1.1/index.html#!starting/running
>>
>> However, I understand all these methods presuppose a file with the input
>> data. However, I am calling this from php and have my data in a variable
>> and would prefer not write it to a file, so as to stay thread-safe. I
>> can't see how this is done without installing the php extension which,
>> however, I would prefer not to, so to make my code more portable.
>>
>> I'd appreciate your help,
>> best,
>> Ruprecht
>>
>> ------------------------------------------------------------------------------
>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>> Get technology previously reserved for billion-dollar corporations, FREE
>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Invoking saxon from javascript

Michael Kay
In reply to this post by Michael Kay
After talking to O'Neil, we think you are probably trying to use PHP to generate an HTML page which contains an invocation of Saxon-CE, so what you really want to do is to generate the XML content as part of the HTML page, from your PHP variable, in such a way that the XSLT code can pick up the XML from the HTML page content. That sounds feasible, e.g. putting the XML inside an HTML script element, but we haven't worked out all the details or tried it out. Are we right in thinking this is what you want to do?

Michael Kay
Saxonica
[hidden email]
+44 (0) 118 946 5893




On 8 Dec 2014, at 12:47, Michael Kay <[hidden email]> wrote:

> Saxon-CE only works in the browser. Your PHP code, I assume is running on the server. So you can't invoke Saxon-CE directly from your PHP code.
>
> I think you should probably be looking at the Saxon/C product (sorry about the confusing naming). Either that, or I'm very confused about what you are trying to do.
>
> Michael Kay
> Saxonica
> [hidden email]
> +44 (0) 118 946 5893
>
>
>
>
> On 8 Dec 2014, at 12:21, Ruprecht von Waldenfels <[hidden email]> wrote:
>
>> Dear All,
>> I hope this is not a very stupid question, but I can't seem to find the
>> answer myself.
>>
>> I want to invoke Saxon-ce using javascript, that is, with one of the
>> four methods described here:
>> http://www.saxonica.com/ce/user-doc/1.1/index.html#!starting/running
>>
>> However, I understand all these methods presuppose a file with the input
>> data. However, I am calling this from php and have my data in a variable
>> and would prefer not write it to a file, so as to stay thread-safe. I
>> can't see how this is done without installing the php extension which,
>> however, I would prefer not to, so to make my code more portable.
>>
>> I'd appreciate your help,
>> best,
>> Ruprecht
>>
>> ------------------------------------------------------------------------------
>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>> Get technology previously reserved for billion-dollar corporations, FREE
>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help 
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help 


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Invoking saxon from javascript

Ruprecht von Waldenfels
Right, that's exactly want to do.
Am 08.12.2014 um 14:10 schrieb Michael Kay:

> After talking to O'Neil, we think you are probably trying to use PHP to generate an HTML page which contains an invocation of Saxon-CE, so what you really want to do is to generate the XML content as part of the HTML page, from your PHP variable, in such a way that the XSLT code can pick up the XML from the HTML page content. That sounds feasible, e.g. putting the XML inside an HTML script element, but we haven't worked out all the details or tried it out. Are we right in thinking this is what you want to do?
>
> Michael Kay
> Saxonica
> [hidden email]
> +44 (0) 118 946 5893
>
>
>
>
> On 8 Dec 2014, at 12:47, Michael Kay <[hidden email]> wrote:
>
>> Saxon-CE only works in the browser. Your PHP code, I assume is running on the server. So you can't invoke Saxon-CE directly from your PHP code.
>>
>> I think you should probably be looking at the Saxon/C product (sorry about the confusing naming). Either that, or I'm very confused about what you are trying to do.
>>
>> Michael Kay
>> Saxonica
>> [hidden email]
>> +44 (0) 118 946 5893
>>
>>
>>
>>
>> On 8 Dec 2014, at 12:21, Ruprecht von Waldenfels <[hidden email]> wrote:
>>
>>> Dear All,
>>> I hope this is not a very stupid question, but I can't seem to find the
>>> answer myself.
>>>
>>> I want to invoke Saxon-ce using javascript, that is, with one of the
>>> four methods described here:
>>> http://www.saxonica.com/ce/user-doc/1.1/index.html#!starting/running
>>>
>>> However, I understand all these methods presuppose a file with the input
>>> data. However, I am calling this from php and have my data in a variable
>>> and would prefer not write it to a file, so as to stay thread-safe. I
>>> can't see how this is done without installing the php extension which,
>>> however, I would prefer not to, so to make my code more portable.
>>>
>>> I'd appreciate your help,
>>> best,
>>> Ruprecht
>>>
>>> ------------------------------------------------------------------------------
>>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>>> Get technology previously reserved for billion-dollar corporations, FREE
>>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>> ------------------------------------------------------------------------------
>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>> Get technology previously reserved for billion-dollar corporations, FREE
>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Invoking saxon from javascript

Ruprecht von Waldenfels
Right, that's exactly what I want to do.
Am 08.12.2014 um 14:17 schrieb Ruprecht von Waldenfels:

> Right, that's exactly want to do.
> Am 08.12.2014 um 14:10 schrieb Michael Kay:
>> After talking to O'Neil, we think you are probably trying to use PHP
>> to generate an HTML page which contains an invocation of Saxon-CE, so
>> what you really want to do is to generate the XML content as part of
>> the HTML page, from your PHP variable, in such a way that the XSLT
>> code can pick up the XML from the HTML page content. That sounds
>> feasible, e.g. putting the XML inside an HTML script element, but we
>> haven't worked out all the details or tried it out. Are we right in
>> thinking this is what you want to do?
>>
>> Michael Kay
>> Saxonica
>> [hidden email]
>> +44 (0) 118 946 5893
>>
>>
>>
>>
>> On 8 Dec 2014, at 12:47, Michael Kay <[hidden email]> wrote:
>>
>>> Saxon-CE only works in the browser. Your PHP code, I assume is
>>> running on the server. So you can't invoke Saxon-CE directly from
>>> your PHP code.
>>>
>>> I think you should probably be looking at the Saxon/C product (sorry
>>> about the confusing naming). Either that, or I'm very confused about
>>> what you are trying to do.
>>>
>>> Michael Kay
>>> Saxonica
>>> [hidden email]
>>> +44 (0) 118 946 5893
>>>
>>>
>>>
>>>
>>> On 8 Dec 2014, at 12:21, Ruprecht von Waldenfels
>>> <[hidden email]> wrote:
>>>
>>>> Dear All,
>>>> I hope this is not a very stupid question, but I can't seem to find
>>>> the
>>>> answer myself.
>>>>
>>>> I want to invoke Saxon-ce using javascript, that is, with one of the
>>>> four methods described here:
>>>> http://www.saxonica.com/ce/user-doc/1.1/index.html#!starting/running
>>>>
>>>> However, I understand all these methods presuppose a file with the
>>>> input
>>>> data. However, I am calling this from php and have my data in a
>>>> variable
>>>> and would prefer not write it to a file, so as to stay thread-safe. I
>>>> can't see how this is done without installing the php extension which,
>>>> however, I would prefer not to, so to make my code more portable.
>>>>
>>>> I'd appreciate your help,
>>>> best,
>>>> Ruprecht
>>>>
>>>> ------------------------------------------------------------------------------
>>>>
>>>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>>>> from Actuate! Instantly Supercharge Your Business Reports and
>>>> Dashboards
>>>> with Interactivity, Sharing, Native Excel Exports, App Integration
>>>> & more
>>>> Get technology previously reserved for billion-dollar corporations,
>>>> FREE
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk 
>>>>
>>>> _______________________________________________
>>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>>
>>> ------------------------------------------------------------------------------
>>>
>>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>>> from Actuate! Instantly Supercharge Your Business Reports and
>>> Dashboards
>>> with Interactivity, Sharing, Native Excel Exports, App Integration &
>>> more
>>> Get technology previously reserved for billion-dollar corporations,
>>> FREE
>>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk 
>>>
>>> _______________________________________________
>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>> ------------------------------------------------------------------------------
>>
>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>> with Interactivity, Sharing, Native Excel Exports, App Integration &
>> more
>> Get technology previously reserved for billion-dollar corporations, FREE
>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk 
>>
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Invoking saxon from javascript

Ruprecht von Waldenfels
In reply to this post by Michael Kay
Dear Michael and O'Neil,

I am returning to the issue I was having in december, that is, I am
using php to generate XML data that I then want to be displayed using a
xslt 2.0 stylesheet. I have to say I don't quite understand how to do
this, yet. You were suggesting to put the complete XML data into an HTML
script element - could you explain this idea in some more detail?
Thanks and best,
Ruprecht
Am 08.12.2014 um 14:10 schrieb Michael Kay:

> After talking to O'Neil, we think you are probably trying to use PHP to generate an HTML page which contains an invocation of Saxon-CE, so what you really want to do is to generate the XML content as part of the HTML page, from your PHP variable, in such a way that the XSLT code can pick up the XML from the HTML page content. That sounds feasible, e.g. putting the XML inside an HTML script element, but we haven't worked out all the details or tried it out. Are we right in thinking this is what you want to do?
>
> Michael Kay
> Saxonica
> [hidden email]
> +44 (0) 118 946 5893
>
>
>
>
> On 8 Dec 2014, at 12:47, Michael Kay <[hidden email]> wrote:
>
>> Saxon-CE only works in the browser. Your PHP code, I assume is running on the server. So you can't invoke Saxon-CE directly from your PHP code.
>>
>> I think you should probably be looking at the Saxon/C product (sorry about the confusing naming). Either that, or I'm very confused about what you are trying to do.
>>
>> Michael Kay
>> Saxonica
>> [hidden email]
>> +44 (0) 118 946 5893
>>
>>
>>
>>
>> On 8 Dec 2014, at 12:21, Ruprecht von Waldenfels <[hidden email]> wrote:
>>
>>> Dear All,
>>> I hope this is not a very stupid question, but I can't seem to find the
>>> answer myself.
>>>
>>> I want to invoke Saxon-ce using javascript, that is, with one of the
>>> four methods described here:
>>> http://www.saxonica.com/ce/user-doc/1.1/index.html#!starting/running
>>>
>>> However, I understand all these methods presuppose a file with the input
>>> data. However, I am calling this from php and have my data in a variable
>>> and would prefer not write it to a file, so as to stay thread-safe. I
>>> can't see how this is done without installing the php extension which,
>>> however, I would prefer not to, so to make my code more portable.
>>>
>>> I'd appreciate your help,
>>> best,
>>> Ruprecht
>>>
>>> ------------------------------------------------------------------------------
>>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>>> Get technology previously reserved for billion-dollar corporations, FREE
>>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>> ------------------------------------------------------------------------------
>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>> Get technology previously reserved for billion-dollar corporations, FREE
>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Invoking saxon from javascript

Michael Kay
Is this for Saxon-CE running within the browser? I think I need a better understanding of your application architecture.

Michael Kay
Saxonica
[hidden email]
+44 (0) 118 946 5893




On 12 Mar 2015, at 15:37, Ruprecht von Waldenfels <[hidden email]> wrote:

> Dear Michael and O'Neil,
>
> I am returning to the issue I was having in december, that is, I am
> using php to generate XML data that I then want to be displayed using a
> xslt 2.0 stylesheet. I have to say I don't quite understand how to do
> this, yet. You were suggesting to put the complete XML data into an HTML
> script element - could you explain this idea in some more detail?
> Thanks and best,
> Ruprecht
> Am 08.12.2014 um 14:10 schrieb Michael Kay:
>> After talking to O'Neil, we think you are probably trying to use PHP to generate an HTML page which contains an invocation of Saxon-CE, so what you really want to do is to generate the XML content as part of the HTML page, from your PHP variable, in such a way that the XSLT code can pick up the XML from the HTML page content. That sounds feasible, e.g. putting the XML inside an HTML script element, but we haven't worked out all the details or tried it out. Are we right in thinking this is what you want to do?
>>
>> Michael Kay
>> Saxonica
>> [hidden email]
>> +44 (0) 118 946 5893
>>
>>
>>
>>
>> On 8 Dec 2014, at 12:47, Michael Kay <[hidden email]> wrote:
>>
>>> Saxon-CE only works in the browser. Your PHP code, I assume is running on the server. So you can't invoke Saxon-CE directly from your PHP code.
>>>
>>> I think you should probably be looking at the Saxon/C product (sorry about the confusing naming). Either that, or I'm very confused about what you are trying to do.
>>>
>>> Michael Kay
>>> Saxonica
>>> [hidden email]
>>> +44 (0) 118 946 5893
>>>
>>>
>>>
>>>
>>> On 8 Dec 2014, at 12:21, Ruprecht von Waldenfels <[hidden email]> wrote:
>>>
>>>> Dear All,
>>>> I hope this is not a very stupid question, but I can't seem to find the
>>>> answer myself.
>>>>
>>>> I want to invoke Saxon-ce using javascript, that is, with one of the
>>>> four methods described here:
>>>> http://www.saxonica.com/ce/user-doc/1.1/index.html#!starting/running
>>>>
>>>> However, I understand all these methods presuppose a file with the input
>>>> data. However, I am calling this from php and have my data in a variable
>>>> and would prefer not write it to a file, so as to stay thread-safe. I
>>>> can't see how this is done without installing the php extension which,
>>>> however, I would prefer not to, so to make my code more portable.
>>>>
>>>> I'd appreciate your help,
>>>> best,
>>>> Ruprecht
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>>>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>>>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>>>> Get technology previously reserved for billion-dollar corporations, FREE
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>>>> _______________________________________________
>>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>>
>>> ------------------------------------------------------------------------------
>>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>>> Get technology previously reserved for billion-dollar corporations, FREE
>>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>> ------------------------------------------------------------------------------
>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>> Get technology previously reserved for billion-dollar corporations, FREE
>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help 


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Invoking saxon from javascript

Ruprecht von Waldenfels
Yes, that's for Saxon-CE.

I run a corpus (basically, a data base of text for linguistic research)
as a web based service. The user inputs a query in a web interface and
is returned an xml file together with an xslt stylesheet for formatting.
Till now I have been using xslt 1.0, but now I need 2.0, hence I am
trying to use saxon ce.

The server architecture is basically a php-based interface to the data
base with apache as a web server, all on a ubuntu 64 bit server.

Is this explicit enough? I can be more specific.

Best,
Ruprecht
Am 12.03.2015 um 16:48 schrieb Michael Kay:

> Is this for Saxon-CE running within the browser? I think I need a better understanding of your application architecture.
>
> Michael Kay
> Saxonica
> [hidden email]
> +44 (0) 118 946 5893
>
>
>
>
> On 12 Mar 2015, at 15:37, Ruprecht von Waldenfels <[hidden email]> wrote:
>
>> Dear Michael and O'Neil,
>>
>> I am returning to the issue I was having in december, that is, I am
>> using php to generate XML data that I then want to be displayed using a
>> xslt 2.0 stylesheet. I have to say I don't quite understand how to do
>> this, yet. You were suggesting to put the complete XML data into an HTML
>> script element - could you explain this idea in some more detail?
>> Thanks and best,
>> Ruprecht
>> Am 08.12.2014 um 14:10 schrieb Michael Kay:
>>> After talking to O'Neil, we think you are probably trying to use PHP to generate an HTML page which contains an invocation of Saxon-CE, so what you really want to do is to generate the XML content as part of the HTML page, from your PHP variable, in such a way that the XSLT code can pick up the XML from the HTML page content. That sounds feasible, e.g. putting the XML inside an HTML script element, but we haven't worked out all the details or tried it out. Are we right in thinking this is what you want to do?
>>>
>>> Michael Kay
>>> Saxonica
>>> [hidden email]
>>> +44 (0) 118 946 5893
>>>
>>>
>>>
>>>
>>> On 8 Dec 2014, at 12:47, Michael Kay <[hidden email]> wrote:
>>>
>>>> Saxon-CE only works in the browser. Your PHP code, I assume is running on the server. So you can't invoke Saxon-CE directly from your PHP code.
>>>>
>>>> I think you should probably be looking at the Saxon/C product (sorry about the confusing naming). Either that, or I'm very confused about what you are trying to do.
>>>>
>>>> Michael Kay
>>>> Saxonica
>>>> [hidden email]
>>>> +44 (0) 118 946 5893
>>>>
>>>>
>>>>
>>>>
>>>> On 8 Dec 2014, at 12:21, Ruprecht von Waldenfels <[hidden email]> wrote:
>>>>
>>>>> Dear All,
>>>>> I hope this is not a very stupid question, but I can't seem to find the
>>>>> answer myself.
>>>>>
>>>>> I want to invoke Saxon-ce using javascript, that is, with one of the
>>>>> four methods described here:
>>>>> http://www.saxonica.com/ce/user-doc/1.1/index.html#!starting/running
>>>>>
>>>>> However, I understand all these methods presuppose a file with the input
>>>>> data. However, I am calling this from php and have my data in a variable
>>>>> and would prefer not write it to a file, so as to stay thread-safe. I
>>>>> can't see how this is done without installing the php extension which,
>>>>> however, I would prefer not to, so to make my code more portable.
>>>>>
>>>>> I'd appreciate your help,
>>>>> best,
>>>>> Ruprecht
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>>>>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>>>>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>>>>> Get technology previously reserved for billion-dollar corporations, FREE
>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>>>>> _______________________________________________
>>>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>>>> [hidden email]
>>>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>>> ------------------------------------------------------------------------------
>>>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>>>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>>>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>>>> Get technology previously reserved for billion-dollar corporations, FREE
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>>>> _______________________________________________
>>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>> ------------------------------------------------------------------------------
>>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>>> Get technology previously reserved for billion-dollar corporations, FREE
>>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>> ------------------------------------------------------------------------------
>> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
>> by Intel and developed in partnership with Slashdot Media, is your hub for all
>> things parallel software development, from weekly thought leadership blogs to
>> news, videos, case studies, tutorials and more. Take a look and join the
>> conversation now. http://goparallel.sourceforge.net/
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Invoking saxon from javascript

Ruprecht von Waldenfels
So basically, my problem is I dynamically generate XML files that include in their header the specification of a static XSLT stylesheet I use to format my results. A real-life example with my XSLT 1 stylesheet is this:

<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="./parallel-kwic.xsl" ?><RESULTS primlang="en"><CONCORDANCE>
<LINE><MATCHNUM>2691</MATCHNUM><CONTENT> <TOKEN>He<ANNOT>he/PP</ANNOT></TOKEN> <TOKEN>also<ANNOT>also/RB</ANNOT></TOKEN> <TOKEN>granted<ANNOT&g
t;grant/VVD</ANNOT></TOKEN> <TOKEN>him<ANNOT>him/PP</ANNOT></TOKEN> <TOKEN>the<ANNOT>the/DT</ANNOT></TOKEN> <TOKEN>right<ANNOT>right/NN</ANNOT></TOKEN> <TOKEN>to<ANNOT>to/TO</ANNOT></TOKEN> <TOKEN>visit<ANNOT>visit/VV</ANNOT></TOKEN> <TOKEN>the<ANNOT>the/DT</ANNOT></TOKEN> <MATCH><TOKEN>boy<ANNOT>boy/NN</ANNOT></TOKEN></MATCH> <TOKEN>every<ANNOT>every/DT</ANNOT></TOKEN> <TOKEN>other<ANNOT>other/JJ</ANNOT></TOKEN> <TOKEN>week&l
t;ANNOT>week/NN</ANNOT></TOKEN> <TOKEN>.<ANNOT>./SENT</ANNOT></TOKEN></CONTENT></LINE>
<ALIGN name="kunderalehkost_cz"><CONTENT> <TOKEN>Zaručil<ANNOT>zaručit/VpYS---XR-AA---P</ANNOT></TOKEN> <TOKEN>mu<ANNOT>on/PHZS3--3-------</ANNOT></TOKEN> <TOKEN>zároveň<ANNOT>zároveň/Db-------------</ANNOT></TOKEN> <TOKEN>,<ANNOT>,/Z:-------------</ANNOT></TOKEN> <TOKEN>že<ANNOT>že/J,-------------</ANNOT></TOKEN> <TOKEN>smí<ANNOT>smět/VB-S---3P-AA---I</ANNOT></TOKEN> <TOKEN>syna<ANNOT>syn/NNMS4-----A----</ANNOT></TOKEN> <TOKEN>vidět<ANNOT>vidět/Vf--------A----I</ANNOT></TOKEN> <TOKEN>každou<ANNOT>každý/AAFS4----1A----</ANNOT></TOKEN> <TOKEN>druhou<ANNOT>druhý/CrFS4----------</ANNOT></TOKEN> <TOKEN>neděli<ANNOT>neděle/NNFS4-----A----</ANNOT></TOKEN> <TOKEN>.<ANNOT>./Z:-------------</ANNOT></TOKEN></CONTENT> 
</ALIGN>
<ALIGN name="kunderalehkost_de"><CONTENT> <TOKEN>Gleichzeitig<ANNOT>gleichzeitig/ADJD</ANNOT></TOKEN> <TOKEN>wurde<ANNOT>werden/VAFIN</ANNOT></TOKEN> <TOKEN>ihm<ANNOT>er/PPER</ANNOT></TOKEN> <TOKEN>das<ANNOT>d/ART</ANNOT></TOKEN> <TOKEN>Recht<ANNOT>Recht/NN</ANNOT></TOKEN> <TOKEN>zugestanden<ANNOT>zugestehen|zustehen/VVPP</ANNOT></TOKEN> <TOKEN>,<ANNOT>,/$,</ANNOT></TOKEN> <TOKEN>seinen<ANNOT>sein/PPOSAT</ANNOT></TOKEN> <TOKEN>Sohn<ANNOT>Sohn/NN</ANNOT></TOKEN> <TOKEN>alle<
span><ANNOT>alle/PIAT</ANNOT></TOKEN> <TOKEN>zwei<ANNOT>zwei/CARD</ANNOT></TOKEN> <TOKEN>Wochen<ANNOT>Woche/NN</ANNOT></TOKEN> <TOKEN>zu<ANNOT>zu/PTKZU</ANNOT&g
t;</TOKEN> <TOKEN>sehen<ANNOT>sehen/VVINF</ANNOT></TOKEN> <TOKEN>.<ANNOT>./$.</ANNOT></TOKEN></CONTENT> </ALIGN>
</CONCORDANCE>
1</RESULTS>

Now, I need regular expression matching for a new feature, and thus need to move to XSLT 2.

Best, 
Ruprecht


Am 12.03.2015 um 17:06 schrieb Ruprecht von Waldenfels:
Yes, that's for Saxon-CE.

I run a corpus (basically, a data base of text for linguistic research) as a web based service. The user inputs a query in a web interface and is returned an xml file together with an xslt stylesheet for formatting. Till now I have been using xslt 1.0, but now I need 2.0, hence I am trying to use saxon ce.

The server architecture is basically a php-based interface to the data base with apache as a web server, all on a ubuntu 64 bit server.

Is this explicit enough? I can be more specific.

Best,
Ruprecht
Am 12.03.2015 um 16:48 schrieb Michael Kay:
Is this for Saxon-CE running within the browser? I think I need a better understanding of your application architecture.

Michael Kay
Saxonica
[hidden email]
+44 (0) 118 946 5893




On 12 Mar 2015, at 15:37, Ruprecht von Waldenfels [hidden email] wrote:

Dear Michael and O'Neil,

I am returning to the issue I was having in december, that is, I am
using php to generate XML data that I then want to be displayed using a
xslt 2.0 stylesheet. I have to say I don't quite understand how to do
this, yet. You were suggesting to put the complete XML data into an HTML
script element - could you explain this idea in some more detail?
Thanks and best,
Ruprecht
Am 08.12.2014 um 14:10 schrieb Michael Kay:
After talking to O'Neil, we think you are probably trying to use PHP to generate an HTML page which contains an invocation of Saxon-CE, so what you really want to do is to generate the XML content as part of the HTML page, from your PHP variable, in such a way that the XSLT code can pick up the XML from the HTML page content. That sounds feasible, e.g. putting the XML inside an HTML script element, but we haven't worked out all the details or tried it out. Are we right in thinking this is what you want to do?

Michael Kay
Saxonica
[hidden email]
+44 (0) 118 946 5893




On 8 Dec 2014, at 12:47, Michael Kay [hidden email] wrote:

Saxon-CE only works in the browser. Your PHP code, I assume is running on the server. So you can't invoke Saxon-CE directly from your PHP code.

I think you should probably be looking at the Saxon/C product (sorry about the confusing naming). Either that, or I'm very confused about what you are trying to do.

Michael Kay
Saxonica
[hidden email]
+44 (0) 118 946 5893




On 8 Dec 2014, at 12:21, Ruprecht von Waldenfels [hidden email] wrote:

Dear All,
I hope this is not a very stupid question, but I can't seem to find the
answer myself.

I want to invoke Saxon-ce using javascript, that is, with one of the
four methods described here:
http://www.saxonica.com/ce/user-doc/1.1/index.html#!starting/running

However, I understand all these methods presuppose a file with the input
data. However, I am calling this from php and have my data in a variable
and would prefer not write it to a file, so as to stay thread-safe. I
can't see how this is done without installing the php extension which,
however, I would prefer not to, so to make my code more portable.

I'd appreciate your help,
best,
Ruprecht

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help



------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: Invoking saxon from javascript

Michael Kay
OK, I see.

There is a way of getting the <?xml-stylesheet?> PI to work with Saxon-CE, but it's rather convoluted. When the browser sees an XML document with this PI, it will fire up the browser's native XSLT 1.0 processor.  You can get this to run a simple stub stylesheet which generates an HTML page which then loads Saxon-CE via the Saxon-CE API. It's described here:


But there's really not much point in doing this. You're better off starting with an HTML page that invokes Saxon-CE directly, it bypasses an unnecessary step. If you want to run different stylesheets to process different source documents, there are several ways you could do this:

(a) Merge them all into one stylesheet and decide the entry point (typically a named template) from your invocation in an HTML page.

(b) Have different HTML pages that load different stylesheets

(c) Have a single HTML page that reads the XML before deciding which stylesheet to load.

I think that doing it as a single-page application with hash-bang URIs, the way we have done for the Saxon documentation, is probably my preferred approach. It gives you an initial delay when first loading Saxon into the browser, but after that, navigation from page to page is very fast. The old approach of fetching a new HTML/XML page to follow every click on a hyperlink is probably not going to give as smooth a user experience. And I think the <?xml-stylesheet?> approach, where your stylesheet generates a (typically non-interactive) HTML page from scratch, is pretty clumsy: the best way of working with Saxon-CE is to have a skeletal HTML page marked out with a structure of <div> elements, and then have the stylesheet populate these <div>s using multiple transformations of different parts of the XML.

Michael Kay
Saxonica
+44 (0) 118 946 5893




On 12 Mar 2015, at 16:28, Ruprecht von Waldenfels <[hidden email]> wrote:

So basically, my problem is I dynamically generate XML files that include in their header the specification of a static XSLT stylesheet I use to format my results. A real-life example with my XSLT 1 stylesheet is this:

<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="./parallel-kwic.xsl" ?><RESULTS primlang="en"><CONCORDANCE>
<LINE><MATCHNUM>2691</MATCHNUM><CONTENT> <TOKEN>He<ANNOT>he/PP</ANNOT></TOKEN> <TOKEN>also<ANNOT>also/RB</ANNOT></TOKEN> <TOKEN>granted<ANNOT&g
t;grant/VVD</ANNOT></TOKEN> <TOKEN>him<ANNOT>him/PP</ANNOT></TOKEN> <TOKEN>the<ANNOT>the/DT</ANNOT></TOKEN> <TOKEN>right<ANNOT>right/NN</ANNOT></TOKEN> <TOKEN>to<ANNOT>to/TO</ANNOT></TOKEN> <TOKEN>visit<ANNOT>visit/VV</ANNOT></TOKEN> <TOKEN>the<ANNOT>the/DT</ANNOT></TOKEN> <MATCH><TOKEN>boy<ANNOT>boy/NN</ANNOT></TOKEN></MATCH> <TOKEN>every<ANNOT>every/DT</ANNOT></TOKEN> <TOKEN>other<ANNOT>other/JJ</ANNOT></TOKEN> <TOKEN>week&l
t;ANNOT>week/NN</ANNOT></TOKEN> <TOKEN>.<ANNOT>./SENT</ANNOT></TOKEN></CONTENT></LINE>
<ALIGN name="kunderalehkost_cz"><CONTENT> <TOKEN>Zaručil<ANNOT>zaručit/VpYS---XR-AA---P</ANNOT></TOKEN> <TOKEN>mu<ANNOT>on/PHZS3--3-------</ANNOT></TOKEN> <TOKEN>zároveň<ANNOT>zároveň/Db-------------</ANNOT></TOKEN> <TOKEN>,<ANNOT>,/Z:-------------</ANNOT></TOKEN> <TOKEN>že<ANNOT>že/J,-------------</ANNOT></TOKEN> <TOKEN>smí<ANNOT>smět/VB-S---3P-AA---I</ANNOT></TOKEN> <TOKEN>syna<ANNOT>syn/NNMS4-----A----</ANNOT></TOKEN> <TOKEN>vidět<ANNOT>vidět/Vf--------A----I</ANNOT></TOKEN> <TOKEN>každou<ANNOT>každý/AAFS4----1A----</ANNOT></TOKEN> <TOKEN>druhou<ANNOT>druhý/CrFS4----------</ANNOT></TOKEN> <TOKEN>neděli<ANNOT>neděle/NNFS4-----A----</ANNOT></TOKEN> <TOKEN>.<ANNOT>./Z:-------------</ANNOT></TOKEN></CONTENT> 
</ALIGN>
<ALIGN name="kunderalehkost_de"><CONTENT> <TOKEN>Gleichzeitig<ANNOT>gleichzeitig/ADJD</ANNOT></TOKEN> <TOKEN>wurde<ANNOT>werden/VAFIN</ANNOT></TOKEN> <TOKEN>ihm<ANNOT>er/PPER</ANNOT></TOKEN> <TOKEN>das<ANNOT>d/ART</ANNOT></TOKEN> <TOKEN>Recht<ANNOT>Recht/NN</ANNOT></TOKEN> <TOKEN>zugestanden<ANNOT>zugestehen|zustehen/VVPP</ANNOT></TOKEN> <TOKEN>,<ANNOT>,/$,</ANNOT></TOKEN> <TOKEN>seinen<ANNOT>sein/PPOSAT</ANNOT></TOKEN> <TOKEN>Sohn<ANNOT>Sohn/NN</ANNOT></TOKEN> <TOKEN>alle<
span><ANNOT>alle/PIAT</ANNOT></TOKEN> <TOKEN>zwei<ANNOT>zwei/CARD</ANNOT></TOKEN> <TOKEN>Wochen<ANNOT>Woche/NN</ANNOT></TOKEN> <TOKEN>zu<ANNOT>zu/PTKZU</ANNOT&g
t;</TOKEN> <TOKEN>sehen<ANNOT>sehen/VVINF</ANNOT></TOKEN> <TOKEN>.<ANNOT>./$.</ANNOT></TOKEN></CONTENT> </ALIGN>
</CONCORDANCE>
1</RESULTS>

Now, I need regular expression matching for a new feature, and thus need to move to XSLT 2.

Best, 
Ruprecht


Am 12.03.2015 um 17:06 schrieb Ruprecht von Waldenfels:
Yes, that's for Saxon-CE.

I run a corpus (basically, a data base of text for linguistic research) as a web based service. The user inputs a query in a web interface and is returned an xml file together with an xslt stylesheet for formatting. Till now I have been using xslt 1.0, but now I need 2.0, hence I am trying to use saxon ce.

The server architecture is basically a php-based interface to the data base with apache as a web server, all on a ubuntu 64 bit server.

Is this explicit enough? I can be more specific.

Best,
Ruprecht
Am 12.03.2015 um 16:48 schrieb Michael Kay:
Is this for Saxon-CE running within the browser? I think I need a better understanding of your application architecture.

Michael Kay
Saxonica
[hidden email]
+44 (0) 118 946 5893




On 12 Mar 2015, at 15:37, Ruprecht von Waldenfels [hidden email] wrote:

Dear Michael and O'Neil,

I am returning to the issue I was having in december, that is, I am
using php to generate XML data that I then want to be displayed using a
xslt 2.0 stylesheet. I have to say I don't quite understand how to do
this, yet. You were suggesting to put the complete XML data into an HTML
script element - could you explain this idea in some more detail?
Thanks and best,
Ruprecht
Am 08.12.2014 um 14:10 schrieb Michael Kay:
After talking to O'Neil, we think you are probably trying to use PHP to generate an HTML page which contains an invocation of Saxon-CE, so what you really want to do is to generate the XML content as part of the HTML page, from your PHP variable, in such a way that the XSLT code can pick up the XML from the HTML page content. That sounds feasible, e.g. putting the XML inside an HTML script element, but we haven't worked out all the details or tried it out. Are we right in thinking this is what you want to do?

Michael Kay
Saxonica
[hidden email]
+44 (0) 118 946 5893




On 8 Dec 2014, at 12:47, Michael Kay [hidden email] wrote:

Saxon-CE only works in the browser. Your PHP code, I assume is running on the server. So you can't invoke Saxon-CE directly from your PHP code.

I think you should probably be looking at the Saxon/C product (sorry about the confusing naming). Either that, or I'm very confused about what you are trying to do.

Michael Kay
Saxonica
[hidden email]
+44 (0) 118 946 5893




On 8 Dec 2014, at 12:21, Ruprecht von Waldenfels [hidden email] wrote:

Dear All,
I hope this is not a very stupid question, but I can't seem to find the
answer myself.

I want to invoke Saxon-ce using javascript, that is, with one of the
four methods described here:
http://www.saxonica.com/ce/user-doc/1.1/index.html#!starting/running

However, I understand all these methods presuppose a file with the input
data. However, I am calling this from php and have my data in a variable
and would prefer not write it to a file, so as to stay thread-safe. I
can't see how this is done without installing the php extension which,
however, I would prefer not to, so to make my code more portable.

I'd appreciate your help,
best,
Ruprecht

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help