ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: embeddedxtable
Date: Sun, 24 May 2015 22:53:02 +0200	[thread overview]
Message-ID: <6B34903A-A803-4592-91BC-23CD84E80CE7@gmail.com> (raw)
In-Reply-To: <9B18EC0F-CCBF-483F-875E-5F097EBD8908@uva.nl>


> Am 24.05.2015 um 21:33 schrieb Meer, H. van der <H.vanderMeer@uva.nl>:
> 
>> In this case you have to provide a working minimal example.
>> 
>> Wolfgang
> 
> 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.


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

\xmlregistersetup{xmlcommon}

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

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

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

\starttext

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

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

\ruledhbox{\xmlprocessbuffer{root}{a}{}}
\ruledhbox{\xmlprocessbuffer{root}{b}{}}

\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	other threads:[~2015-05-24 20:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-24 10:18 embeddedxtable Meer, H. van der
2015-05-24 10:36 ` embeddedxtable Meer, H. van der
2015-05-24 11:49   ` embeddedxtable Meer, H. van der
2015-05-24 13:06     ` embeddedxtable Meer, H. van der
2015-05-24 13:32       ` embeddedxtable Meer, H. van der
2015-05-24 15:31         ` embeddedxtable Wolfgang Schuster
2015-05-24 16:01           ` embeddedxtable Meer, H. van der
2015-05-24 18:16             ` embeddedxtable Wolfgang Schuster
2015-05-24 19:33               ` embeddedxtable Meer, H. van der
2015-05-24 20:53                 ` Wolfgang Schuster [this message]
2015-05-25  8:35                   ` embeddedxtable Meer, H. van der
2015-05-25  9:26                     ` embeddedxtable Meer, H. van der
2015-05-25 10:59                       ` embeddedxtable Wolfgang Schuster
2015-05-25 10:55                     ` embeddedxtable Wolfgang Schuster
2015-05-25  9:06                   ` embeddedxtable Meer, H. van der
2015-05-25 10:08                   ` embeddedxtable Meer, H. van der
2015-05-25 11:05                     ` embeddedxtable Wolfgang Schuster
2015-05-25 13:50                       ` embeddedxtable Meer, H. van der

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6B34903A-A803-4592-91BC-23CD84E80CE7@gmail.com \
    --to=schuster.wolfgang@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).