From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/91603 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: embeddedxtable Date: Mon, 25 May 2015 13:05:52 +0200 Message-ID: <4AB2F654-54FD-4DFD-86C7-19759F34FDA1@gmail.com> References: <9527BE42-D3DE-4097-819D-692A094F270A@uva.nl> <839037E1-7F7B-4633-A1C4-7B67436EDCD9@uva.nl> <63FDF106-1AE7-4F27-9198-97AD3976602D@uva.nl> <0D7ACAF3-3C6F-4FAD-BB61-4CC74397AEC5@uva.nl> <16315B5D-F25C-4703-83EE-4A3E1C2A762D@uva.nl> <81F6CB25-5CDC-404F-BEC1-38E82499C1D4@uva.nl> <9B18EC0F-CCBF-483F-875E-5F097EBD8908@uva.nl> <6B34903A-A803-4592-91BC-23CD84E80CE7@gmail.com> <556E83EB-2515-42BE-89CD-354B98DF78C0@uva.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Content-Type: multipart/mixed; boundary="===============1932642046==" X-Trace: ger.gmane.org 1432552254 2898 80.91.229.3 (25 May 2015 11:10:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 May 2015 11:10:54 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon May 25 13:10:42 2015 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YwqHH-0001zz-RK for gctc-ntg-context-518@m.gmane.org; Mon, 25 May 2015 13:10:39 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id ED05F101FC for ; Mon, 25 May 2015 13:10:38 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id dyG0xQHUiZ72 for ; Mon, 25 May 2015 13:10:35 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 87A2C10204 for ; Mon, 25 May 2015 13:09:50 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B61A110201 for ; Mon, 25 May 2015 13:09:46 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Qp_g1fLeKJBH for ; Mon, 25 May 2015 13:09:45 +0200 (CEST) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 78EEA101FA for ; Mon, 25 May 2015 13:05:57 +0200 (CEST) Original-Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id t4PB5uLk031795 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 25 May 2015 13:05:56 +0200 Original-Received: by wizk4 with SMTP id k4so44928356wiz.1 for ; Mon, 25 May 2015 04:05:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to; bh=9xlaZAyFjVJoK1ex41U179GtacTeuY1rVAnDrsoJVMU=; b=MLn8vShPM7ZlUcQs8NJ1NcfloAddxOw2VP1xnFTgE3iMpClr5AQDtHHarknWVJg8qV b/MpB3pmPNQMyzkv43q2zlJIRClXozojvWuJ05OEPXS6l5M+MOJlRpeHroWXR08A+UIK 81/4b20DYSRHR74tsn7l3VnS5glqY8U88sETfMxfwcEpZV1CqxJm0Qm1bcr3hYSB77Py AgbZBsOHDL4fTBYsOhCRZbht3Z4KT7P0E9jiIEvlm2s6+YBDGiBpIaasFMyMBYULfBCt KiFCbcsfTHf9r2Q6ksaNZf/XFn1CVX0S5vJpKkjtCiOxz806GBpXSXWTv8IeAmFW8NU9 jQjQ== X-Received: by 10.194.104.164 with SMTP id gf4mr1092923wjb.28.1432551956067; Mon, 25 May 2015 04:05:56 -0700 (PDT) Original-Received: from keima.localdomain (x2f2ad87.dyn.telefonica.de. [2.242.173.135]) by mx.google.com with ESMTPSA id bh7sm16251553wjb.8.2015.05.25.04.05.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 May 2015 04:05:55 -0700 (PDT) In-Reply-To: <556E83EB-2515-42BE-89CD-354B98DF78C0@uva.nl> X-Mailer: Apple Mail (2.2098) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c05::229; country=BE; region=Brussels Capital; city=Brussels; latitude=50.8466; longitude=4.3528; http://maps.google.com/maps?q=50.8466,4.3528&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03Owb5UUM - a2c1df4a9278 - 20150525 Received-SPF: pass (filter3-ams.mf.surf.net: domain of schuster.wolfgang@gmail.com designates 2a00:1450:400c:c05::229 as permitted sender) receiver=filter3-ams.mf.surf.net; client-ip=2a00:1450:400c:c05::229; envelope-from=; helo=mail-wi0-x229.google.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:91603 Archived-At: --===============1932642046== Content-Type: multipart/alternative; boundary="Apple-Mail=_DB24CC88-3EAD-4251-96B4-C4AAD521478C" --Apple-Mail=_DB24CC88-3EAD-4251-96B4-C4AAD521478C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Am 25.05.2015 um 12:08 schrieb Meer, H. van der : >=20 >=20 >> On 24 May 2015, at 22:53, Wolfgang Schuster = > = wrote: >>=20 >>=20 >>> Am 24.05.2015 um 21:33 schrieb Meer, H. van der >: >>>=20 >>> Here an example as minimal as I could construct. >>=20 >> The spaces in the output are produced by the spaces between the tags = (\xmlstrip doesn=E2=80=99t seem to work) >> and you have to use a combination of \removeunwantedspaces and = \ignorespaces to remove them. >>=20 >> To center your table this isn=E2=80=99t necessary when you replace = \midaligned with a framedtext >> environment in combination with =E2=80=9Clocation=3Dmiddle=E2=80=9D = or use a float command like \placefigure. >>=20 >=20 > 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=3D0pt] shows where spurious = space is still inserted. >=20 > 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=E2=80=99s impossible to tell what=E2=80=99s 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=E2=80=99t 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]
A B
C D
\stopbuffer \ruledhbox{\xmlprocessbuffer{root}{table}{}} \stoptext Wolfgang= --Apple-Mail=_DB24CC88-3EAD-4251-96B4-C4AAD521478C Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Am 25.05.2015 um 12:08 schrieb Meer, H. van der <H.vanderMeer@uva.nl>:


On 24 May 2015, at 22:53, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:


Am 24.05.2015 um 21:33 schrieb = Meer, H. van der <H.vanderMeer@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=E2=80=99t seem to work)
and you have to use a combination of \removeunwantedspaces and = \ignorespaces to remove them.

To center your table this isn=E2=80=99t necessary when you replace = \midaligned with a framedtext
environment in combination with =E2=80=9Clocation=3Dmiddle=E2=80=9D 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=3D0pt] 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=E2=80=99s impossible to tell what=E2=80=99s = 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=E2=80=99t = 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=3D"1.0" = encoding=3D"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
<= div>
\ruledhbox{\xmlprocessbuffer{root}{table}{}}

\stoptext

Wolfgang
= --Apple-Mail=_DB24CC88-3EAD-4251-96B4-C4AAD521478C-- --===============1932642046== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============1932642046==--