ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* defineXMLpush and grouping
@ 2002-02-08 20:58 Simon Pepping
  2002-02-10 20:36 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Pepping @ 2002-02-08 20:58 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 395 bytes --]

\defineXMLpush actually makes its definition when the pushed element
occurs. When a parent element defines a group, then the pushed element
is not visible outside that group. In \TeX\ this problem is usually
solved by doing a \gdef. Perhaps this problem can be solved in the
same manner, by providing a \gdefineXMLpush.

See attached example.

-- 
Simon Pepping
email: spepping@scaprea.hobby.nl

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: problem9.tex --]
[-- Type: text/x-tex, Size: 1156 bytes --]

% cont-en

\defineXMLenvironment[author]
% \defineXMLpush is defines the pushed element at the level at which
% it occurs;
	{\bgroup\defineXMLpush[affiliation]\startalignment[middle]\bfb}
	{1:\XMLpop{affiliation}\stopalignment 2:\XMLpop{affiliation}\egroup}
\defineXMLenvironment[address]
	{\startalignment[middle]\it}
	{\stopalignment}
\defineXMLgrouped[email] {Email: \tt}

\setupindenting[medium]

\starttext

\type{\defineXMLpush} actually makes its definition when the pushed
	element occurs. When a parent element defines a group, then the
	pushed element is not visible outside that group. In \TeX\ this
	problem is usually solved by doing a \type{\gdef}. Perhaps this
	problem can be solved in the same manner, by providing a
	\type{\gdefineXMLpush}.

In the example below the affiliation is output within the alignment
set up by author (marked by 1:), but not outside of it (marked by 2:).

\blank[2*big]

\startbuffer
<author>
   <firstname>Stein</firstname>
   <surname>Gjoen</surname>
   <affiliation>
      <address>
         <email>sgjoen@nyx.net</email>
      </address>
   </affiliation>
</author>
\stopbuffer

\processXMLbuffer

\stoptext

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

end of thread, other threads:[~2002-02-10 20:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-08 20:58 defineXMLpush and grouping Simon Pepping
2002-02-10 20:36 ` 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).