ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Strange expansion behavior in XML/luatex
@ 2010-05-29 10:01 Martin Kolařík
  2010-05-31 22:10 ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Martin Kolařík @ 2010-05-29 10:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello,

I had a problem with some my documents; I extracted it to as small code 
as possible. What is happening -- if any of xml flushing function (I 
tried xmlflush, xmlfilter and xmlall) is expanded to a macro (so the 
content of xml becomes a text of the macro), and the xml contains other 
hooked xml tags, the \edef (and its counterparts \xdef or 
\expandedaction) inside the inner tag is "skipped" by the log. Then 
macros relying on the expansion fail (I detected it in \doif and 
\processaction). Macros are normally expanded, only \edef fails (maybe 
some other TeX commands fail too, but I did not test it).

In my example below, content of "il" is flushed to a macro, "inline" is 
the inner tag and "\processaction" is the example of macro using 
"\edef". Do not look for sense, it is an example.

XML:
<?xml version="1.0" encoding="utf-8"?>
<il>
   Text <inline what="something" /> text.
</il>

TeX:
\startxmlsetups doc:inline
   \processaction
     [\xmlatt{#1}{what}]
     [something=>A thing,
        nothing=>Hic sunt leones]
\stopxmlsetups

\startxmlsetups doc:il
   \edef\content{\xmlflush{#1}}%
\stopxmlsetups

\xmlregistersetup{xml:doc}

\startxmlsetups xml:doc
   \xmlsetsetup{\xmldocument}{inline|il}{doc:*}
\stopxmlsetups

I do not know, if it is a bug or a feature :-); but notwithstanding the 
fact, similar code I used in MkII worked very well.

Thanks for hints,

Martin

-- 
Martin Kolařík

martin.kolarik@email.cz
martin.kolarik@jabber.cz
+420603535593

___________________________________________________________________________________
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
___________________________________________________________________________________

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

end of thread, other threads:[~2010-06-01  8:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-29 10:01 Strange expansion behavior in XML/luatex Martin Kolařík
2010-05-31 22:10 ` Hans Hagen
2010-06-01  7:03   ` Martin Kolařík
2010-06-01  7:51     ` Hans Hagen
2010-06-01  8:17       ` Martin Kolařík
2010-06-01  8:23         ` 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).