> Am 25.05.2015 um 12:08 schrieb Meer, H. van der <h.vanderm...@uva.nl>:
> 
> 
>> On 24 May 2015, at 22:53, Wolfgang Schuster <schuster.wolfg...@gmail.com 
>> <mailto:schuster.wolfg...@gmail.com>> wrote:
>> 
>> 
>>> Am 24.05.2015 um 21:33 schrieb Meer, H. van der <h.vanderm...@uva.nl 
>>> <mailto:h.vanderm...@uva.nl>>:
>>> 
>>> Here an example as minimal as I could construct.
>> 
>> The spaces in the output are produced by the spaces between the tags 
>> (\xmlstrip doesn’t seem to work)
>> and you have to use a combination of \removeunwantedspaces and \ignorespaces 
>> to remove them.
>> 
>> To center your table this isn’t necessary when you replace \midaligned with 
>> a framedtext
>> environment in combination with “location=middle” or use a float command 
>> like \placefigure.
>> 
> 
> I think I can reduce the number of places where spaces have to be suppressed. 
> With just 2 \removeunwantedspaces and 1 \ignorespaces I get rid of most of 
> them. The \framed[offset=0pt] shows where spurious space is still inserted.
> 
> Only 1 space remains inside the framed: in the vertical dimension below the 
> table. Any idea where this comes from? Some parameter to change in the 
> \framerd perhaps?

It’s impossible to tell what’s wrong with our code snippets, you have to create 
working minimal examples.

The following example shows where you have to take care of extra space and you 
don’t need them when you put the whole table in a \vbox (you can test by 
commenting all \ignorespaces and \removeunwantedspaces commands and replacing 
\ruledhbox with \ruledvbox).

\startxmlsetups xmlcommon
        \xmlsetsetup{\xmldocument}{table|tbody|tr|td}{xmlcommon:*}
\stopxmlsetups

\xmlregistersetup{xmlcommon}

\startxmlsetups xmlcommon:table
%       \removeunwantedspaces
        \startembeddedxtable
                \xmlflush{#1}
        \stopembeddedxtable
        \ignorespaces
\stopxmlsetups

\startxmlsetups xmlcommon:tbody
%       \removeunwantedspaces
        \startxtablebody
        \xmlflush{#1}
        \stopxtablebody
        \ignorespaces
\stopxmlsetups

\startxmlsetups xmlcommon:tr
%       \removeunwantedspaces
        \startxrow
                \xmlflush{#1}
        \stopxrow
        \ignorespaces
\stopxmlsetups

\startxmlsetups xmlcommon:td
        \removeunwantedspaces
        \startxcell
                \xmlflush{#1}
        \stopxcell
        \ignorespaces
\stopxmlsetups

\starttext

\startbuffer[table]
<?xml version="1.0" encoding="UTF-8"?>
<root>
        <table>
                <tbody>
                        <tr>
                                <td>A</td>
                                <td>B</td>
                        </tr>
                        <tr>
                                <td>C</td>
                                <td>D</td>
                        </tr>
                </tbody>
        </table>
</root>
\stopbuffer

\ruledhbox{\xmlprocessbuffer{root}{table}{}}

\stoptext

Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to