Hi, So I've got to use this modern XML thingy.. ;-) I tried to set up ConTeXt to typeset processed XML data. What goes wrong is the \XMLpar which sometimes gives default value instead of the real one. See the code below: \starttext \defineXMLpickup [log] {\starttabulate[|p(7cm)|p|] \HL\NC ObjectID \NC Value \NC\NR\HL} {\stoptabulate} \defineXMLenvironment [var] {\NC \XMLpar{var}{name}{blah} \NC } {\NC\NR } \startXMLdata <log> <entry date="1054844187"> <var name=".1.3.6.1.2.1.5.16.0"> 28674524 </var> </entry> <entry date="1054844247"> <var name=".1.3.6.1.2.1.5.16.0"> 28674677 </var> </entry> <entry date="1054844307"> <var name=".1.3.6.1.2.1.5.16.0"> 28674824 </var> </entry> <entry date="1054844367"> <var name=".1.3.6.1.2.1.5.16.0"> 28674963 </var> </entry> </log> \stopXMLdata \stoptext If I remove the \NC before \XMLpar -- it gives the real value of the name attribute. Jedrzej
Tables make a lot of groups. When your <var> tag is read, your parameter is defined in a group. When you use it in the next cell, you are in another group, and your parameter value has disappeared. Try this: \defineXMLenvironment [var] {\xdef\varname{\XMLpar{var}{name}{blah}} \NC \varname \NC } {\NC\NR } On Fri, Jun 06, 2003 at 12:06:39AM +0200, Jedrzej Nasiadek wrote:
Hi,
So I've got to use this modern XML thingy.. ;-) I tried to set up ConTeXt to typeset processed XML data. What goes wrong is the \XMLpar which sometimes gives default value instead of the real one. See the code below:
\starttext \defineXMLpickup [log] {\starttabulate[|p(7cm)|p|] \HL\NC ObjectID \NC Value \NC\NR\HL} {\stoptabulate}
\defineXMLenvironment [var] {\NC \XMLpar{var}{name}{blah} \NC } {\NC\NR }
\startXMLdata <log> <entry date="1054844187"> <var name=".1.3.6.1.2.1.5.16.0"> 28674524 </var> </entry> <entry date="1054844247"> <var name=".1.3.6.1.2.1.5.16.0"> 28674677 </var> </entry> <entry date="1054844307"> <var name=".1.3.6.1.2.1.5.16.0"> 28674824 </var> </entry> <entry date="1054844367"> <var name=".1.3.6.1.2.1.5.16.0"> 28674963 </var> </entry> </log> \stopXMLdata
\stoptext
If I remove the \NC before \XMLpar -- it gives the real value of the name attribute.
Jedrzej _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
-- Simon Pepping email: spepping@scaprea.hobby.nl
At 22:55 06/06/2003 +0200, you wrote:
\defineXMLenvironment [var] {\xdef\varname{\XMLpar{var}{name}{blah}} \NC \varname \NC } {\NC\NR }
Hah! Now it works like charm :-) Thanks Simon!
or better: \defineXMLenvironment [var] {\expanded {\NC \XMLpar {var} {name}} \NC} {\NC \NR} since you need the expanded value in a collected content like tabulate 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 -------------------------------------------------------------------------
participants (4)
-
Hans Hagen
-
Jedrzej Nasiadek
-
Jedrzej Nasiadek
-
Simon Pepping