Re: [NTG-context] cals tables - UNSOLVED

2011-03-19 Thread R. Ermers
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:

  

(I also tried 
fileref="test2.xml") 

  

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
___


Re: [NTG-context] cals tables - UNSOLVED

2011-03-18 Thread R. Ermers
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  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 > etc. but for ConTeXt purposes this  - as far as I understand - needs to be: 
>> > 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
> 
> 
>   setup="cdx:cals:table:colors"/>
> 
> 
> 
> %% table.xml
> 
> 
> 
>  
>
>  
>alpha
>beta
>gamma
>  
>
>
>  
>one
>two
>three
>  
>  
>four
>five
>six
>  
>
>  
> 
> 
> 
> %% 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
___


Re: [NTG-context] cals tables - UNSOLVED

2011-03-17 Thread Aditya Mahajan

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 


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


  



%% table.xml



  

  
alpha
beta
gamma
  


  
one
two
three
  
  
four
five
six
  

  



%% 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
___


Re: [NTG-context] cals tables - UNSOLVED

2011-03-17 Thread R. Ermers
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 

\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
___