From: Hans Hagen <pragma@wxs.nl>
To: mica@silentumbrella.com,
mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: TEI to context XML mappings?
Date: Thu, 25 Feb 2016 10:48:53 +0100 [thread overview]
Message-ID: <56CECE05.9090008@wxs.nl> (raw)
In-Reply-To: <443aa07dc7151881c1c039a36987e0ed@silentumbrella.com>
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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2016-02-25 9:48 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-23 21:26 Mica Semrick
2016-02-24 8:20 ` Hans Hagen
2016-02-24 9:10 ` Pablo Rodriguez
2016-02-24 9:52 ` Hans Hagen
2016-02-24 10:11 ` Thomas A. Schmitz
2016-02-24 10:26 ` Hans Hagen
2016-02-24 12:05 ` Thomas A. Schmitz
2016-02-24 14:15 ` Hans Hagen
2016-02-24 14:32 ` Thomas A. Schmitz
2016-02-24 14:51 ` Hans Hagen
2016-02-24 15:57 ` Thomas A. Schmitz
2016-02-24 17:32 ` Mica Semrick
2016-02-24 15:34 ` Mica Semrick
2016-02-24 10:32 ` Pablo Rodriguez
2016-02-25 5:04 ` mica
2016-02-25 9:48 ` Hans Hagen [this message]
2016-02-26 7:52 ` Pablo Rodriguez
2016-02-26 9:00 ` Hans Hagen
2016-02-26 15:39 ` Mica Semrick
2016-06-22 5:12 ` Mica Semrick
2016-08-14 5:03 ` Mica Semrick
2016-08-14 13:38 ` Hans Hagen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56CECE05.9090008@wxs.nl \
--to=pragma@wxs.nl \
--cc=mica@silentumbrella.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).