Re: [NTG-context] concatenating attribute values in XML
On 08/06/2017 10:11 PM, Pablo Rodriguez wrote: > [...] > This is what I have in the XML file: > > > > > Sorry, Hans. Today I realize I was saying nonsense. I solved it with: \xmlsetsetup{\xmldocument} {[contains(@class,'sidebyside')]/p} {xml:sidebyside} \xmlsetsetup{\xmldocument} {[contains(@class,'sidebyside')]/p/img} {xml:image:sidebyside} \startxmlsetups xml:sidebyside \blank\startalign[center] \dontleavehmode \xmlflush{#1} \stopalign\blank \stopxmlsetups \startxmlsetups xml:image:sidebyside \externalfigure[\xmlatt{#1}{src}][width=.495\textwidth] \stopxmlsetups Sorry for the noise, Pablo -- http://www.ousia.tk ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] concatenating attribute values in XML
On 08/06/2017 12:05 PM, Hans Hagen wrote: > On 8/6/2017 11:37 AM, Pablo Rodriguez wrote: >> [...] >> How can I define the external figure so I concatenate the image file >> names in the code above? >> >> I mean, \xmlconcat is great, but I don’t see how I could make it work to >> get values from the src attribute. > > why do you want to pass multiple names to \externalfigure Many thanks for your reply, Hans. My code was wrong, I need two external figures, not one. I only get the same image repeated twice. I don’t know how to solve it. This is what I have in the XML file: This is what I tried in the environment file: \startxmlsetups xml:sidebyside \blank\startalign[center] \dontleavehmode \externalfigure[\xmlattribute{#1}{./p/img}{src}] [width=.5\textwidth] \externalfigure[\xmlattribute{#1}{./p/img}{src}] [width=.5\textwidth] \stopalign\blank \stopxmlsetups And this is what I need in pure ConTeXt: \blank\startalign[center] \dontleavehmode \externalfigure[img/first-image.png][width=.5\textwidth] \externalfigure[img/second-image.png][width=.5\textwidth] \stopalign\blank How could I achieve the second? (Concatenation is the only thing that comes to my mind.) Many thanks for your help, Pablo -- http://www.ousia.tk ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] concatenating attribute values in XML
On 8/6/2017 11:37 AM, Pablo Rodriguez wrote: Dear list, I have the following definition: \startxmlsetups xml:image:sidebyside \blank\startalign[center] \dontleavehmode \externalfigure[\xmlattribute{#1}{./p/img}{src}] [width=.5\textwidth] %~ \xmlconcat{#1}{./p/img}{ } \stopalign\blank \stopxmlsetups How can I define the external figure so I concatenate the image file names in the code above? I mean, \xmlconcat is great, but I don’t see how I could make it work to get values from the src attribute. why do you want to pass multiple names to \externalfigure - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___