diff options
author | Hans Hagen <pragma@wxs.nl> | 2007-09-28 11:58:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2007-09-28 11:58:00 +0200 |
commit | 19af23ac5cb927d986a64ac1dc52ed2d7bad2450 (patch) | |
tree | 2c44222c2581e462afc58122ee79aadf8169316b /tex/context/test | |
parent | 104ea1dae3d609aeb395e19658ad6ea7d4c85eea (diff) | |
download | context-19af23ac5cb927d986a64ac1dc52ed2d7bad2450.tar.gz |
stable 2007.09.28 11:58
Diffstat (limited to 'tex/context/test')
-rw-r--r-- | tex/context/test/x-cals-test.cdx | 31 | ||||
-rw-r--r-- | tex/context/test/x-cals-test.tex | 32 | ||||
-rw-r--r-- | tex/context/test/x-cals-test.xml | 78 | ||||
-rw-r--r-- | tex/context/test/x-ct-test.tex | 7 | ||||
-rw-r--r-- | tex/context/test/x-ct-test.xml | 149 |
5 files changed, 289 insertions, 8 deletions
diff --git a/tex/context/test/x-cals-test.cdx b/tex/context/test/x-cals-test.cdx index e87a947ef..ce90883fa 100644 --- a/tex/context/test/x-cals-test.cdx +++ b/tex/context/test/x-cals-test.cdx @@ -1,6 +1,31 @@ -<?xml version="1.0"?> +<?xml version="1.0" standalone="yes"?> <directives> - <directive id="100" setup="xml:directive:noframe"/> - <directive id="101" setup="xml:directive:colors"/> + + <!-- + <directive attribute='id' value="100" setup="cdx:100"/> + <directive attribute='id' value="101" setup="cdx:101"/> + --> + + <!-- + <directive element="cals:table" attribute='cdx' value="colors" setup="cdx:cals:table:colors"/> + <directive element="cals:table" attribute='cdx' value="vertical" setup="cdx:cals:table:vertical"/> + <directive element="cals:table" attribute='cdx' value="noframe" setup="cdx:cals:table:noframe"/> + --> + + <!-- + <directive element="cals:table" attribute='cdx' value="*" setup="cdx:cals:table:*"/> + <directive element="cals:table" attribute='cdx' value="*" before="cdx:cals:table:before:*"/> + <directive element="cals:table" attribute='cdx' value="*" after="cdx:cals:table:after:*"/> + --> + + <directive + element="cals:table" + attribute='cdx' + value="*" + setup="cdx:cals:table:*" + before="cdx:cals:table:before:*" + after="cdx:cals:table:after:*" + /> + </directives> diff --git a/tex/context/test/x-cals-test.tex b/tex/context/test/x-cals-test.tex index dacfc9626..30645c2bd 100644 --- a/tex/context/test/x-cals-test.tex +++ b/tex/context/test/x-cals-test.tex @@ -4,16 +4,44 @@ \setupcolors[state=start] -\startsetups xml:directive:noframe +\startsetups cdx:cals:table:noframe \setupTABLE[frame=off] \stopsetups -\startsetups xml:directive:colors +\startsetups cdx:cals:table:colors \setupTABLE[row] [odd] [frame=off,background=color,backgroundcolor=red] \setupTABLE[row] [even][frame=off,background=color,backgroundcolor=green] \setupTABLE[column][2] [frame=off,background=color,backgroundcolor=blue] \stopsetups +\startsetups cdx:cals:table:vertical + \setupTABLE[row] [odd] [frame=off,background=color,backgroundcolor=lightblue] +\stopsetups + +\startsetups cdx:cals:table:horizontal + \setupTABLE[column] [odd] [frame=off,background=color,backgroundcolor=lightblue] +\stopsetups + +\startsetups cdx:cals:table:before:frame + \framed [offset=overlay,frame=off,topframe=on,bottomframe=on,rulethickness=2pt,framecolor=red,align=normal] \bgroup + \vskip2pt + \framed [offset=overlay,frame=off,leftframe=on,rightframe=on,rulethickness=1pt,framecolor=red,align=normal] \bgroup +\stopsetups + +\startsetups cdx:cals:table:after:frame + \egroup + \vskip2pt + \egroup +\stopsetups + +% \startxmlsetups xml:cals:process +% \xmlsetsetup {\xmldocument} {cals:table} {*} +% \stopxmlsetups +% \startxmlsetups cals:table +% \ctxlua{lxml.cals.table("#1")} +% \stopxmlsetups +% \xmlregistersetup{xml:cals:process} + \starttext \xmlloaddirectives{x-cals-test.cdx} \xmlprocess{main}{x-cals-test.xml}{} diff --git a/tex/context/test/x-cals-test.xml b/tex/context/test/x-cals-test.xml index 55e495c77..a41691acb 100644 --- a/tex/context/test/x-cals-test.xml +++ b/tex/context/test/x-cals-test.xml @@ -7,8 +7,80 @@ <root xmlns:cals="http://www.someplace.org/cals" xmlns:c="http://www.someplace.org/cals"> - <c:table id="100"> - <c:tgroup cols="2"> + <c:table cdx="vertical"> + <c:tgroup cols="3"> + <c:thead> + <c:row> + <c:entry>alpha</c:entry> + <c:entry>beta</c:entry> + <c:entry>gamma</c:entry> + </c:row> + </c:thead> + <c:tbody> + <c:row> + <c:entry>one</c:entry> + <c:entry>two</c:entry> + <c:entry>three</c:entry> + </c:row> + <c:row> + <c:entry>four</c:entry> + <c:entry>five</c:entry> + <c:entry>six</c:entry> + </c:row> + </c:tbody> + </c:tgroup> + </c:table> + + <c:table cdx="horizontal"> + <c:tgroup cols="3"> + <c:thead> + <c:row> + <c:entry>alpha</c:entry> + <c:entry>beta</c:entry> + <c:entry>gamma</c:entry> + </c:row> + </c:thead> + <c:tbody> + <c:row> + <c:entry>one</c:entry> + <c:entry>two</c:entry> + <c:entry>three</c:entry> + </c:row> + <c:row> + <c:entry>four</c:entry> + <c:entry>five</c:entry> + <c:entry>six</c:entry> + </c:row> + </c:tbody> + </c:tgroup> + </c:table> + + <c:table cdx="frame"> + <c:tgroup cols="3"> + <c:thead> + <c:row> + <c:entry>alpha</c:entry> + <c:entry>beta</c:entry> + <c:entry>gamma</c:entry> + </c:row> + </c:thead> + <c:tbody> + <c:row> + <c:entry>one</c:entry> + <c:entry>two</c:entry> + <c:entry>three</c:entry> + </c:row> + <c:row> + <c:entry>four</c:entry> + <c:entry>five</c:entry> + <c:entry>six</c:entry> + </c:row> + </c:tbody> + </c:tgroup> + </c:table> + + <c:table cdx="colors"> + <c:tgroup cols="3"> <c:colspec colnum="1" colwidth="4cm" colname="first"/> <c:colspec colnum="2" colname="second"/> <c:thead> @@ -32,7 +104,7 @@ </c:tgroup> </c:table> - <cals:table id="101"> + <cals:table cdx="noframe"> <cals:tgroup cols="2"> <cals:colspec colnum="1" colwidth="4cm" colname="first"/> <cals:colspec colnum="2" colname="second"/> diff --git a/tex/context/test/x-ct-test.tex b/tex/context/test/x-ct-test.tex new file mode 100644 index 000000000..d47563e84 --- /dev/null +++ b/tex/context/test/x-ct-test.tex @@ -0,0 +1,7 @@ +% engine=luatex + +\usemodule[x][ct] + +\starttext + \xmlprocess{main}{x-ct-test.xml}{} +\stoptext diff --git a/tex/context/test/x-ct-test.xml b/tex/context/test/x-ct-test.xml new file mode 100644 index 000000000..e61abb054 --- /dev/null +++ b/tex/context/test/x-ct-test.xml @@ -0,0 +1,149 @@ +<?xml version='1.0' standalone='yes' ?> + +<root xmlns:ct="http://www.pragma-ade.com/context"> + + one: + + <tabulate xmlns="http://www.pragma-ade.com/context"> + <template> + <column align='flushleft'/> + <column align='flushright'/> + <column align='center'/> + </template> + <body> + <row> + <cell>one</cell> + <cell>two</cell> + <cell>three</cell> + </row> + <row> + <cell>a</cell> + <cell>b</cell> + <cell>c</cell> + </row> + <row> + <cell>alpha</cell> + <cell>beta</cell> + <cell>gamma</cell> + </row> + </body> + </tabulate> + + two: + + <context:tabulate> + <context:template> + <context:column align='flushleft'/> + <context:column align='flushright'/> + <context:column align='center'/> + </context:template> + <context:body> + <context:row> + <context:cell>one</context:cell> + <context:cell>two</context:cell> + <context:cell>three</context:cell> + </context:row> + <context:row> + <context:cell>a</context:cell> + <context:cell>b</context:cell> + <context:cell>c</context:cell> + </context:row> + <context:row> + <context:cell>alpha</context:cell> + <context:cell>beta</context:cell> + <context:cell>gamma</context:cell> + </context:row> + </context:body> + </context:tabulate> + + three: + + <context:tabulate> + <context:body> + <context:row> + <context:cell>one</context:cell> + <context:cell>two</context:cell> + <context:cell>three</context:cell> + </context:row> + <context:row> + <context:cell>a</context:cell> + <context:cell>b</context:cell> + <context:cell>c</context:cell> + </context:row> + <context:row> + <context:cell>alpha</context:cell> + <context:cell>beta</context:cell> + <context:cell>gamma</context:cell> + </context:row> + </context:body> + </context:tabulate> + + four: + + <context:tabulate template="|l|l|l|"> + <context:body> + <context:row> + <context:cell>one</context:cell> + <context:cell>two</context:cell> + <context:cell>three</context:cell> + </context:row> + <context:row> + <context:cell>a</context:cell> + <context:cell>b</context:cell> + <context:cell>c</context:cell> + </context:row> + <context:row> + <context:cell>alpha</context:cell> + <context:cell>beta</context:cell> + <context:cell>gamma</context:cell> + </context:row> + </context:body> + </context:tabulate> + + five: + + <ct:combination nx='3' ny='2'> + <ct:pair> + <ct:content>some content 1</ct:content> + <ct:caption>caption a</ct:caption> + </ct:pair> + <ct:pair> + <ct:content>some content 2</ct:content> + <ct:caption>caption b</ct:caption> + </ct:pair> + <ct:pair> + <ct:content>some content 3</ct:content> + <ct:caption>caption c</ct:caption> + </ct:pair> + <ct:pair> + <ct:content>some content 4</ct:content> + <ct:caption>caption d</ct:caption> + </ct:pair> + <ct:pair> + <ct:content>some content 5</ct:content> + <ct:caption>caption e</ct:caption> + </ct:pair> + <ct:pair> + <ct:content>some content 6</ct:content> + <ct:caption>caption f</ct:caption> + </ct:pair> + </ct:combination> + + six: + + <ct:combination> + <ct:pair> + <ct:content>some content 1</ct:content> + <ct:caption>caption a</ct:caption> + </ct:pair> + <ct:pair> + <ct:content>some content 2</ct:content> + <ct:caption>caption b</ct:caption> + </ct:pair> + <ct:pair> + <ct:content>some content 3</ct:content> + <ct:caption>caption c</ct:caption> + </ct:pair> + </ct:combination> + +</ct:root> |