Git Product home page Git Product logo

hfmanson / xsltforms Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alaincouthures/xsltforms

0.0 2.0 0.0 4.09 MB

XForms to XHTML+Javascript (AJAX) conversion based on a unique XSL transformation. Suitable server-side (PHP) or client-side (Google Chrome, Edge, Internet Explorer, Mozilla FireFox, Opera, Safari) browser treatment where an XSLT 1.0 engine is available

ApacheConf 0.10% XSLT 12.07% PHP 3.24% CSS 3.12% JavaScript 29.46% HTML 51.82% Java 0.18% Batchfile 0.01%

xsltforms's Introduction

XSLTForms Source Management

About

XForms to XHTML+Javascript (AJAX) conversion based on a unique XSL transformation. Suitable server-side (PHP) or client-side (Internet Explorer, Mozilla FireFox, Opera, Safari) browser treatment where an XSLT 1.0 engine is available.

Source files

XSLTForms is composed of the following files :

  • xsltforms.xsl
  • xsltforms.js
  • xsltforms.css

Those files are relatively big and complex. They are generated from numerous components.

Components

Components are elementary source elements. Each is stored as an XML document with metadata, unit tests and the source itself.

Components can be composed of other components.

The main components for XSLTForms are :

  • xsltforms.xsl.xml
  • xsltforms.js.xml
  • xsltforms.css.xml

tXs

tXs is an XML script engine written in PHP 5. It is composed of an unique file named txs.php while scripts usually have a .txs extension.

First, install Apache+PHP5 locally, and activate the Rewrite Module.

Get all the XSLTForms files from SVN server into a subfolder (named XSLTFormsRoot for example) of the DocumentRoot folder (a .htaccess file should be present in the XSLTFormsRoot folder).

To check that tXs is correctly installed, get http://localhost/XSLTFormsRoot/txs/txs.php with a browser : the default script, named echo.txs should run and the response should be an XHTML page with tXs Echo Script as title.

To check that URL rewriting is correctly installed, get http:/localhost/XSLTFormsRoot/txs/echo.txs with a browser : the response should be an XHTML page with tXs Echo Script as title.

Dynamic build of XSLTForms files

Because of URL rewriting, .js, .xsl and .css files are not directly delivered. Instead, the cm.txs script is run : it collects every source within the corresponding component and sub-components. For the browser, it's exactly as if it was a real file.

So, main files are obtains with URLs like those :

  • http://localhost/XSLTFormsRoot/trunk/src/xsltforms.xsl
  • http://localhost/XSLTFormsRoot/trunk/src/xsltforms.js
  • http://localhost/XSLTFormsRoot/trunk/src/xsltforms.css

Static build of XSLTForms files

To build a component, just add ?build at the end of the component URI. The resulting file is written in the build folder at the same level as the src folder.

So, main files are built with URLs like those :

  • http://localhost/XSLTFormsRoot/trunk/src/xsltforms.xsl?build
  • http://localhost/XSLTFormsRoot/trunk/src/xsltforms.js?build
  • http://localhost/XSLTFormsRoot/trunk/src/xsltforms.css?build

Unit tests

Unit tests are based on JsUnitTest.

To run associated unit tests for a component, just add ?ut at the end of the component URI.

Examples :

  • http://localhost/XSLTFormsRoot/trunk/src/xsltforms.js?ut
  • http://localhost/XSLTFormsRoot/trunk/src/xsltforms.xsl?ut
  • http://localhost/XSLTFormsRoot/trunk/src/js/types/TypeDefs.js?ut

Test Suites

Test Suites are stored separately from components in the testsuite folder.

To run tests with trunk or branches components, the testsuite path has to be added after the src path to main components (xsltforms.*.xml). tXs scripts are there to adapt each test to XSLTForms requirements (add the processing instruction for the XSLT transformation, change the submission links, ...).

Examples :

  • http://localhost/XSLTFormsRoot/trunk/src/testsuite/Xforms1.1/Edition1/driverPages/html/
  • http://localhost/XSLTFormsRoot/trunk/src/testsuite/Xforms1.1/Edition1/Chapt02/2.4.a.xhtml

Feature switching

Feature switching is based on files named *options.xml to be placed in the same folder as main components (xsltforms.*.xml). Options are processing instructions to add in the XML document to permit the XSLT transformation to interpret them.

Example : http://localhost/XSLTFormsRoot/trunk/src/nocssoptions.xml.

Then, /*options has to be put just before /testsuite in the URL to activate the corresponding options.

Example : http://localhost/XSLTFormsRoot/trunk/src/nocssoptions/testsuite/Xforms1.1/Edition1/Chapt02/2.4.a.xhtml

xsltforms's People

Contributors

alaincouthures avatar epost avatar

Watchers

James Cloos avatar  avatar

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.