On 2/25/2016 6:04 AM, mica@silentumbrella.com wrote:
Hi Hans,
I've tried this feature on a very simple TEI XML document.
Issuing the command context --extra=xml --analyze yourfile.xml produces context-extra.pdf, which looks much like the file that Thomas wanted to produce. While this is helpful, I cannot figure out the command to produce the file that Pablo alluded to; any help would be great!
My context version is: $ context --version
mtx-context | ConTeXt Process Management 0.63 mtx-context | mtx-context | main context file: /home/user/.context/tex/texmf-context/tex/context/base/mkiv/context.mkiv mtx-context | current version: 2016.02.24 11:19
Thank you!
-Mica
On 2016-02-24 01:52, Hans Hagen wrote:
On 2/24/2016 10:10 AM, Pablo Rodriguez wrote:
On 02/24/2016 09:20 AM, Hans Hagen wrote:
On 2/23/2016 10:26 PM, Mica Semrick wrote:
Reading the docbook thread earlier today reminded me to ask this:
Is there any feature or script that anyone can share that will read in an XML document and spit out a blank mapping file?
what is a blank mapping file
Just guessing (or that would be useful for me too), a file with the following scheme:
i'm still puzzled what you want
\startxmlsetups xml:blank:map % xml:[filename] would be also fine \xmlsetsetup{\xmldocument} {xml:elements} % all elements used in document listed here {xml:*}
you can use \xmlsetsetup{#1} there which is more neutral unless you target a specific xml tree \xmlsetsetup{#1}{*}{+} % shows \xmlsetsetup{#1}{*}{-} % hides
\xmlsetsetup{\xmldocument} {h2[contains(@class,'author')]} % list also all elements {xml:title:author} % with attributes \stopxmlsetups
\xmlregistersetup{xml:pandoc}
\startxmlsetups xml:elements % basic configuration for elements \xmlflush{#1} \stopxmlsetups
\startxmlsetups xml:title:author % basic configuration for attributes \xmlflush{#1} \stopxmlsetups
I guess that the usefulness of this is not the actual configuration, but to know what you have to configure.
\starttext \startbuffer[bar] <x>foo <y class='author1'>one</y> <y class='author2'>two</y> </x> \stopbuffer \startxmlsetups whatever \xmlsetsetup{#1}{x}{+} \xmlsetsetup{#1}{y}{-} \xmlsetsetup{#1}{y[contains(@class,'author2')]}{+} \stopxmlsetups \xmlregistersetup{whatever} \xmlprocessbuffer{foo}{bar}{} \stoptext i think what you want really depends on your expected input
context --extra=xml --analyze yourfile.xml
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
-- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------