Hello all, I'm trying to interpret something like <section label="intro:mixtureprob"> <title>The problem of the complex protein mixture</title> <content> <ref name="intro:mixtureprob"/> </content> </section> With the follwing mapping rules and am failing: \defineXMLenvironment [section] { \defineXMLargument [title] [\XMLpar{section}{label}{}] {\section} \defineXMLenvironment [content] {}{} } {} \defineXMLargument [ref] {\textreference[\XMLpar{ref}{name}{}]} I would appreciate any insight into my folly ... Thanks, Joh
Johannes Graumann wrote:
Hello all,
I'm trying to interpret something like <section label="intro:mixtureprob"> <title>The problem of the complex protein mixture</title> <content> <ref name="intro:mixtureprob"/> </content> </section>
1. you never match the section label to the \section head, so you need something like this: \defineXMLargument [title] [\XMLpar{section}{label}{}] {\section[\XMLpar{section}{label}{}]} 2. \textreference *creates* a reference instead of referring to one, so you need \defineXMLargument [ref] {\in[\XMLpar{ref}{name}{}]} Cheers, Taco
Johannes Graumann wrote:
Hello all,
I'm trying to interpret something like <section label="intro:mixtureprob"> <title>The problem of the complex protein mixture</title> <content> <ref name="intro:mixtureprob"/> </content> </section>
With the follwing mapping rules and am failing: \defineXMLenvironment [section] { \defineXMLargument [title] [\XMLpar{section}{label}{}]
wrong argument, should be [name=]
{\section} \defineXMLenvironment [content] {}{} } {} \defineXMLargument [ref] {\textreference[\XMLpar{ref}{name}{}]}
wrong command \textreference should be \in
I would appreciate any insight into my folly ...
Thanks, Joh
\defineXMLenvironment [section] {\setups{section:define}} {} \startsetups section:define \defineXMLargument [title] [label=] {\expanded{\section[\XMLpar{section}{label}{}]}} \defineXMLprocess [content] \stopsetups \defineXMLenvironmentsave [pageref] [name=] {} {\at{\XMLflush{pageref}}[\XMLop{name}]} \defineXMLenvironmentsave [textref] [name=] {} {\in{\XMLflush{textref}}[\XMLop{name}]} \starttext \startXMLdata <section label="intro:mixtureprob"> <title>The problem of the complex protein mixture</title> <content> <pageref name="intro:mixtureprob"/> <textref name="intro:mixtureprob"/> <pageref name="intro:mixtureprob">page</pageref> <textref name="intro:mixtureprob">chapter</textref> </content> </section> \stopXMLdata \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hans, When this is done, I will have to make a trip to Zwolle and buy you a beer! Thank you once again! Joh Hans Hagen wrote:
Johannes Graumann wrote:
Hello all,
I'm trying to interpret something like <section label="intro:mixtureprob"> <title>The problem of the complex protein mixture</title> <content> <ref name="intro:mixtureprob"/> </content> </section>
With the follwing mapping rules and am failing: \defineXMLenvironment [section] { \defineXMLargument [title] [\XMLpar{section}{label}{}]
wrong argument, should be [name=]
{\section} \defineXMLenvironment [content] {}{} } {} \defineXMLargument [ref] {\textreference[\XMLpar{ref}{name}{}]}
wrong command \textreference should be \in
I would appreciate any insight into my folly ...
Thanks, Joh
\defineXMLenvironment [section] {\setups{section:define}} {}
\startsetups section:define \defineXMLargument [title] [label=] {\expanded{\section[\XMLpar{section}{label}{}]}} \defineXMLprocess [content] \stopsetups
\defineXMLenvironmentsave [pageref] [name=] {} {\at{\XMLflush{pageref}}[\XMLop{name}]} \defineXMLenvironmentsave [textref] [name=] {} {\in{\XMLflush{textref}}[\XMLop{name}]}
\starttext
\startXMLdata <section label="intro:mixtureprob"> <title>The problem of the complex protein mixture</title> <content> <pageref name="intro:mixtureprob"/> <textref name="intro:mixtureprob"/> <pageref name="intro:mixtureprob">page</pageref> <textref name="intro:mixtureprob">chapter</textref> </content> </section> \stopXMLdata
\stoptext
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Johannes Graumann
-
Taco Hoekwater