AXC: ASTAR CIF XML Convert (0.5.5)
Usage: axc command [option]... [file]...
Available commands:
ciftoxml convert CIF to XML.
xmltocif convert XML to CIF.
xslt XSLT process.
help print help.
Available options:
-o OUTPUT, --output=OUTPUT
the output file.
-d OUTDIR, --output-dir=OUTDIR
the output directory.
-e MAXERROR, --max-error=MAXERROR
the maximum errors before the process aborted.
-p, --split split the input into files, each one for a data block.
-m, --merge merge all the input into one output file.
-x XMLSPEC, --xml-spec=XMLSPEC
the XML output specification, [LDL|LDS|LDT].
-l XSLLINK, --xsl-link=XSLLINK
write XSL stylesheet link on the XML output.
AStarXmlConvert XSLT Extension Functions:
string axc:StripSu(string measurand) Strips the associated su of a measurand.
string axc:RetrieveSu(string measurand) Retrieve the associated su of a measurand.
string axc:AttachSu(string val, string su) Associates the su to a measurand value.
string axc:CifMarkupToHtml(string text) Converts the CIF markup to HTML.
axc ciftoxml -o output/bt5053.xml ../data/bt5053.cif
Converts the CIF file 'bt5053.cif' to an XML file 'bt5053.xml'.
axc xmltocif -o output/bt5053.cif output/bt5053.xml
Converts the XML file 'bt5053.xml' back to a CIF file 'bt5053.cif'.
axc xslt -l ../data/xml/jldl.xsl -o output/bt5053.htm output/bt5053.xml
Does XSLT on the output XML file 'bt5053.xml' using the XSL stylesheet 'jldl.xsl', generates an HTML file 'bt5053.htm'.
ATrans: ASTAR Template Based CIF Transform (0.5.5)
Usage: atrans [option]... [file]...
If no file or '-' is specified, read stdin.
Available options:
-t TEMPLATE, --template=TEMPLATE
the template file, '-' for stdin.
-p PREFIX, --prefix=PREFIX
the tag prefix in the template file,
default to '_tdl',
use '@' for no prefix.
-o OUTPUT, --output=OUTPUT
the output file, '-' for stdout.
-d OUTDIR, --output-dir=OUTDIR
the output directory.
-x OUTEXT, --output-ext=OUTEXT
the output file extension.
-h, --help print this help.
--version print version information.
atrans -t ../data/tdl/report.htm.cif -o output/fa3203.htm ../data/fa3203.cif
Converts the CIF file 'fa3203.cif' to an HTML file 'fa3203.htm', using the template file 'report.htm.cif'.
atrans -t ../data/tdl/report.tex.cif -o output/fa3203.tex ../data/fa3203.cif
Converts the CIF file 'fa3203.cif' to a LaTeX file 'fa3203.tex', using the template file 'report.tex.cif'.
atrans -t ../data/tdl/report.rtf.cif -o output/fa3203.rtf ../data/fa3203.cif
Converts the CIF file 'fa3203.cif' to an RTF file 'fa3203.rtf', using the template file 'report.rtf.cif'.
atrans -t ../data/tdl/report.txt.cif -o output/fa3203.txt ../data/fa3203.cif
Converts the CIF file 'fa3203.cif' to a plain text file 'fa3203.txt', using the template file 'report.txt.cif'.
atrans -t ../data/tdl/dic_ddl1.htm.cif -o output/cif_core.htm ../dic/cif_core.dic
Converts the DDL1 file 'cif_core.dic' to an HTML file 'cif_core.htm', using the template file 'dic_ddl1.htm.cif'.
atrans -t ../data/tdl/dic_ddl2.htm.cif -o output/cif_mm.htm ../dic/cif_mm.dic
Converts the DDL2 file 'cif_mm.dic' to an HTML file 'cif_mm.htm', using the template file 'dic_ddl2.htm.cif'.
AStarTransform Templates (TDL) Syntax:
The templates are CIF files written in TDL (Template/Transform Defining Language).
Here is a brief example:
################################
# Sample TDL (Experimental) #
# CIF to plain text #
################################
data_pack
_tdl_context_type PACK
# The root template for the CIF file (PACK) to be transformed.
loop_ # Defines variables here.
_tdl_var_name
# The variable name.
_tdl_var_value
# And the value, evaluated in the current context.
# Accessible in current context and it's sub-contexts.
'LOGO' '-A-STAR-'
loop_ # Selects the items and templates.
_tdl_item_type
# The type of the item to be selected,
# '.' for the current context.
_tdl_item_select
# The select expression,
# '*' for each item, or the name of the item to be selected.
_tdl_item_apply
# The template text or the name of the template to be applied on the selected item,
# depends on the item type.
. .
;
STRUCTURE REPORT
****************
;
BLOCK * block # Selects each block and applies the template.
data_block # The template for a data block.
_tdl_context_type BLOCK # The context type.
loop_ # Tests for the template, apply, abort or choose another template.
_tdl_test_item_type
_tdl_test_item_select
_tdl_test_eval_left
_tdl_test_eval_right
_tdl_test_action_success
_tdl_test_action_failure
P '_chemical_formula_sum' . . :continue :exit
loop_
_tdl_item_type
_tdl_item_select
_tdl_item_apply
P '_chemical_name_systematic' # Selects the primitive field in the current context.
;
$value
****************
;
. . # Selects the current context (a data block here).
;
Structure
----------------
Formula: $_chemical_formula_sum
Mr = $_chemical_formula_weight
Cell: $_symmetry_cell_setting ${_symmetry_space_group_name_H-M}
a = ${(pad _cell_length_a -19)} alpha = $_cell_angle_alpha
b = ${(pad _cell_length_b -19)} beta = $_cell_angle_beta
c = ${(pad _cell_length_c -19)} gamma = $_cell_angle_gamma
V = ${(pad _cell_volume -19)} Z = $_cell_formula_units_Z
Radiation: $_diffrn_radiation_type
mu = $_exptl_absorpt_coefficient_mu
...
Geometry
----------------
;
LOOP '_atom_site_label' tbl_atom # Selects the loop and applies the template.
data_tbl_atom # The template 'tbl_atom'.
_tdl_context_type LOOP # The context type.
loop_
_tdl_item_type
_tdl_item_select
_tdl_item_apply
. .
;
TABLE [Atoms]
----------------
[NO.] [atom] [ x ] [ y ] [ z ] [Uiso / Ueq ] [ADP type] ...
----------------
;
ROW * row_atom # Selects each row.
. .
;
----------------
;
data_row_atom # The template 'row_atom'.
_tdl_context_type LOOPROW # The context type.
loop_
_tdl_item_type
_tdl_item_select
_tdl_item_apply
. . '${(pad i1 -5)}'
FIELD '_atom_site_label' ' ${(pad value -6)}'
FIELD '_atom_site_fract_x' ' ${(pad value -13)}'
FIELD '_atom_site_fract_y' ' ${(pad value -13)}'
FIELD '_atom_site_fract_z' ' ${(pad value -13)}'
FIELD '_atom_site_U_iso_or_equiv' ' ${(pad value -13)}'
FIELD '_atom_site_adp_type' ' $value'
# ...
. . '$nl'
TDL Tags:
_tdl_context_type The context (this item) type.
PACK (K) / BLOCK (D) / FRAME (S) / LOOP (L) / LOOPROW (R)
_tdl_item_type The child item type.
BLOCK (D) / FRAME (S) / FIELD (F) / PRIMITIVE (P) / LOOP (L) / LOOPROW (R) / .
_tdl_item_select The select expression.
item name / * / .
_tdl_item_apply The template text or the name of the template.
Evaluating Template Text:
[$][a-zA-Z][a-zA-Z_0-9]* Variables. ($foo, $FOO_A, ...)
Magic variables:
$name The name of the context, BLOCK / FRAME / PRIMITIVE / FIELD.
$value The value of the context, PRIMITIVE / FIELD.
$i, $i0, $i1 Item index for the '*' selection, 0-based and 1-based.
$nl A platform-specific newline.
[$][_][a-zA-Z_0-9]+ CIF Tag style variables. ($_foo_bar, ...)
For retrieving the value of a primitive field in the blocks / frames or a field of the loop rows.
[$][$] A literal '$' char. ($$)
[$][<][0-9a-fA-F]+[>] Hexadecimal escaped char sequence. ($<2324> for #$)
[$][{][^}]+[}] A complex expression.
(${_foo-bar/foo}, ${(foo (bar a b) c)}, ...)
In complex expressions:
[a-zA-Z][a-zA-Z_0-9]* (var) Variables.
[_][\x21-\x7e]+ (tag) Tag style variables.
[(][a-zA-Z][a-zA-Z_0-9]* (fstart) Function call start.
[)] (fend) Function call end.
["][^"]*["] (val) String literal, $$ and $<> escaping is supported.
['][^']*['] (val) String literal, $$ and $<> escaping is supported.
[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)([(][0-9]+[)])?([EeDd][+-]?[0-9]+)?
(val) Number literal.
A LISP style function call:
fcall <- fstart {arg | fcall} fend;
arg <- var | tag | str | num;
[e.g.] (function1 arg1 arg2 (function2 arg3))
AStarTransform TDL Functions:
(strip_su measurand) Strips the associated su of a measurand.
(retrieve_su measurand) Retrieve the associated su of a measurand.
(attach_su val su) Associates the su to a measurand value.
(pad text width [char]) Pads the text to the specified width,
using char (optional, default to the space char).
(html_escape string text) Escapes the text for HTML.
(cif_markup_to_html text [level]) Converts the CIF markup to HTML,
level (optional, 0, 1, 2, default to 1).
0, no escaping on the HTML special chars ('<', '>' and '&');
1, escaping the special chars, except the <i></i>, <b></b> tags;
2, escaping all special chars.
(latex_escape text) Escapes the text for LaTeX.
(cif_markup_to_latex text) Converts the CIF markup to LaTeX.
