Giter Site home page Giter Site logo

focheck's Introduction


focheck – Validate XSL-FO and Antenna House extensions in oXygen or standalone

focheck bundles a Relax NG schema and a Schematron grammar in an oXygen framework for detailed validation of XSL-FO – including FOs and properties added in XSL 1.1 – within oXygen XML Editor. focheck also validates the extension FOs and properties that AH Formatter provides for improved formatted output. You can, of course, also use the focheck Relax NG and Schematron outside of oXygen, either together or separately.

The Relax NG handles structural validation and the Schematron handles the additional constraints that cannot be expressed in Relax NG. The Schematron parses property value expressions using an XSLT-based parser generated by the REx parser generator plus an XSLT library for reducing the parse tree to XSL-FO datatypes.

Disclaimer

focheck is a work in progress. It does not (yet) handle every XSL-FO property or every requirement in the XSL-FO spec, nor does it evaluate either functions or relative lengths.

Pull requests and new issues are welcome.

Installing

  • If you just want to use focheck with oXygen, then you can either:
  • Install focheck as an add-on oXygen framework.
  • Download and install a static copy of the oXygen framework.
  • If you want to easily keep up-to-date with changes, then you can clone this repository and 'pull' the latest version whenever you want.
  • If you want to hack on focheck or submit pull requests, then you can fork this repository and clone that onto your local machine.

Installing as add-on oXygen framework

Follow the instructions in the oXygen manual at http://oxygenxml.com/doc/ug-editor/#topics/installing-and-updating-add-ons.html

The focheck update site URL is https://github.com/AntennaHouse/focheck/raw/master/add-on.xml

Note that oXygen will require you to restart the editor after installing the add-on framework.

Installing a ZIP archive to oXygen frameworks directory

  1. Download the ZIP archive from the latest release on the 'Releases' page.
  2. Extract the folder in the ZIP archive to the oXygen frameworks directory.
  • On Windows, this is C:\Program Files\Oxygen XML Editor 16\frameworks, or something similar.
  • If you don't have permission to copy the folder to the frameworks directory, then you can use an alternative location as described below.
  1. Restart oXygen.

Installing a ZIP archive to an alternative frameworks location

If you don't have permission to modify the oXygen installation – for example, if oXygen is installed on Windows under C:\Program Files\ and you are not an Administrator – you can set oXygen to also use an alternative frameworks location.

  1. Click on the "Download ZIP" button on this project's main page to download the files.
  2. Extract the folder in the ZIP archive to a folder where you can create the new folder.
  3. In your oXygen preferences, add the focheck folder as an alternative frameworks location.
  1. Restart oXygen.

Installing a repository clone

  1. Clone the repository into either the oXygen frameworks directory or another directory.
  • focheck incorporates stf as a submodule. There are two ways to also check out stf:
    • Pass --recursive to git clone when you check out focheck
    • If you've already checked out focheck, you can run git submodule init git submodule update
  1. If necessary, add the focheck folder as an alternative frameworks location.
  2. Restart oXygen.

Using focheck

oXygen XML Editor

When you open an XSL-FO document – where the document element is root in the XSL-FO namespace – oXygen will automatically validate the document against both the Relax NG schema and the Schematron grammar.

Ant

Use the build-focheck.xml Ant build file and the validate.single target to validate a file using both Relax NG and Schematron. Alternatively, use the schematron.single or schematron.dir target to run Schematron on one or multiple files.

Standalone

You can use the Relax NG schema in the schema folder and the Schematron files in the schematron folder outside of oXygen and Ant. However:

  • The Relax NG works with Jing and with Emacs nxml-mode but not with xmllint.
  • The Schematron requires an XSLT 2.0 binding and a Schematron implementation that will both match on attributes as contexts as well as import and use external XSLT 2.0 stylesheets.

Building

oXygen XML Editor

  1. Open build.xml in oXygen.
  2. Run the default "ANT" transformation scenario.

Standalone

  1. If the properties in build.properties are not correct for your system, then copy build.properties to build.local.properties in the same directory and set the correct values there.
  • You can delete or comment out any properties in build.local.properties that you don't need to change.
  1. Run Ant.

Other Ant targets

run.parser

Runs the parser on ${input}.

framework.zip

Makes a Zip archive of just the oXygen framework.

License

Copyright 2015 Antenna House, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


focheck – oXygenまたはスタンドアロンでXSL-FOとアンテナハウスの拡張要素とプロパティを検証

focheckはoXygenフレームワークのRelax NGとSchematronのファイルをバンドルし、oXygen XMLエデイター内でXSL-FOの詳細な検証を行うことができます。

  • XSL-FOは、XSL 1.1勧告に基づいたフォーマッティングオブジェクトとプロパティが対象となります。
  • 更にAH Formatterが組版機能の向上のために導入した拡張フォーマッティングオブジェクトとプロパティも検証の対象としています。

もちろん、oXygenとは別個にfocheckのRelax NGとSchematronを使用することも可能です。

Relax NGは、構造的な検証を処理し、加えてSchematronのはRelax NGでは表現できない制約条件を処理します。 SchematronはRExパーサージエネレーターで生成されたXSLTベースのパーサーと、XSL-FOのデータタイプのパースツリーを軽減するために作成されたXSLTライブラリーを使用してXSL-FOのプロパティ値の式をパースします。

免責事項

focheckの開発は進行中です。 まだ全てのXSL-FOプロパティ又はXSL-FO仕様の全ての必要条件を処理できていません。また、関数や相対的な長さを評価できていません。

Pullリクエストや問題がありましたらお知らせください。

インストール方法

  • focheckをoXygenと共に使用する場合は、次のいずれかを行ってください:
  • focheckをOxygenの追加のアドオンフレームワークとしてインストールします。
  • oXygenフレームワークをダウンロードしてコピーをインストールします。
  • 最新の変更を反映させたい場合は、このリポジトリをクローンすれば、いつでも好きな時に最新バージョンを「pull」することができます。
  • focheckを書き換えたりpullリクエストを出したい場合は、このリポジトリをフォークして、あなたのローカルマシンにクローンすることができます。

追加 oXygenフレームワークとしてインストールする。

http://oxygenxml.com/doc/ug-editor/#topics/installing-and-updating-add-ons.html のoXygenのマニュアルの記述に沿って行います。

focheckの最新サイトのURLは https://github.com/AntennaHouse/focheck/raw/master/add-on.xml です。

oXygen は追加フレームワークをインストールした後、エデイターを再起動する必要があります。注意してください。

oXygen 「フレームワークス」デイレクトリのZIPアーカイブをインストールする。

  1. 'Releases'ページにある最新リリースからZIPアーカイブをダウンロードします。
  2. oXygen frameworksデイレクトリにZIPアーカイブにあるフォルダーを解凍します。
  • Windows では、これは C:\Program Files\Oxygen XML Editor 16\frameworks, などOXygenのインストールフォルダの直下です。
  • frameworksデイレクトリにフォルダをコピーする権限がない場合は、以下に説明するように、別の場所を使用することができます。
  1. oXygen再起動します。

別のフレームワークの場所にZIPアーカイブをインストールする。

例えば、oXygenはC:\Program Files\でWindowsにインストールされており、管理者でないためにoXygenのインストールを変更する権限を持っていない場合は、別のフレームワークの場所を使用することができるようにoXygen を設定することができます。

  1. このプロジェクトのメインページの"Download ZIP"をクリックしてダウンロードします。
  2. 新しいフォルダを生成することができるフォルダにZIPアーカイブ内のフォルダを解凍します。
  3. oXygen の環境設定で、別のフレームワークの場所として解凍したfocheckフォルダを追加します。
  1. oXygenを再起動します。

リポジトリクローンをインストールする。

  1. oXygenのframeworksデイレクトリ又は別のデイレクトリにリポジトリをクローンします。
  • focheck はサブモジュールとして**stf** を使用しています。stfをチェックアウトするには、2つの方法があります:
    • focheckをチェックアウトするとき、git clone--recursiveを指定します。
    • 既にfocheckをチェックアウトしていた場合、次を実行します。 git submodule init git submodule update
  1. 必要ならば、別のフレームワークスの場所としてクローンしたfocheckフォルダを追加します。
  2. oXygenを再起動します。

focheckを使用する。

oXygen XMLエディターでの使用

最上位要素がXSL-FOの名前空間でrootであるXSL-FO文書を開くと、oXygenは自動的にRelax NGスキーマとSchematronの両方で文書を検証します。

Antでの使用

Antのビルドファイルのbuild-focheck.xmlとターゲットのvalidate.singleを使用すれば、Relax NGとSchematronの両方で検証ができます。 またターゲットのschematron.singleもしくはschematron.dirを使用すれば、単独のファイルや複数ファイルを対象にSchematronを実行することができます。

スタンドアロンでの使用

Oxygenやantを使用せずに、schemaフォルダ内のRelax NGのスキーマやschematronフォルダのファイルを使用することができます。 しかし:

  • Relax NGはJingとEmacs nxml-modeにで動作します。xmllint では動作しません。
  • Schematronは XSLT 2.0プロセッサとSchematronのインプリメンテーションが必要です。 それらは、コンテキストとして属性にマッチでき、外部のXSLT 2.0 スタイルシートをインポートできることができなければなりません。

ビルド方法

oXygen XML エデイター

  1. oXygenでbuild.xmlを開きます。
  2. デフォルトの"ANT"変換のシナリオを実行します。

スタンドアロン

  1. build.propertiesプロパティーが使用するシステムに合わない場合は、同じデイレクトリでbuild.propertiesbuild.local.propertiesに コピーします。
  • build.local.propertiesにあるいずれのプロパティーも変更する必要はない場合、削除するか、コメントアウトもできます。
  1. Antを実行します。

その他の Ant ターゲット

run.parser

${input}でパーサーを実行します。

framework.zip

oXygenフレームワークのZipアーカイブを生成します。

ライセンス

Copyright 2015 Antenna House, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

focheck's People

Contributors

tgraham-antenna avatar raducoravu avatar tkg avatar toshihikomakita 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.