Re: [NTG-context] referring to floats in xml

2011-03-22 Thread R. Ermers
Thanks very much, Aditya for your advice. I really appreciate it. 
I tried your suggestions.

> On Mon, 21 Mar 2011, R. Ermers wrote:
> 
>> Thanks, Aditya, The first problem is adequately solved by adding []. I'll 
>> prepare an example for the second problem.
>> 
>> A related problem is referring to sections and other blocks.
>> 
>> Cows
>> cows cows cows. As I told in > linkend="sec:cows"/>
>> 
>> The title is mapped as follows (lpath):
>> \xmlsetsetup{#1}{section/title}{xml:section/title}
>> 
>> \startxmlsetups xml:section:title
>> \section{\xmlflush{#1}}
>> \stopxmlsetups
>> 
>> The section is not mapped:
>> \startxmlsetups xml:section
>> \xmlflush{#1}
>> \stopxmlsetups
>> 
>> Adding [\xmlatt{#1}{id}] to xml:section:title does not work of course. 
>> Using [\xmlatt{#1}{id}] with xml:section puts the id before the \section 
>> command. I think one of the other commands has to be used in such a way 
>> that the id is flushed forward after the \section command.
> 
> Map section to include both id and title. (Untested)
> 
> \startxmlsetups xml:section
> \section[\xmlatt{#1}{id}]{\xmlfirst{#1}{/title}}
> % or slightly better
> % \section[\xmlattdef{#1}{id}{+}]{\xmlfirst{#1}{/title}}
The section titles and numbers are doubled now, most likely due to other 
mappings that. The subsection and subsubsection titles need to be mapped as 
such, a generic mapping for all section heads is not feasible (I think).

> % Then flush para separately
> % \xmlall{#1}{/para}

This does not work, because the sections contain all kinds of elements, not 
just . 
texttext

I tried \xmlall{#1} with other elements, but the result is a mess. I need an 
lpath symbol that refers to all underlying elements. I tried {+}, {*}, {//}, 
etc.

> % or
> % \xmlconcat {#1} {/para} {\par}
> % or better, add a contents tag around the contents
> %   ... 
> %... 

> % 
> % and then use
> % \xmlfirst{#1}{/contents}
> 

I had thought about this, but it would ruin the docbook structure of the 
document, and my editor programme would no longer accept it. The programme 
already complains about the change of  \stopxmlsetups
> 
> 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] referring to floats in xml

2011-03-21 Thread Aditya Mahajan
On Mon, 21 Mar 2011, R. Ermers wrote:

> Thanks, Aditya, The first problem is adequately solved by adding []. I'll 
> prepare an example for the second problem.
>
> A related problem is referring to sections and other blocks.
>
> Cows
> cows cows cows. As I told in 
>
> The title is mapped as follows (lpath):
> \xmlsetsetup{#1}{section/title}{xml:section/title}
>
> \startxmlsetups xml:section:title
> \section{\xmlflush{#1}}
> \stopxmlsetups
>
> The section is not mapped:
> \startxmlsetups xml:section
> \xmlflush{#1}
> \stopxmlsetups
>
> Adding [\xmlatt{#1}{id}] to xml:section:title does not work of course. 
> Using [\xmlatt{#1}{id}] with xml:section puts the id before the \section 
> command. I think one of the other commands has to be used in such a way 
> that the id is flushed forward after the \section command.

Map section to include both id and title. (Untested)

\startxmlsetups xml:section
\section[\xmlatt{#1}{id}]{\xmlfirst{#1}{/title}}
% or slightly better
% \section[\xmlattdef{#1}{id}{+}]{\xmlfirst{#1}{/title}}
% Then flush para separately
% \xmlall{#1}{/para}
% or
% \xmlconcat {#1} {/para} {\par}
% or better, add a contents tag around the contents
%   ... 
%... 
% 
% and then use
% \xmlfirst{#1}{/contents}

\stopxmlsetups

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] referring to floats in xml

2011-03-20 Thread R. Ermers
Thanks, Aditya, The first problem is adequately solved by adding []. I'll 
prepare an example for the second problem.

A related problem is referring to sections and other blocks.

Cows
cows cows cows. As I told in 

The title is mapped as follows (lpath):
\xmlsetsetup{#1}{section/title}{xml:section/title}

\startxmlsetups xml:section:title
\section{\xmlflush{#1}}
\stopxmlsetups

The section is not mapped:
\startxmlsetups xml:section
\xmlflush{#1}
\stopxmlsetups

Adding [\xmlatt{#1}{id}] to xml:section:title does not work of course. Using 
[\xmlatt{#1}{id}] with xml:section puts the id before the \section command. I 
think one of the other commands has to be used in such a way that the id is 
flushed forward after the \section command.

Regards,

Robert


Op 20 mrt 2011, om 17:05 heeft Aditya Mahajan het volgende geschreven:

> On Sun, 20 Mar 2011, R. Ermers wrote:
> 
>> Dear All,
>> 
>> My xml docbook file contains a number of graphics. Some are regular figures, 
>> some are edgefigures. I have two questions in this respect.
> 
> Understanding these snippets is difficult without a minimal working example.
> 
>> A. referring to floats
>> 
>> \placeedgefigure
>> [\xmlatt{#1}{id}]
>> {\xmlfirst{#1}{/caption}}
>> {\framed[frame=off]{\setlayer[graphics]{\xmlfirst{#1}{/imageobject
>> 
>> \definefloat[edgefigure][figure]
>> \setupfloat[edgefigure]
>> [leftmargindistance=-\innercombitotal,rightmargindistance=-\outercombitotal,
>> default={outer,low,long}, criterium=.65\textwidth,numbering=no]
>> 
>> 
>> 
>>   
>> 
>>   
>> 
>> I now wonder how to refer to these floats. That is, referring through > linkend="cow"/> is not difficult to implement, but for some reason the 
>> mapping of the id is not that obvious. I tried it like this:
>> 
>> \startxmlsetups xml:mediaobject:edgefigure
>> \placeedgefigure
>> [\xmlatt{#1}{id}]
>> {\xmlfirst{#1}{/caption}}
>> {\framed[frame=off]{\setlayer[graphics]{\xmlfirst{#1}{/imageobject
>> \stopxmlsetups
> 
> 
> Try
> 
> \placeedgefigure
>  []
>  [\xmlatt{#1}{id}]
>  {}
>  {}
>> B. edgefigures and regular figures
>> 
>> The document contains two types of figures.
>> 
>> \xmlsetsetup{#1}{mediaobject[@role='fig']}{xml:mediaobject:fig}
>> \xmlsetsetup{#1}{mediaobject[@role='edgefigure']}{xml:mediaobject:edgefigure}
>> 
>> I have noticed that when  contains both the attributes id and 
>> role, such as the cow example, the figure is considered a regular figure 
>> automatically and will not typeset as an edgefigure.
> 
> Please provide a minimal working example.
> 
> 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] referring to floats in xml

2011-03-20 Thread Aditya Mahajan

On Sun, 20 Mar 2011, R. Ermers wrote:


Dear All,

My xml docbook file contains a number of graphics. Some are regular 
figures, some are edgefigures. I have two questions in this respect.


Understanding these snippets is difficult without a minimal working 
example.



A. referring to floats

\placeedgefigure
[\xmlatt{#1}{id}]
{\xmlfirst{#1}{/caption}}
{\framed[frame=off]{\setlayer[graphics]{\xmlfirst{#1}{/imageobject

\definefloat[edgefigure][figure]
\setupfloat[edgefigure]
[leftmargindistance=-\innercombitotal,rightmargindistance=-\outercombitotal,
default={outer,low,long}, criterium=.65\textwidth,numbering=no]


 
   
 
   

I now wonder how to refer to these floats. That is, referring through  is not difficult to implement, but for some reason the mapping of 
the id is not that obvious. I tried it like this:

\startxmlsetups xml:mediaobject:edgefigure
\placeedgefigure
[\xmlatt{#1}{id}]
{\xmlfirst{#1}{/caption}}
{\framed[frame=off]{\setlayer[graphics]{\xmlfirst{#1}{/imageobject
\stopxmlsetups



Try

\placeedgefigure
  []
  [\xmlatt{#1}{id}]
  {}
  {}

B. edgefigures and regular figures

The document contains two types of figures.

\xmlsetsetup{#1}{mediaobject[@role='fig']}{xml:mediaobject:fig}
\xmlsetsetup{#1}{mediaobject[@role='edgefigure']}{xml:mediaobject:edgefigure}

I have noticed that when  contains both the attributes id 
and role, such as the cow example, the figure is considered a regular 
figure automatically and will not typeset as an edgefigure.


Please provide a minimal working example.

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
___


[NTG-context] referring to floats in xml

2011-03-20 Thread R. Ermers
Dear All,

My xml docbook file contains a number of graphics. Some are regular figures, 
some are edgefigures. I have two questions in this respect.

A. referring to floats

\placeedgefigure
[\xmlatt{#1}{id}]
{\xmlfirst{#1}{/caption}}
{\framed[frame=off]{\setlayer[graphics]{\xmlfirst{#1}{/imageobject

\definefloat[edgefigure][figure]
\setupfloat[edgefigure]
[leftmargindistance=-\innercombitotal,rightmargindistance=-\outercombitotal,
default={outer,low,long}, criterium=.65\textwidth,numbering=no]


  

  


I now wonder how to refer to these floats. That is, referring through  is not difficult to implement, but for some reason the mapping 
of the id is not that obvious. I tried it like this:

\startxmlsetups xml:mediaobject:edgefigure
\placeedgefigure
[\xmlatt{#1}{id}]
{\xmlfirst{#1}{/caption}}
{\framed[frame=off]{\setlayer[graphics]{\xmlfirst{#1}{/imageobject
\stopxmlsetups

The log file says:
references  : unknown reference [][fig:cow]

The reference is not solved.


B. edgefigures and regular figures

The document contains two types of figures.

\xmlsetsetup{#1}{mediaobject[@role='fig']}{xml:mediaobject:fig}
\xmlsetsetup{#1}{mediaobject[@role='edgefigure']}{xml:mediaobject:edgefigure}

I have noticed that when  contains both the attributes id and 
role, such as the cow example, the figure is considered a regular figure 
automatically and will not typeset as an edgefigure.


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
___