On 5/12/2017 6:00 PM, dr. Hans van der Meer wrote:
I did load an xml data file containing <nodes><subnode>...</subnode></nodes> with: \xmlload{Data}{data.xml}
Then correctly find the number of data from \xmlcount{Data}{subnode} however \xmlflush{Data} is not giving me the processed nodes from \startxmlsetups do:subnode doing something with xmlflysh{#1} \stopxmlsetups but only the raw input <nodes><subnode>...</subnode></nodes>
Do I err in my understanding? And if so, how to do it better?
Below a minimal example and its output.
\startxmlsetups load:setups \xmlsetsetup{#1}{root|nodes|subnode}{load:*} \stopxmlsetups \xmlregistersetup{load:setups}
\startxmlsetups load:root \xmlloadbuffer{Data}{dataset} Number of <subnodes> = \xmlcount{Data}{subnode}\blank \xmlflush{Data}
you need to apply document setups \xmlregistereddocumentsetups{Data}{Data} \xmlmain{Data}
\stopxmlsetups
\startxmlsetups load:subnode Content <subnode> \xmlflush{#1}\par \stopxmlsetups
\startbuffer[test] <?xml version="1.0" encoding="UTF-8"?> <root></root> \stopbuffer
\startbuffer[dataset] <?xml version="1.0" encoding="UTF-8"?> <nodes> <subnode>this is subnode-1</subnode> <subnode>this is subnode-2</subnode> <subnode>this is subnode-3</subnode> </nodes> \stopbuffer
\starttext \xmlprocessbuffer{root}{test}{} \hairline \stoptext
___________________________________________________________________________________ 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 ___________________________________________________________________________________
-- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------