TEI to context XML mappings?
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? Thanks! -m
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 ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
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: \startxmlsetups xml:blank:map % xml:[filename] would be also fine \xmlsetsetup{\xmldocument} {xml:elements} % all elements used in document listed here {xml:*} \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. I hope it helps, Pablo -- http://www.ousia.tk
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:
\startxmlsetups xml:blank:map % xml:[filename] would be also fine \xmlsetsetup{\xmldocument} {xml:elements} % all elements used in document listed here {xml:*}
\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.
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 -----------------------------------------------------------------
On 2/24/2016 11:11 AM, Thomas A. Schmitz wrote:
On 02/24/2016 10:52 AM, Hans Hagen wrote:
context --extra=xml --analyze yourfile.xml
Hmm, that sounds great, however, with the latest 'n greatest:
resolvers > modules > 'xml-analyzers' is not found
i added the files to the beta ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 02/24/2016 11:26 AM, Hans Hagen wrote:
i added the files to the beta
Great, it works now and is a fantastic tool! I was thinking of writing something similar myself, but of course, you had already anticipated this wish... I'll try to see if I can make sense of s-xml-analyzers.lua and come up with different visualizations (what I had in mind was a table listing the elements, all elements contained in them and all attributes used). I don't know if the "blank mapping file" as conjectured by Pablo is a useful idea, but I guess it would be trivial to implement that as well. Thanks and all best Thomas
On 2/24/2016 1:05 PM, Thomas A. Schmitz wrote:
On 02/24/2016 11:26 AM, Hans Hagen wrote:
i added the files to the beta
Great, it works now and is a fantastic tool! I was thinking of writing something similar myself, but of course, you had already anticipated this wish... I'll try to see if I can make sense of s-xml-analyzers.lua and come up with different visualizations (what I had in mind was a table listing the elements, all elements contained in them and all attributes used). I don't know if the "blank mapping file" as conjectured by Pablo is a useful idea, but I guess it would be trivial to implement that as well.
if you need more info i can add it ... one can then generate whatever table one wants elements in element .. one level i assume? Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 02/24/2016 03:15 PM, Hans Hagen wrote:
if you need more info i can add it ... one can then generate whatever table one wants
elements in element .. one level i assume?
Yes, one level, otherwise things become too complex. And you're right, it's already there in the "children" element. My question was not so much about the information but about the visualization. Let's put it in a slightly different way: the context parser holds the information about my xml tree as a lua table, right? It would be handy to have a typeset version of this table, as a, well, table, so we could see how to access the different parts of it in lua and/or tex code. So I know that my element is e, I know that it has a table e.at that collects the different attributes in subtables of the form e.at["attribute"]. I assume there's also e.text, e.first etc. Would it be possible to typeset this information for elements. Thomas
On 2/24/2016 3:32 PM, Thomas A. Schmitz wrote:
On 02/24/2016 03:15 PM, Hans Hagen wrote:
if you need more info i can add it ... one can then generate whatever table one wants
elements in element .. one level i assume?
Yes, one level, otherwise things become too complex. And you're right, it's already there in the "children" element. My question was not so much about the information but about the visualization. Let's put it in a slightly different way: the context parser holds the information about my xml tree as a lua table, right? It would be handy to have a typeset version of this table, as a, well, table, so we could see how to access the different parts of it in lua and/or tex code. So I know that my element is e, I know that it has a table e.at that collects the different attributes in subtables of the form e.at["attribute"]. I assume there's also e.text, e.first etc. Would it be possible to typeset this information for elements.
no, there are no such fields \starttext \startluacode local t = xml.load("t:/sources/i-en-xml.xml") print(table.serialize(t,true,{})) -- you need to call this way \stopluacode \stoptext at : attributes ns : namespace rn : remapped namespace tg : tag (@..@ names indicate special tags) dt : text text is a table of strings and elements (there are a few extra private fields and when applying searched there are index fields added) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 02/24/2016 03:51 PM, Hans Hagen wrote:
no, there are no such fields
\starttext
\startluacode local t = xml.load("t:/sources/i-en-xml.xml") print(table.serialize(t,true,{})) -- you need to call this way \stopluacode
\stoptext
at : attributes ns : namespace rn : remapped namespace tg : tag (@..@ names indicate special tags) dt : text
text is a table of strings and elements
(there are a few extra private fields and when applying searched there are index fields added)
Ah wonderful, that's already very useful to have! Thanks for pointing it out! Thomas
I don't know if the "blank mapping file" as conjectured by Pablo is a useful idea
I find extremely useful. When I go to style some XML file, I don't have to type all of that stuff or study the XML file to find out what elements are contained. This feature will make it extremely easy to get something functional very quickly.
-m
On February 24, 2016 4:05:52 AM PST, "Thomas A. Schmitz"
On 02/24/2016 11:26 AM, Hans Hagen wrote:
i added the files to the beta
Great, it works now and is a fantastic tool! I was thinking of writing something similar myself, but of course, you had already anticipated this wish... I'll try to see if I can make sense of s-xml-analyzers.lua
and come up with different visualizations (what I had in mind was a table listing the elements, all elements contained in them and all attributes used). I don't know if the "blank mapping file" as conjectured by Pablo is a useful idea, but I guess it would be trivial to implement that as well.
Thanks and all best
Thomas ___________________________________________________________________________________ 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 ___________________________________________________________________________________
Thank you! And sorry for my poor description.
Best,
Mica
On February 24, 2016 2:26:55 AM PST, Hans Hagen
On 2/24/2016 11:11 AM, Thomas A. Schmitz wrote:
On 02/24/2016 10:52 AM, Hans Hagen wrote:
context --extra=xml --analyze yourfile.xml
Hmm, that sounds great, however, with the latest 'n greatest:
resolvers > modules > 'xml-analyzers' is not found
i added the files to the beta
----------------------------------------------------------------- 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 ___________________________________________________________________________________
On 02/24/2016 10:52 AM, Hans Hagen wrote:
On 2/24/2016 10:10 AM, Pablo Rodriguez wrote:
[...] I guess that the usefulness of this is not the actual configuration, but to know what you have to configure.
context --extra=xml --analyze yourfile.xml
That’s awesome. Many thanks, Hans. (Not tested yet.) Pablo -- http://www.ousia.tk
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:
\startxmlsetups xml:blank:map % xml:[filename] would be also fine \xmlsetsetup{\xmldocument} {xml:elements} % all elements used in document listed here {xml:*}
\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.
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 ___________________________________________________________________________________
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 -----------------------------------------------------------------
On 02/25/2016 10:48 AM, Hans Hagen wrote:
[...] i'm still puzzled what you want
Hans, I’m only guessing (after testing the XML analyzing ability that you discovered us with a single XML file). The analysis is important, but after that I have to write the actual environment. I think that the basic structure that I sent in https://mailman.ntg.nl/pipermail/ntg-context/2016/084582.html is useful to avoid writing myself the environment. I mean, of course I have to add the relevant commands to handle in ConTeXt each element. But with the basic scheme, I know which elements (in the broadest sense) I have to setup. I want to avoid writing the whole element list in the environment by hand. But I may be doing wrong (this is totally new to me). Or do you write (type) each environment from scratch after using the report generated by ConTeXt? Many thanks for your help, Pablo -- http://www.ousia.tk
On 2/26/2016 8:52 AM, Pablo Rodriguez wrote:
On 02/25/2016 10:48 AM, Hans Hagen wrote:
[...] i'm still puzzled what you want
Hans,
I’m only guessing (after testing the XML analyzing ability that you discovered us with a single XML file).
The analysis is important, but after that I have to write the actual environment.
I think that the basic structure that I sent in https://mailman.ntg.nl/pipermail/ntg-context/2016/084582.html is useful to avoid writing myself the environment.
You want to autogenerate that? That could become quite huge (And probably most would be discarded later anyway of you want all permutations of elements and attributes)
I mean, of course I have to add the relevant commands to handle in ConTeXt each element. But with the basic scheme, I know which elements (in the broadest sense) I have to setup.
I want to avoid writing the whole element list in the environment by hand. But I may be doing wrong (this is totally new to me).
Or do you write (type) each environment from scratch after using the report generated by ConTeXt?
We just start with the trivial things and then look at the specific structures. We get either relative simple html like xml or we get quite complex educational markup, with quite demanding rendering and multiple products. The good news is that the number of elements is always limited (analyzing would not really work well because it can be that thousands of files need to be loaded and merged which itself is not a problem, but one then always need to interpret what needs to get loaded). Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
You want to autogenerate that? That could become quite huge (And probably most would be discarded later anyway of you want all permutations of elements and attributes)
Just elements would work for me.
Best,
M
On February 26, 2016 1:00:03 AM PST, Hans Hagen
On 2/26/2016 8:52 AM, Pablo Rodriguez wrote:
On 02/25/2016 10:48 AM, Hans Hagen wrote:
[...] i'm still puzzled what you want
Hans,
I’m only guessing (after testing the XML analyzing ability that you discovered us with a single XML file).
The analysis is important, but after that I have to write the actual environment.
I think that the basic structure that I sent in https://mailman.ntg.nl/pipermail/ntg-context/2016/084582.html is useful to avoid writing myself the environment.
You want to autogenerate that? That could become quite huge (And probably most would be discarded later anyway of you want all permutations of elements and attributes)
I mean, of course I have to add the relevant commands to handle in ConTeXt each element. But with the basic scheme, I know which elements (in the broadest sense) I have to setup.
I want to avoid writing the whole element list in the environment by hand. But I may be doing wrong (this is totally new to me).
Or do you write (type) each environment from scratch after using the report generated by ConTeXt?
We just start with the trivial things and then look at the specific structures. We get either relative simple html like xml or we get quite
complex educational markup, with quite demanding rendering and multiple
products. The good news is that the number of elements is always limited (analyzing would not really work well because it can be that thousands of files need to be loaded and merged which itself is not a problem, but one then always need to interpret what needs to get loaded).
Hans
----------------------------------------------------------------- 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 ___________________________________________________________________________________
After doing some research, I stumbled upon saxon-lint (https://github.com/sputnick-dev/saxon-lint), a perl program capable of using xpath3 expressions. In the crudest form possible: !# /bin/bash for ELM in `saxon-lint.pl --xpath "distinct-values(//*/name())" file.xml` do echo -e "\\startxmlsetups xml:$ELM \n\t \\xmlflush{#1} \n \\stopxmlsetups" done I still need to write $ELM into an array to make it do the following: \startxmlsetups xml:blank:map % xml:[filename] would be also fine \xmlsetsetup{\xmldocument} {xml:elements:from:the:variable:elm} % list the results from saxon-lint {xml:*} \stopxmlsetups That would give me the "blank" mapping file I want, saving me the trouble of typing out the whole thing every time. Best, Mica On 02/24/2016 01: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:
\startxmlsetups xml:blank:map % xml:[filename] would be also fine \xmlsetsetup{\xmldocument} {xml:elements} % all elements used in document listed here {xml:*}
\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.
I hope it helps,
Pablo
After doing some research, I stumbled upon saxon-lint (https://github.com/sputnick-dev/saxon-lint), a perl program
capable of using xpath3 expressions.
In the crudest form possible:
!# /bin/bash
for ELM in `saxon-lint.pl --xpath "distinct-values(//*/name())" file.xml`
do
echo -e "\\startxmlsetups xml:$ELM \n\t \\xmlflush{#1} \n \\stopxmlsetups"
done
I still need to write $ELM into an array to make it do the following:
\startxmlsetups xml:blank:map % xml:[filename] would be also fine
\xmlsetsetup{\xmldocument}
{xml:elements:from:the:variable:elm} % list the results from saxon-lint
{xml:*}
\stopxmlsetups
That would give me the "blank" mapping file I want, saving me the
trouble of typing out the whole thing every time.
Best,
Mica
Pablo Rodriguez
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:
\startxmlsetups xml:blank:map % xml:[filename] would be also fine \xmlsetsetup{\xmldocument} {xml:elements} % all elements used in document listed here {xml:*}
\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.
I hope it helps,
Pablo
On 8/14/2016 7:03 AM, Mica Semrick wrote:
After doing some research, I stumbled upon saxon-lint (https://github.com/sputnick-dev/saxon-lint), a perl program capable of using xpath3 expressions.
In the crudest form possible:
!# /bin/bash for ELM in `saxon-lint.pl http://saxon-lint.pl --xpath "distinct-values(//*/name())" file.xml` do echo -e "\\startxmlsetups xml:$ELM \n\t \\xmlflush{#1} \n \\stopxmlsetups" done
I still need to write $ELM into an array to make it do the following:
\startxmlsetups xml:blank:map % xml:[filename] would be also fine \xmlsetsetup{\xmldocument} {xml:elements:from:the:variable:elm} % list the results from saxon-lint {xml:*} \stopxmlsetups
That would give me the "blank" mapping file I want, saving me the trouble of typing out the whole thing every time.
we already have an analyzer: context --extra=xml --analyze --autopdf music-collection.xml i'll add a --template option for generating a bunch of setups (not the most efficient way to define a mapping but anyway) context --extra=xml --analyze --template --autopdf music-collection.xml
Best, Mica
Pablo Rodriguez
@ 2016-02-24 01:10 PST: 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:
\startxmlsetups xml:blank:map % xml:[filename] would be also fine \xmlsetsetup{\xmldocument} {xml:elements} % all elements used in document listed here {xml:*}
\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.
I hope it helps,
Pablo
___________________________________________________________________________________ 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.nl | www.pragma-pod.nl -----------------------------------------------------------------
participants (5)
-
Hans Hagen
-
Mica Semrick
-
mica@silentumbrella.com
-
Pablo Rodriguez
-
Thomas A. Schmitz