Giter Club home page Giter Club logo

xmljellysandwich's People

Contributors

wendellpiez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

xmljellysandwich's Issues

suggested documentation improvement

Here is a suggestion for updating a particular section of the README markdown file. Since it is written in gfmd, it will show up on this ticket rendered. But I believe if you copy-and-paste (or edit the ticket) you can access the markdown. I have inserted questions surrounded by guillemets in bold.

‘hosting’ (HTML) page

The HTML (or XHTML) ‘hosting’ file is the landing page that is loaded into the user’s browser to kick everything else off. You can create one by copying and then altering any one of the index.html files from one of the docs/*/ directories of this repository, or by using the “starter maker” XSLT program described below.

Either way, the ‘hosting’ HTML page needs a few control points:

  • There should be a script[@src='lib/saxon/SaxonJS.min.js'], or equivalent. The named Javascript file must be in the location mentioned
<script type="text/javascript"
        src="../lib/saxon/SaxonJS.min.js"><!-- cosmetic comment --></script>
  • Within a second script element the SaxonJS.transform() function should be set up with settings for your source XML and your SEF (compiled XSLT). In the example below {$resource_filename} should be the path to the XML file you plan to deliver. «?wp is path relative from the hosting file or the .sef file?» The {$transform_href} should point to your your SEF. «?wp same Q?» The {$xmljellysandwich_pack} identifies the entry point for the stylesheet (this names a template appearing in XSLTs produced by the starter-maker, but your XSLT could offer its own entry points). Adjust as necessary for your XSLT.
<script>
    window.onload = function() {
    SaxonJS.transform({
        sourceLocation:     "{$resource_filename}",
        stylesheetLocation: "{$transform_href}",
        initialTemplate:    "xmljellysandwich_pack"
    });
    }     
</script>
  • Either on the <body> element of the HTML, or somewhere inside it, make sure to put in a dummy element that has an @id attribute. This dummy element will be replaced with whatever the SEFed stylesheet writes to that ID using <xsl:result-document>. The hostHTMLfile-maker.xsl program (described below) uses the IDs “header”, “directory”, “body”, and “footer”, each prefixed with “xmljellysandwich_”. These dummy elements (which could be just one element, the entire <body>, if you like) will be replaced by a <xsl:result-document> instruction in the XSLT-turned-SEF.”.

Note that these and many other runtime options for SaxonJS are documented at http://www.saxonica.com/saxon-js/documentation/index.html#!api/transform.

You are done with the host file. (You can come back.)

Add Wiki for Tips&Tricks?

This hint probably belongs into the core Saxon-JS documentation, but I was unable to find it there.

I developed a small application with a textarea. I was surprised to see that rendering its content would only give me the placeholder text that I put into the HTML source, rather than the text that was entered by the user. Then I remembered that I had the same issue with a program that I wrote with Saxon CE six (!) years ago. I looked up how I solved it: With @prop:value. Then I read about ixsl:get() that is meant to replace the @prop:* attributes. I figured out that I need to use something like ixsl:get(id('area1',ixsl:page()), 'value').

I suggest that we use the Wiki of this repo in order to document hints like this, ideally pointing to projects where the techniques are being employed. (I’ll add my current tiny project to Github soon.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.