Talk:Getting Started with XML and ConTeXt using TEXML

From Wiki
Jump to navigation Jump to search

Thank you a lot for the article! I'm happy to see that TeXML becomes popular, and not only because I'm the author, but also because I really believe in the benefits of TeXML. Here are some comments on the article.


I've released a new version of TeXML (1.23.devel) with ConTeXt support. Instead of the environment variable hack to activate the TeXML mode, you use the command line flag:

$ ./texml.py -e utf8 -c in_file.texml out_file.tex
or
$ ./texml.py -e utf8 --context in_file.texml out_file.tex

There is no need to use a lot of "TeXML" elements. It is required only as the root and for text translation tweeking. So instead of

<?xml version="1.0"?>
<TeXML>
  <env name="text">
    <TeXML>Hello World</TeXML>
  </env>
</TeXML>

you'd better use

<?xml version="1.0"?>
<TeXML>
  <env name="text">
    Hello World
  </env>
</TeXML>

Please note that the example documents are not equivalent. If you convert "simple_page.texml" to ConTeXt, you don't get "simple_page.tex".


On tweeking of layout of results. TeXML

<TeXML>
 <cmd name="enableregime">
  <opt>utf</opt>
 </cmd>
 <cmd name="setuppagenumbering">
  <opt>state=stop</opt>
 </cmd>
</TeXML>

produces

\enableregime[utf] \setuppagenumbering[state=stop]

(all in one line). So I'd recommend using an attribute "nlX":

<TeXML>
 <cmd name="enableregime" nl2="1">
  <opt>utf</opt>
 </cmd>
 <cmd name="setuppagenumbering">
  <opt>state=stop</opt>
 </cmd>
</TeXML>

The result is better:

\enableregime[utf]
\setuppagenumbering[state=stop]

Thanks for the corrections. I didn't realize I was adding extra elements. I'll update the pages when I get a chance.