expansion of xml userdata
Hello to everybody! \setuphead[section][expansion=yes] expands xml reference to the actual content in TUC file: \xmlatt {xml:name::4}{title} → First section for titles & bookmarks. The same is not true for userdata (mkiv & mkxl). Do you know how to force expansion of userdata? MWE attached. Thank you, Jano \startbuffer[doc] <?xml version "1.0"?> <document> <section title="First section"> text </section> <section title="Second section"> text </section> </document> \stopbuffer \setuphead[section][expansion=yes] \setuplist[section][alternative=command, command=\SectionListCommand] \define[3]\SectionListCommand{% {\bf#1\par title: #2\par usertitle: \structurelistuservariable{usertitle}}\par \blank \endgraf} \startxmlsetups xml:name \xmlsetsetup{\xmldocument}{document|section}{xml:name:*} \stopxmlsetups \xmlregistersetup{xml:name} \startxmlsetups xml:name:document \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:name:section \startsection[title=\xmlatt{#1}{title}] [usertitle=\xmlatt{#1}{title}] \stopsection \stopxmlsetups \starttext \placelist[section] \xmlprocessbuffer{xml:name}{doc}{} \stoptext
Jano Kula schrieb am 17.01.2021 um 21:22:
Hello to everybody!
\setuphead[section][expansion=yes] expands xml reference to the actual content in TUC file:
\xmlatt {xml:name::4}{title} → First section
for titles & bookmarks. The same is not true for userdata (mkiv & mkxl). Do you know how to force expansion of userdata?
You can drop "expansion=yes" when you use \normalexpanded{\startsection[..,..=..,..][..,..=..,..]} Wolfgang
On Sun, 17 Jan 2021 at 21:27, Wolfgang Schuster < wolfgang.schuster.lists@gmail.com> wrote:
Do you know how to force expansion of userdata?
You can drop "expansion=yes" when you use
\normalexpanded{\startsection[..,..=..,..][..,..=..,..]}
Wolfgang
Wow, this was fater then filling my glass. And it works even for userdata. Thank you, Wolfgang. Added to wiki \setuphead https://wiki.contextgarden.net/Command/setuphead and Interaction https://wiki.contextgarden.net/Interaction. To finish the story of expansion parameter, what is expansion=xml good for? Jano
participants (2)
-
Jano Kula
-
Wolfgang Schuster