[x3d-public] Demo for SAXON2JS

John Carlson yottzumm at gmail.com
Tue Sep 28 02:11:20 PDT 2021


Here's a great way to generate the .sef:

xslt3 -t -xsl:X3dToJson.xslt -export:X3dToJson.sef.json -nogo

On 9/28/21 4:10 AM, John Carlson wrote:
>
> function convertXmlToJson(xmlString, path) {
>         output = SaxonJS.transform({
>                 stylesheetLocation: 
> "../lib/stylesheets/X3dToJson.sef.json",
>                 sourceLocation: path,
>                 destination: "serialized",
>                 outputProperties: { method: "json" }
>         }, "sync");
>         let jsobj = output.principalResult;
>         jsobj = JSON.parse(jsobj);
>         console.log(jsobj);
>         return jsobj;
>
>
> The above is what I have so far.  Some combination of xmlString 
> (preferred) or perhaps path should be used.
>
> Here's the include I use in HTML:
>
> <script type="text/javascript" 
> src="../node/saxon-js/SaxonJS2.js"></script>
>
> I ran out of steam while debugging.
>
> John
>
>
> On 9/28/21 3:03 AM, John Carlson wrote:
>>
>> Pulled from another message.
>>
>> Andreas, I think you like to do demos. Could you do a demo of 
>> Saxonjs2 in the browser? Perhaps converting XML to JSON? Apparently, 
>> compiled stylesheets are a requirement.   I think we have a good 
>> opportunity to reduce server loads.   I’d like to keep my website thin.
>>
>> I am struggling, but I could give you where I left off.
>>
>> I just need someone to push through with a solution.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20210928/59682b35/attachment.html>


More information about the x3d-public mailing list