ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* combinations ins XML
@ 2003-02-10 14:35 varheit
  2003-02-10 15:53 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: varheit @ 2003-02-10 14:35 UTC (permalink / raw)


Dear all,

I would like to use the combination feature from an XML source.

My XML environment file includes the following definitions:

\defineXMLenvironment[combination]
 
{\expanded{\startcombination[\XMLpar{combination}{layout}{2}*\XMLpar{combination}{rows}{1}]}}
  {\stopcombination}

\defineXMLpickup[combinationentry]
  {\defineXMLpush[combinationitem]\defineXMLpush[combinationcaption]}
 
{\expanded{\bgroup\XMLpop{combinationitem}\egroup\bgroup\XMLpop{combinationcaption}\egroup}}


The XML source that I use looks like this:

    <combination columns="2" rows="1">
      <combinationentry>
	<combinationitem>Image A</combinationitem>
	<combinationcaption>Caption for image A</combinationcaption>
      </combinationentry>
      <combinationentry>
	<combinationitem>Image B</combinationitem>
	<combinationcaption>Caption for image B</combinationcaption>
      </combinationentry>
    </combination>


When I process this file I always get the following error:

! Missing { inserted.
<to be read again>
                   \def
\parseXMLelement #1#2 #3>->\def
                                \currentXMLarguments {#3}\if #1/\chardef
\ki...
l.5       <combinationentry>

?

I have tried different variations without any success.
Maybe somebody can help me.

Vik

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: combinations ins XML
  2003-02-10 14:35 combinations ins XML varheit
@ 2003-02-10 15:53 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2003-02-10 15:53 UTC (permalink / raw)


At 03:35 PM 2/10/2003 +0100, varheit@gmx.de wrote:
>Dear all,
>
>I would like to use the combination feature from an XML source.
>
>My XML environment file includes the following definitions:
>
>\defineXMLenvironment[combination]
>
>{\expanded{\startcombination[\XMLpar{combination}{layout}{2}*\XMLpar{combination}{rows}{1}]}}
>   {\stopcombination}
>
>\defineXMLpickup[combinationentry]
>   {\defineXMLpush[combinationitem]\defineXMLpush[combinationcaption]}
>
>{\expanded{\bgroup\XMLpop{combinationitem}\egroup\bgroup\XMLpop{combinationcaption}\egroup}}
>
>
>The XML source that I use looks like this:
>
>     <combination columns="2" rows="1">
>       <combinationentry>
>         <combinationitem>Image A</combinationitem>
>         <combinationcaption>Caption for image A</combinationcaption>
>       </combinationentry>
>       <combinationentry>
>         <combinationitem>Image B</combinationitem>
>         <combinationcaption>Caption for image B</combinationcaption>
>       </combinationentry>
>     </combination>

ah, real trickery is needed here:

\defineXMLenvironment [combination] [columns=2,rows=1]
   {\scratchtoks\emptytoks
    \expanded{\appendtoks \noexpand \startcombination
      [\XMLop{columns}*\XMLop{rows}]}\to \scratchtoks}
   {\appendtoks \stopcombination \to \scratchtoks
    \the\scratchtoks}

\defineXMLprocess[combinationentry]

\defineXMLpickup [combinationitem]
   {\appendtoks\bgroup}{\egroup\to\scratchtoks}

\defineXMLpickup [combinationcaption]
   {\appendtoks\bgroup}{\egroup\to\scratchtoks}

I can add such thing to x-contml.tex if needed

Hans

-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-02-10 15:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-10 14:35 combinations ins XML varheit
2003-02-10 15:53 ` Hans Hagen

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).