ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* cals tables
@ 2011-03-07 11:26 R. Ermers
  2011-03-07 11:41 ` Hans Hagen
  0 siblings, 1 reply; 12+ messages in thread
From: R. Ermers @ 2011-03-07 11:26 UTC (permalink / raw)
  To: Mailing list for ConTeXt users

Dear All,

I am struggling with the processing of cals tables in mkiv. I used the module x-cals, in different styles ([x][cals], etc.) but there is no effect, the table is not typeset.

\usemodule x-cals.mkiv
\xmlloaddirectives x-cals-test.cdx

By way of experiment I also used the directives, but no avail either.

Should I write an xmlsetup for each element, e.g.

\xmlsetsetup{#1}{//thead}{xml:thead}
\xmlsetsetup{#1}{//entry}{xml:entry}

Can anyone help me out?

Thanks in advance.

Robert

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cals tables
  2011-03-07 11:26 cals tables R. Ermers
@ 2011-03-07 11:41 ` Hans Hagen
  2011-03-07 12:41   ` R. Ermers
  2011-03-08 20:00   ` R. Ermers
  0 siblings, 2 replies; 12+ messages in thread
From: Hans Hagen @ 2011-03-07 11:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: R. Ermers

On 7-3-2011 12:26, R. Ermers wrote:
> Dear All,
>
> I am struggling with the processing of cals tables in mkiv. I used the module x-cals, in different styles ([x][cals], etc.) but there is no effect, the table is not typeset.
>
> \usemodule x-cals.mkiv

funny syntax

\usemodule[cals]

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cals tables
  2011-03-07 11:41 ` Hans Hagen
@ 2011-03-07 12:41   ` R. Ermers
  2011-03-07 21:10     ` R. Ermers
  2011-03-08 20:00   ` R. Ermers
  1 sibling, 1 reply; 12+ messages in thread
From: R. Ermers @ 2011-03-07 12:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thanks, Hans. But yes, I tried that too (and again) before I tried x-cals ([x][cals], x-cals, x-cals.mkiv, etc.). But \usemodule[cals] does not work - the table is not typeset that is.

luatex: beta-065.0-2010121316.

Robert

Op 7 mrt 2011, om 12:41 heeft Hans Hagen het volgende geschreven:

> On 7-3-2011 12:26, R. Ermers wrote:
>> Dear All,
>> 
>> I am struggling with the processing of cals tables in mkiv. I used the module x-cals, in different styles ([x][cals], etc.) but there is no effect, the table is not typeset.
>> 
>> \usemodule x-cals.mkiv
> 
> funny syntax
> 
> \usemodule[cals]
> 
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                             | www.pragma-pod.nl
> -----------------------------------------------------------------
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cals tables
  2011-03-07 12:41   ` R. Ermers
@ 2011-03-07 21:10     ` R. Ermers
  0 siblings, 0 replies; 12+ messages in thread
From: R. Ermers @ 2011-03-07 21:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear all,

I see in the log file that the cals module is loaded.

system          : module cals loaded
(/prog2/context/tex/texmf-local/tex/context/base/x-cals.mkiv
loading         : ConTeXt XML Macros / Cals Tables
<+ /prog2/context/tex/texmf-local/tex/context/base/x-cals.lua>) 

But the table is not typeset, which I had expected.

I do not know what I need to do now.

Do I need to map all elements to those of a Context table? (\bTABLE ...)?
(such as in: http://www.mail-archive.com/ntg-context@ntg.nl/msg50536.html)

Any advice is welcome.

Regards,

Robert


Op 7 mrt 2011, om 13:41 heeft R. Ermers het volgende geschreven:

> Thanks, Hans. But yes, I tried that too (and again) before I tried x-cals ([x][cals], x-cals, x-cals.mkiv, etc.). But \usemodule[cals] does not work - the table is not typeset that is.
> 
> luatex: beta-065.0-2010121316.
> 
> Robert
> 
> Op 7 mrt 2011, om 12:41 heeft Hans Hagen het volgende geschreven:
> 
>> On 7-3-2011 12:26, R. Ermers wrote:
>>> Dear All,
>>> 
>>> I am struggling with the processing of cals tables in mkiv. I used the module x-cals, in different styles ([x][cals], etc.) but there is no effect, the table is not typeset.
>>> 
>>> \usemodule x-cals.mkiv
>> 
>> funny syntax
>> 
>> \usemodule[cals]
>> 
>> -----------------------------------------------------------------
>>                                         Hans Hagen | PRAGMA ADE
>>             Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>>   tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>>                                            | www.pragma-pod.nl
>> -----------------------------------------------------------------
>> ___________________________________________________________________________________
>> If your question is of interest to others as well, please add an entry to the Wiki!
>> 
>> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
>> archive  : http://foundry.supelec.fr/projects/contextrev/
>> wiki     : http://contextgarden.net
>> ___________________________________________________________________________________
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cals tables
  2011-03-07 11:41 ` Hans Hagen
  2011-03-07 12:41   ` R. Ermers
@ 2011-03-08 20:00   ` R. Ermers
  2011-03-09 13:30     ` Hans Hagen
  1 sibling, 1 reply; 12+ messages in thread
From: R. Ermers @ 2011-03-08 20:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear ConTeXers,

I still have not been able to find out how to proceed with my docbook xml document, which contains a number of cals tables.
The cals module is loaded by means of \usemodule[cals].

How to proceed from here?

Any clue is appreciated!

Regards,

Robert




> On 7-3-2011 12:26, R. Ermers wrote:
>> Dear All,
>> 
>> I am struggling with the processing of cals tables in mkiv. I used the module x-cals, in different styles ([x][cals], etc.) but there is no effect, the table is not typeset.
>> 
>> \usemodule x-cals.mkiv
> 
> funny syntax
> 
> \usemodule[cals]
> 
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                             | www.pragma-pod.nl
> -----------------------------------------------------------------

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cals tables
  2011-03-08 20:00   ` R. Ermers
@ 2011-03-09 13:30     ` Hans Hagen
  2011-03-11  8:35       ` R. Ermers
  0 siblings, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2011-03-09 13:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: R. Ermers

On 8-3-2011 9:00, R. Ermers wrote:
> Dear ConTeXers,
>
> I still have not been able to find out how to proceed with my docbook xml document, which contains a number of cals tables.
> The cals module is loaded by means of \usemodule[cals].
>
> How to proceed from here?
>
> Any clue is appreciated!

x-cals-test.*

in the test suite

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cals tables
  2011-03-09 13:30     ` Hans Hagen
@ 2011-03-11  8:35       ` R. Ermers
  2011-03-12 11:46         ` R. Ermers
  0 siblings, 1 reply; 12+ messages in thread
From: R. Ermers @ 2011-03-11  8:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3723 bytes --]

Dear contexers,

I get the impression that cals tables need to be processed separately from the main docbook file.
Instead of <table> and <tbody>, etc. the tags are changed into <cals:table>, <cals:tbody>, etc.

I first tried to process the file x-cals-test.tex pointed to by Hans.

This file loads two other files
\starttext
\xmlloaddirectives{x-cals-test.cdx}
\xmlprocess{main}{x-cals-test.xml}{}
\stoptext

However, the file x-cals-test.xml is not valid.

Therefore I took one of the simple cals tables from within that file, making sure it contains one of the cdx attributes (cdx="vertical") and saved it in x-cals-test2.xml. My xml software says that the file is valid, and it opens normally.

The file are processed now, but the table is not typeset.
Instead there is an error message printed in the pdf file: invalid xml file - parsed text.

The log file says: lxml            : no directives found in 'x-cals-test.cdx' (more log information further)

It seems that the directives are not processed.




Regards,

Robert




systems         : begin file cals-test.tex at line 50
lxml            : no directives found in 'x-cals-test.cdx'
systems         : end file cals-test.tex at line 53
 )
mkiv lua stats : used config file          - /prog2/context/tex/texmf/web2c/texmfcnf.lua
mkiv lua stats : used cache path           - /prog2/context/tex/texmf-cache/luatex-cache/context/b37116f3b39a5afbaa249111be7bfbba
mkiv lua stats : input load time           - 0.008 seconds
mkiv lua stats : stored bytecode data      - 261 modules, 56 tables, 317 chunks
mkiv lua stats : loaded tex modules        - 1 requested, 1 found (*-cals), 0 missing
mkiv lua stats : cleaned up reserved nodes - 30 nodes, 9 lists of 411
mkiv lua stats : node memory usage         - 18 glue_spec
mkiv lua stats : node list callback tasks  - 6 unique task lists, 1 instances (re)created, 397 calls
mkiv lua stats : used backend              - pdf (backend for directly generating pdf output)
mkiv lua stats : result saved in file      - cals-test.pdf
mkiv lua stats : fonts load time           - 0.197 seconds 
mkiv lua stats : luatex banner             - this is luatex, version beta-0.65.0-2010121316
mkiv lua stats : control sequences         - 29719 of 165536
mkiv lua stats : current memory usage      - 41 MB (ctx: 42 MB)




Op 9 mrt 2011, om 14:30 heeft Hans Hagen het volgende geschreven:

> On 8-3-2011 9:00, R. Ermers wrote:
>> Dear ConTeXers,
>> 
>> I still have not been able to find out how to proceed with my docbook xml document, which contains a number of cals tables.
>> The cals module is loaded by means of \usemodule[cals].
>> 
>> How to proceed from here?
>> 
>> Any clue is appreciated!
> 
> x-cals-test.*
> 
> in the test suite
> 
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                             | www.pragma-pod.nl
> -----------------------------------------------------------------
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________


[-- Attachment #1.2.1: Type: text/html, Size: 2051 bytes --]

[-- Attachment #1.2.2: x-cals-test2.xml --]
[-- Type: application/xml, Size: 859 bytes --]

[-- Attachment #1.2.3: Type: text/html, Size: 4802 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cals tables
  2011-03-11  8:35       ` R. Ermers
@ 2011-03-12 11:46         ` R. Ermers
  2011-03-17 10:33           ` cals tables - UNSOLVED R. Ermers
  0 siblings, 1 reply; 12+ messages in thread
From: R. Ermers @ 2011-03-12 11:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 6366 bytes --]

Dear all,

First the good news: I have succeeded in typesetting a table!

I first changed all tag names from <table, <entry, <row to <cals:table, <cals:entry, <cals:row, etc. Then the table is read in.

However, the table setup cannot be manipulated by means of the directives, because - according to the log file - the directives inside the cdx-file are not found (lxml: no directives found in 'x-cals-test.cdx').

Without the directives, the cals table are typeset according to a rough standard (framed). I typeset them in a separate document (pdf), which I insert as a pdf graphic (mediaobject) file in my main document. This works to some extent for short tables, but not for tables that cover more than one page. This procedure is also cumbersome, for some font specifications etc. have to be transferred to the tex file, and if you change one file, you have to change the other as wel. I am now thinking to typeset them with latex instead.

Since one of the main problems seems to be that the cdx file is loaded, but that the directives are not found, I tried to solve this problem by putting the directives in my docbook xml file, but that did not work either. (I also tried a number of other things.)

Can anyone give me a straight minimal example of what to write in my environment file or in my docbook file in order to typeset a text that contains the adapted cals tables? Which xmlsetsetup do I need?

I have read Hans' brief explanation of the directives (http://www.ntg.nl/maps/37/06.pdf), but well, I am not a programmer, I need a more straightforward example in order to understand the logics.

Or is it too early for these wishes? Perhaps should we accept that, in spite of everything, for the time being docbook files that contain cals tables simply cannot be typeset with ConTeXt?

Regards,

Robert

P.S. I use a minimal installation on Mac OS X 10.6.


Op 11 mrt 2011, om 09:35 heeft R. Ermers het volgende geschreven:

> Dear contexers,
> 
> I get the impression that cals tables need to be processed separately from the main docbook file.
> Instead of <table> and <tbody>, etc. the tags are changed into <cals:table>, <cals:tbody>, etc.
> 
> I first tried to process the file x-cals-test.tex pointed to by Hans.
> 
> This file loads two other files
> \starttext
> \xmlloaddirectives{x-cals-test.cdx}
> \xmlprocess{main}{x-cals-test.xml}{}
> \stoptext
> 
> However, the file x-cals-test.xml is not valid.
> 
> Therefore I took one of the simple cals tables from within that file, making sure it contains one of the cdx attributes (cdx="vertical") and saved it in x-cals-test2.xml. My xml software says that the file is valid, and it opens normally.
> 
> The file are processed now, but the table is not typeset.
> Instead there is an error message printed in the pdf file: invalid xml file - parsed text.
> 
> The log file says: lxml            : no directives found in 'x-cals-test.cdx' (more log information further)
> 
> It seems that the directives are not processed.
> 
> <x-cals-test2.xml>
> 
> 
> Regards,
> 
> Robert
> 
> 
> 
> 
> systems         : begin file cals-test.tex at line 50
> lxml            : no directives found in 'x-cals-test.cdx'
> systems         : end file cals-test.tex at line 53
>  )
> mkiv lua stats : used config file          - /prog2/context/tex/texmf/web2c/texmfcnf.lua
> mkiv lua stats : used cache path           - /prog2/context/tex/texmf-cache/luatex-cache/context/b37116f3b39a5afbaa249111be7bfbba
> mkiv lua stats : input load time           - 0.008 seconds
> mkiv lua stats : stored bytecode data      - 261 modules, 56 tables, 317 chunks
> mkiv lua stats : loaded tex modules        - 1 requested, 1 found (*-cals), 0 missing
> mkiv lua stats : cleaned up reserved nodes - 30 nodes, 9 lists of 411
> mkiv lua stats : node memory usage         - 18 glue_spec
> mkiv lua stats : node list callback tasks  - 6 unique task lists, 1 instances (re)created, 397 calls
> mkiv lua stats : used backend              - pdf (backend for directly generating pdf output)
> mkiv lua stats : result saved in file      - cals-test.pdf
> mkiv lua stats : fonts load time           - 0.197 seconds 
> mkiv lua stats : luatex banner             - this is luatex, version beta-0.65.0-2010121316
> mkiv lua stats : control sequences         - 29719 of 165536
> mkiv lua stats : current memory usage      - 41 MB (ctx: 42 MB)
> 
> 
> 
> 
> Op 9 mrt 2011, om 14:30 heeft Hans Hagen het volgende geschreven:
> 
>> On 8-3-2011 9:00, R. Ermers wrote:
>>> Dear ConTeXers,
>>> 
>>> I still have not been able to find out how to proceed with my docbook xml document, which contains a number of cals tables.
>>> The cals module is loaded by means of \usemodule[cals].
>>> 
>>> How to proceed from here?
>>> 
>>> Any clue is appreciated!
>> 
>> x-cals-test.*
>> 
>> in the test suite
>> 
>> -----------------------------------------------------------------
>>                                          Hans Hagen | PRAGMA ADE
>>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>>    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>>                                             | www.pragma-pod.nl
>> -----------------------------------------------------------------
>> ___________________________________________________________________________________
>> If your question is of interest to others as well, please add an entry to the Wiki!
>> 
>> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
>> archive  : http://foundry.supelec.fr/projects/contextrev/
>> wiki     : http://contextgarden.net
>> ___________________________________________________________________________________
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 10239 bytes --]

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cals tables - UNSOLVED
  2011-03-12 11:46         ` R. Ermers
@ 2011-03-17 10:33           ` R. Ermers
  2011-03-18  4:08             ` Aditya Mahajan
  0 siblings, 1 reply; 12+ messages in thread
From: R. Ermers @ 2011-03-17 10:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear All,

I am still trying to typeset cals tables. 

I have
1. an environment document with instructions.
2. an xml docbook file containing cals tables

Note that the original cals tables (docbook standard) use <table, <tgroup, etc. but for ConTeXt purposes this  - as far as I understand - needs to be: <cals:table, <cals:tgroup, etc. (My xml reader does not recognize them anymore.)

Among the many things I tried is putting the table in a separate xml file, and then import it:

\starttext
\xmlprocess{main}{\xmlatt{#1}{fileref}}{}
\stoptext

This works, so yes, it is possible to produce a standard table on a pdf page. This pd file can be imported as an image (which of course is of no help when the table is longer than one page).

But the directives - the ones prepared by Hans - have no influence on the tables at all. According to the log file the cdx file file is loaded, but the directives are not recognized:

lxml : no directives found in 'x-cals-test.cdx'

To solve this, I tried rephrasing the directives as context instructions:

<directive attribute='cdx' value="colors" element="cals:table" setup="cdx:cals:table:colors"/>

\xmlcontextdirective {cdx} {colors} {cals:table} {cdx:cals:table:colors}

But there is no effect, and I don't know whether I did this right. However, loading the separate xml file and processing the table remain the main problem. When the process instruction is part of a setup in an environment file, such as:

\startxmlsetups xml:mediaobject:imageobject:imagedata:tabel
\xmlloaddirectives{x-cals-test.cdx}%
\xmlprocess{main}{\xmlatt{#1}{fileref}}{}
\stopxmlsetups

The table is not typeset and the entire file is broken off at this point (the table xml file is valid of course). 
So the table is probably read in, but then something happens. Without the table, the file is typeset normally.

I already read and reread all information in the manuals on this subject, and all archived email correspondence.

Can anyone explain me in more than one line how to set up an environmental file? Or show me a working minimal example?

Thanks in advance!

Regards,

Robert






___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cals tables - UNSOLVED
  2011-03-17 10:33           ` cals tables - UNSOLVED R. Ermers
@ 2011-03-18  4:08             ` Aditya Mahajan
  2011-03-18  7:47               ` R. Ermers
  0 siblings, 1 reply; 12+ messages in thread
From: Aditya Mahajan @ 2011-03-18  4:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 17 Mar 2011, R. Ermers wrote:

> Dear All,
>
> I am still trying to typeset cals tables.
>
> I have
> 1. an environment document with instructions.
> 2. an xml docbook file containing cals tables
>
> Note that the original cals tables (docbook standard) use <table, <tgroup, etc. but for ConTeXt purposes this  - as far as I understand - needs to be: <cals:table, <cals:tgroup, etc. (My xml reader does not recognize them anymore.)


There is a bug in lxml-dir.lua. Open lxml-dir.lua and change

local collection = xml.applylpath({ getid(xml.load(filename)) },"directive") -- is { } needed ?

to

local collection = xml.applylpath(getid(xml.load(filename)),"directive") 
-- AM: removed { }

[@Hans: I do not checked if this affects other uses of 
directives.load(...).]

Then run c --make to regenerate formats. After that create three files:

%% directives.xml
<?xml version="1.0" standalone="yes"?>
<directives>
   <directive attribute="cdx" value="color" element="cals:table"
              setup="cdx:cals:table:colors"/>
</directives>


%% table.xml
<?xml version="1.0" standalone="yes"?>

<cals:table cdx="color">
   <cals:tgroup cols="3">
     <cals:thead>
       <cals:row>
         <cals:entry>alpha</cals:entry>
         <cals:entry>beta</cals:entry>
         <cals:entry>gamma</cals:entry>
       </cals:row>
     </cals:thead>
     <cals:tbody>
       <cals:row>
         <cals:entry>one</cals:entry>
         <cals:entry>two</cals:entry>
         <cals:entry>three</cals:entry>
       </cals:row>
       <cals:row>
         <cals:entry>four</cals:entry>
         <cals:entry>five</cals:entry>
         <cals:entry>six</cals:entry>
       </cals:row>
     </cals:tbody>
   </cals:tgroup>
</cals:table>


%% test.tex
\usemodule[cals]

\startsetups cdx:cals:table:colors
   \setupTABLE[each][each][background=color,backgroundcolor=red]
\stopsetups

\starttext
\xmlloaddirectives{directives.xml}
\xmlprocess{xml:cals:process}{table.xml}{}
\stoptext


Then compile test.tex to get a table with a red background.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cals tables - UNSOLVED
  2011-03-18  4:08             ` Aditya Mahajan
@ 2011-03-18  7:47               ` R. Ermers
  2011-03-19  8:10                 ` R. Ermers
  0 siblings, 1 reply; 12+ messages in thread
From: R. Ermers @ 2011-03-18  7:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear Aditya,

thanks greatly for your advice! It works! I now can influence how my tables look like.

Do you think it is possible to typeset an xml file that contains <cals:table, or do I need to typeset the tables separately and then import the separate pdf files?

Thanks again,

Robert



Op 18 mrt 2011, om 05:08 heeft Aditya Mahajan het volgende geschreven:

> On Thu, 17 Mar 2011, R. Ermers wrote:
> 
>> Dear All,
>> 
>> I am still trying to typeset cals tables.
>> 
>> I have
>> 1. an environment document with instructions.
>> 2. an xml docbook file containing cals tables
>> 
>> Note that the original cals tables (docbook standard) use <table, <tgroup, etc. but for ConTeXt purposes this  - as far as I understand - needs to be: <cals:table, <cals:tgroup, etc. (My xml reader does not recognize them anymore.)
> 
> 
> There is a bug in lxml-dir.lua. Open lxml-dir.lua and change
> 
> local collection = xml.applylpath({ getid(xml.load(filename)) },"directive") -- is { } needed ?
> 
> to
> 
> local collection = xml.applylpath(getid(xml.load(filename)),"directive") -- AM: removed { }
> 
> [@Hans: I do not checked if this affects other uses of directives.load(...).]
> 
> Then run c --make to regenerate formats. After that create three files:
> 
> %% directives.xml
> <?xml version="1.0" standalone="yes"?>
> <directives>
>  <directive attribute="cdx" value="color" element="cals:table"
>             setup="cdx:cals:table:colors"/>
> </directives>
> 
> 
> %% table.xml
> <?xml version="1.0" standalone="yes"?>
> 
> <cals:table cdx="color">
>  <cals:tgroup cols="3">
>    <cals:thead>
>      <cals:row>
>        <cals:entry>alpha</cals:entry>
>        <cals:entry>beta</cals:entry>
>        <cals:entry>gamma</cals:entry>
>      </cals:row>
>    </cals:thead>
>    <cals:tbody>
>      <cals:row>
>        <cals:entry>one</cals:entry>
>        <cals:entry>two</cals:entry>
>        <cals:entry>three</cals:entry>
>      </cals:row>
>      <cals:row>
>        <cals:entry>four</cals:entry>
>        <cals:entry>five</cals:entry>
>        <cals:entry>six</cals:entry>
>      </cals:row>
>    </cals:tbody>
>  </cals:tgroup>
> </cals:table>
> 
> 
> %% test.tex
> \usemodule[cals]
> 
> \startsetups cdx:cals:table:colors
>  \setupTABLE[each][each][background=color,backgroundcolor=red]
> \stopsetups
> 
> \starttext
> \xmlloaddirectives{directives.xml}
> \xmlprocess{xml:cals:process}{table.xml}{}
> \stoptext
> 
> 
> Then compile test.tex to get a table with a red background.
> 
> Aditya
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: cals tables - UNSOLVED
  2011-03-18  7:47               ` R. Ermers
@ 2011-03-19  8:10                 ` R. Ermers
  0 siblings, 0 replies; 12+ messages in thread
From: R. Ermers @ 2011-03-19  8:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear All,

After having succeeded with Aditya's kind help to typeset a table file in a separate pdf, I have been trying to typeset the cals tables in my docbook xml file in two ways:

A. directly in the document. 

The table is in //section/cals:table.

The cals module is loaded at the beginning of the document. But in the pdf there is no trace of any table. Do I need to add 
 definition somewhere? Perhaps in this list where the xml items are introduced?

\xmlsetsetup{#1}{article|footnote|foreignphrase|section [snippet] para|quote|itemizedlist|listitem}{xml:*}

This would be contrary to working with the directives and the cals module.

B. as a separate document in a mediaobject
Usually docbook files can contain tables, but there is nothing against imported a separate files. I chose to use the graphics wrapper:

      <mediaobject role="tabel">
        <imageobject>
          <imagedata fileref="./test2.xml"/>  (I also tried fileref="test2.xml") 
        </imageobject>
      </mediaobject>

I know that the object is found, because I use a marker (TABEL 3), which is printed in the pdf.

\startxmlsetups xml:mediaobject:imageobject:imagedata:tabel
\xmlloaddirectives{directives.xml}
TABEL 3
\xmlprocess{xml:cals:process}{\xmlatt{#1}{fileref}}{}
\stopxmlsetups

The xml file, and I believe here the table file is meant, is not imported though. The log file says that the xml file is invalid, but that is not true.  It is Hans' simple test table (alpha, betha, gamma), it is validated by xml software, and moreover, it can be typeset without any problems in a separate pdf.

\pages           > flushing realpage 24, userpage 24
lxml            : 9 directives found in 'directives.xml', 9 valid
load            > invalid xml file - parsed text

The log file also says that the text is parsed. But there is no text from the table in the pdf.

%I tried loading the directives in various places, e.g. directly after the module in the top of the document and after the command \startxmlsetups xml:dbsetups.

Well, has anyone any advice? Or should I give up on this?

Regards,

Robert





___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-03-19  8:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-07 11:26 cals tables R. Ermers
2011-03-07 11:41 ` Hans Hagen
2011-03-07 12:41   ` R. Ermers
2011-03-07 21:10     ` R. Ermers
2011-03-08 20:00   ` R. Ermers
2011-03-09 13:30     ` Hans Hagen
2011-03-11  8:35       ` R. Ermers
2011-03-12 11:46         ` R. Ermers
2011-03-17 10:33           ` cals tables - UNSOLVED R. Ermers
2011-03-18  4:08             ` Aditya Mahajan
2011-03-18  7:47               ` R. Ermers
2011-03-19  8:10                 ` R. Ermers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).