ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Jon Crump <jjcrump@uw.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: TEI - conTeXt
Date: Fri, 10 Dec 2010 12:00:59 -0800	[thread overview]
Message-ID: <AANLkTikauo+XUUJ9yJcve3DC9dLTCSdk8Kj-OPMgDgYU@mail.gmail.com> (raw)
In-Reply-To: <web-5986558@be2.uni-bonn.de>

Thomas,

Thanks for responding. Yes, thanks to some help from Idris, Khaled, et
alia, I've got an ara-sty.tex environment file that sets up the
Scheherezade font and am getting very nice looking arabic text. I'm
now trying to get my arms around some basic elements of the conTeXt
system for dealing with xml.

Thanks to your TEI tutorial, I've got some good results for flushing
elements identified by tag name and by named attribute like this:

\xmlsetsetup{#1}{head[@type='chapter']}{xml:head:chapter}
\xmlsetsetup{#1}{p}{xml:p}

and the like. I'm now trying to figure out how to address elements in
the tei more precisely, like how to address the content nodes in the
<div xml:id="notes">, like <note xml:id="N012-10">,  in order to use
their contents while setting elements like <ref target="#N012-10">
with a \footnote command (though we may, in fact, need to put these
elsewhere in an 'endnotes' section.).

I've sought in vain for the answers to simple questions like how to
address nodes identified by xml:id. In setting up a minimal example,
I've tried to do this:

with the xml:

<?xml version="1.0" encoding="utf-8"?>
<body>
	<text>
		<div xml:id="a">
			foo
		</div>
		<div xml:id="b">
			bar
		</div>
	</text>
</body>

set foo and not bar. This, for example, does not work:

\startxmlsetups xml:minimalsetups
	\xmlsetsetup{#1}{*}{-}
	\xmlsetsetup{#1}{body|text|div}{xml:*}
	\xmlsetsetup{#1}{div[@xml:id='a']}{xml:div}
\stopxmlsetups

context complaining that xml:id='a' is not a valid lpath expression.
As you can see, I'm not getting some basic things about how to specify
and traverse the xml, much less applying the correct context commands
to get the content and formatting I need.

Another thing I'm going to need to do is to parse the text of certain
element attributes. For example, divs to be set in arabic are
distinguished from divs to be set in latin only by their xml:lang
attributes. I will need to be able to distinguish between ar-Arab,
en-Latn, and possibly also ar-Latn and more complex subtags like
"az-Arab-IR" as specified in
<http://www.rfc-editor.org/rfc/bcp/bcp47.txt>

Any clues you might care to offer, or examples that you know of, would
be gratefully received. I hesitate to attach the xml and tex files I'm
working with here, being unfamiliar with the protocols of the list,
but if it would help to see what I'm trying to work with, I could
certainly do that. More than this, I will certainly post on the wiki
some documentation and examples from this current project once I have
something to contribute that works. I'd like to extend your tutorial
for others who have TEI texts that they would like to typeset; indeed,
making public such documentation in their appropriate fora is part of
the remit of our project.

All at sea in Seattle,
Jon

On Fri, Dec 10, 2010 at 9:57 AM, Thomas Schmitz <tschmit1@uni-bonn.de> wrote:
> On Thu, 9 Dec 2010 15:20:06 -0800
>  Jon Crump <jjcrump@uw.edu> wrote:
>>
>> All,
>>
>> More naive questions about xml and context. I'm finding this slow
>> going and documentation opaque or just thin on the ground.
>
> Before I try and help you with your question: you posted another problem on
> Nov 24 and got replies. Has this issue been solved?
>
>> More practical examples of TEI (or other xml texts)-> ConTeXt -> PDF
>> would sure come in handy.
>>
> You're more than welcome to contribute such examples. Remember, this is a
> volunteer effort.
>
> 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
___________________________________________________________________________________


  reply	other threads:[~2010-12-10 20:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-09 23:20 Jon Crump
2010-12-10 17:57 ` Thomas Schmitz
2010-12-10 20:00   ` Jon Crump [this message]
2010-12-10 20:40     ` Thomas Schmitz
2010-12-11 19:56       ` Jon Crump
2010-12-16  7:34         ` Thomas A. Schmitz

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=AANLkTikauo+XUUJ9yJcve3DC9dLTCSdk8Kj-OPMgDgYU@mail.gmail.com \
    --to=jjcrump@uw.edu \
    --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).