[NTG-context] mapping seeregister command to xml

Thomas A. Schmitz thomas.schmitz at uni-bonn.de
Thu Jul 4 12:10:05 CEST 2019


Hi,

I'm having trouble mapping the seeregister command to an xml setup. 
Example (looks somewhat messy, but explains why I need it):

\startbuffer[test]
<document>
   <p>This is a test. <emph>IGRR</emph> 4, 988<seeinscription 
sort="IGRR4+988" target="TAM 2 677"><emph>IGRR</emph> 
4+988</seeinscription> = <emph>TAM</emph> 2, 677<inscription 
sort="TAM2+677"><emph>TAM</emph> 2+677</inscription></p>
</document>
\stopbuffer

\startxmlsetups xml:testsetups
         \xmlsetsetup{#1}{*}{-}
	\xmlsetsetup{#1}{document|p|inscription|seeinscription|emph|index}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

\startxmlsetups xml:document
	\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:p
	\xmlflush{#1} \par
\stopxmlsetups

\startxmlsetups xml:emph
	{\em \xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:inscription
	\expanded{\inscription[\xmlatt{#1}{sort}]{\xmlflush{#1}}}
\stopxmlsetups

\startxmlsetups xml:seeinscription
	\expanded{\seeinscription[\xmlatt{#1}{sort}]{\xmlflush{#1}}{\xmlatt{#1}{target}}}
\stopxmlsetups

\defineregister[inscription][inscriptions]

\setupregister[inscription][pagestyle=,
	   		textstyle=,
			location=right,
			prefix=none,
			indicator=no]

\starttext
	\xmlprocessbuffer{main}{test}{}
  	\blank [line]
  	\placeregister[inscription]
\stoptext

Maybe my problem is with expansion in index entries? I must admit that I 
haven't really grasped why the \expanded was necessary and what it does...

All best

Thomas


More information about the ntg-context mailing list