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
On Thu, 9 Dec 2010 15:20:06 -0800 Jon Crump
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