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.
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.
- 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.
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.
- Download the ZIP archive from the latest release on the 'Releases' page.
- 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.
- Restart oXygen.
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.
- Click on the "Download ZIP" button on this project's main page to download the files.
- Extract the folder in the ZIP archive to a folder where you can create the new folder.
- In your oXygen preferences, add the focheck folder as an alternative frameworks location.
- Restart oXygen.
- 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
togit clone
when you check out focheck - If you've already checked out focheck, you can run
git submodule init
git submodule update
- Pass
- If necessary, add the focheck folder as an alternative frameworks location.
- Restart oXygen.
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.
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.
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 withxmllint
. - 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.
- Open
build.xml
in oXygen. - Run the default "ANT" transformation scenario.
- If the properties in
build.properties
are not correct for your system, then copybuild.properties
tobuild.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.
- Run Ant.
Runs the parser on ${input}
.
Makes a Zip archive of just the oXygen framework.
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フレームワークの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リクエストを出したい場合は、このリポジトリをフォークして、あなたのローカルマシンにクローンすることができます。
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 は追加フレームワークをインストールした後、エデイターを再起動する必要があります。注意してください。
- 'Releases'ページにある最新リリースからZIPアーカイブをダウンロードします。
- oXygen
frameworks
デイレクトリにZIPアーカイブにあるフォルダーを解凍します。
- Windows では、これは
C:\Program Files\Oxygen XML Editor 16\frameworks
, などOXygenのインストールフォルダの直下です。 frameworks
デイレクトリにフォルダをコピーする権限がない場合は、以下に説明するように、別の場所を使用することができます。
- oXygen再起動します。
例えば、oXygenはC:\Program Files\
でWindowsにインストールされており、管理者でないためにoXygenのインストールを変更する権限を持っていない場合は、別のフレームワークの場所を使用することができるようにoXygen を設定することができます。
- このプロジェクトのメインページの"Download ZIP"をクリックしてダウンロードします。
- 新しいフォルダを生成することができるフォルダにZIPアーカイブ内のフォルダを解凍します。
- oXygen の環境設定で、別のフレームワークの場所として解凍したfocheckフォルダを追加します。
- oXygenを再起動します。
- oXygenのframeworksデイレクトリ又は別のデイレクトリにリポジトリをクローンします。
- focheck はサブモジュールとして**stf** を使用しています。stfをチェックアウトするには、2つの方法があります:
- focheckをチェックアウトするとき、
git clone
に--recursive
を指定します。 - 既にfocheckをチェックアウトしていた場合、次を実行します。
git submodule init
git submodule update
- focheckをチェックアウトするとき、
- 必要ならば、別のフレームワークスの場所としてクローンしたfocheckフォルダを追加します。
- oXygenを再起動します。
最上位要素がXSL-FOの名前空間でroot
であるXSL-FO文書を開くと、oXygenは自動的にRelax NGスキーマとSchematronの両方で文書を検証します。
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で
build.xml
を開きます。 - デフォルトの"ANT"変換のシナリオを実行します。
build.properties
プロパティーが使用するシステムに合わない場合は、同じデイレクトリでbuild.properties
をbuild.local.properties
に コピーします。
build.local.properties
にあるいずれのプロパティーも変更する必要はない場合、削除するか、コメントアウトもできます。
- Antを実行します。
${input}
でパーサーを実行します。
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.