I've been looking over some articles published on context and XML, nameely http://www.pragma-ade.com/show-mag-9.htm. According to this article, there is a Relax schema for an XML version of context. The namespace is 'http://www.pragma-ade.com/rlg/foxet.rng'. This implies that the Relax schema can only be used if using FO, or? I was wondering if could directly convert to the XML at the namespace above and then process the resulting document with context. This would be easier than using the mapping method. Thanks Paul -- ************************ *Paul Tremblay * *phthenry@iglou.com * ************************
Paul Tremblay wrote:
I've been looking over some articles published on context and XML, nameely http://www.pragma-ade.com/show-mag-9.htm.
According to this article, there is a Relax schema for an XML version of context. The namespace is 'http://www.pragma-ade.com/rlg/foxet.rng'.
This implies that the Relax schema can only be used if using FO, or? I was wondering if could directly convert to the XML at the namespace above and then process the resulting document with context.
This would be easier than using the mapping method.
there are several ways to process xml with context and the magazine mentioned just explores a few of them; - here i mostly map xml onto context commands using commands like: \defineXMLenvironment[orderedlist] {\startitemize[n,packed]} {\startitemize} \defineXMLenvironment[unorderedlist] {\startitemize[packed]} {\startitemize} \defineXMLenvironment[item] {\item} {\endgraf} - often we get messy xml, so some clean up is needed on forehand, which we do with either xslt or with scripting - another option is to use foxet and xsl-fo formatted input (texexec --pdf --foxet somefile.fo) but (1) foxet is not yet perfect and (2) fo-based typesetting is suboptimal) The mapping variant discussed in the magazine can be seen as a future xml based layer around the context tex core; a kind xml based typesetting engine so that one can do without tex programming and stick to xml tools (which some prefer) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Wed, Feb 23, 2005 at 09:33:40AM +0100, Hans Hagen wrote:
The mapping variant discussed in the magazine can be seen as a future xml based layer around the context tex core; a kind xml based typesetting engine so that one can do without tex programming and stick to xml tools (which some prefer)
Hans
But my unerstanding is that the mapping technique does not take care of white space. So if I have: <p>Some paragrah in XmL with space </p> This could get converted as: Some paragrah in XmL with space \par Which would produce 3 paragrahs. There is actually a nice small tool TeXML (at sourceforge) that takes care of this problem. It allows you to use an XML to issue TeX commands, and then converts those commands into TeX (or LaTeX or ConText). It takes care of white space. I am one of those people who likes to stick to XML tools, who likes to convert a tree to a tree. I was wondering the best way to do this. It seems that using TeXML is the best way. I just wanted to make sure there was not a more direct way in ConTeXt. Thanks Paul -- ************************ *Paul Tremblay * *phthenry@iglou.com * ************************
Paul Tremblay wrote:
But my unerstanding is that the mapping technique does not take care of white space. So if I have:
<p>Some paragrah in XmL
with
space </p>
This could get converted as:
Some paragrah in XmL
with
space \par
Which would produce 3 paragrahs.
I remember DocBook In Context customization in 2002.... I still think that XML (but not XSL formatting object ) better describe structure rather than presentation (ConTexT it useful for structure AND presentation). For example,spaces inside a xml are dangerous: how can I transform them ? Do I use a newline, a kern , a skip with glue, a space '\ ', a space ' ', a \blank... ? With what amount ? I still think that (xml structure / TeX presentation) is better than (xml structure / xml presentation); TeX is a typographical programming language, maybe not so easy, but ConTeXt is an excellent high-level layer: XML is not a programming language, and has not any typographics issues (XSL FO apart: but I consider it not so good as TeX). By the way, I still think that for stickers (a relative simple tipographical document) an xml layer is really useful and I moving into this directions for my future works; but just typesetting a simple book with (xml structure / xml presentation) seem to me an unnecessary complication. luigi
luigi.scarso said this at Wed, 23 Feb 2005 19:53:01 +0100:
Some paragrah in XmL
with
space \par
Which would produce 3 paragrahs.
I remember DocBook In Context customization in 2002....
Indeed. And since this the whitespace processing is with an XSLT transform, you can notionally keep such processing within the ConTeXt `family': http://www.leverkruid.nl/context/#whitespace ...by \applyXSLTscript commands and the like! No sense in being purist about these things... If a bit of XSLT is the right tool for the job, may as well use that! -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Adam T. Lindsay, Computing Dept. atl@comp.lancs.ac.uk Lancaster University, InfoLab21 +44(0)1524/510.514 Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
On Wed, Feb 23, 2005 at 10:18:59PM +0000, Adam Lindsay wrote:
http://www.leverkruid.nl/context/#whitespace ...by \applyXSLTscript commands and the like!
That assumes you are using xalan as your xslt processor. I use xsltproc. In general, stripping white space in XML is nearly impossible with xslt. That is why the utility TeXML uses SAX to do so.
No sense in being purist about these things... If a bit of XSLT is the right tool for the job, may as well use that! --
Well, since I'm conerting from TEI, I do need a bit of XSLT! Thanks Paul -- ************************ *Paul Tremblay * *phthenry@iglou.com * ************************
Paul Tremblay wrote:
On Wed, Feb 23, 2005 at 10:18:59PM +0000, Adam Lindsay wrote:
http://www.leverkruid.nl/context/#whitespace ...by \applyXSLTscript commands and the like!
That assumes you are using xalan as your xslt processor. I use xsltproc.
Hmm, I haven't found xalan inside context distr: I found base/xtag-xsl.tex: {\executesystemcommand{xsltproc -o #3 #1 #2}}
In general, stripping white space in XML is nearly impossible with xslt. That is why the utility TeXML uses SAX to do so.
it's in python.....wow..... luigi scarso
I poured over the documentation last night, and I want to make sure I reached the right conclusion in thinking that there is no way to put a different header/footer on the first page in ConTeXt. I know that you can suppress the header/footer by various means, such as: \setupheaders[state=high] % or \setuphead[chapter][header=empty] \chapter But I don't believe you can acutally put a different header on the first page, such as: First Page Header ================== Here is the body text for the first page. Rest Header ============= Here is the body text for the rest of the chapter Also, is there any way to do things with the last page in a section? By do things, I mean set different page dimmensions or set up different headers/footers. I am asking these questions because I am coming from fo, and I am looking for the closest ways to mimic its formatting. Thanks Paul
How about
\definetext[chapterstart][header][First Header]
\setuphead[chapter][header=chapterstart]
for starters?
Steve
On Thu, 24 Feb 2005 11:33:11 -0500, phthenry@iglou.com
I poured over the documentation last night, and I want to make sure I reached the right conclusion in thinking that there is no way to put a different header/footer on the first page in ConTeXt.
I know that you can suppress the header/footer by various means, such as:
\setupheaders[state=high] % or \setuphead[chapter][header=empty] \chapter
But I don't believe you can acutally put a different header on the first page, such as:
First Page Header ==================
Here is the body text for the first page.
Rest Header =============
Here is the body text for the rest of the chapter
Also, is there any way to do things with the last page in a section? By do things, I mean set different page dimmensions or set up different headers/footers.
I am asking these questions because I am coming from fo, and I am looking for the closest ways to mimic its formatting.
Thanks
Paul
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
-- Steve Grathwohl || Digital Content Developer Duke University Press Journals || +1 919 687 3634 905 W Main St || Durham, NC 27701 USA
On Thu, Feb 24, 2005 at 11:48:32AM -0500, Steve Grathwohl wrote:
How about
\definetext[chapterstart][header][First Header] \setuphead[chapter][header=chapterstart]
for starters?
Steve
Thanks. Are there any other location keywords besides chapterstart? %??? \definetext[chapterlast][footer][last footer] \setuphead[chapter][footer=chapterlast] Paul -- ************************ *Paul Tremblay * *phthenry@iglou.com * ************************
Paul Tremblay wrote:
On Thu, Feb 24, 2005 at 11:48:32AM -0500, Steve Grathwohl wrote:
How about
\definetext[chapterstart][header][First Header] \setuphead[chapter][header=chapterstart]
for starters?
Steve
Thanks. Are there any other location keywords besides chapterstart?
%???
\definetext[chapterlast][footer][last footer] \setuphead[chapter][footer=chapterlast]
you can have any keyword you want; it's just a reference to what you define and recall later Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Paul Tremblay wrote:
On Wed, Feb 23, 2005 at 09:33:40AM +0100, Hans Hagen wrote:
The mapping variant discussed in the magazine can be seen as a future xml based layer around the context tex core; a kind xml based typesetting engine so that one can do without tex programming and stick to xml tools (which some prefer)
Hans
But my unerstanding is that the mapping technique does not take care of white space. So if I have:
<p>Some paragrah in XmL
with
space </p>
This could get converted as:
Some paragrah in XmL
with
space \par
Which would produce 3 paragrahs.
There is actually a nice small tool TeXML (at sourceforge) that takes care of this problem. It allows you to use an XML to issue TeX commands, and then converts those commands into TeX (or LaTeX or ConText). It takes care of white space.
I am one of those people who likes to stick to XML tools, who likes to convert a tree to a tree. I was wondering the best way to do this. It seems that using TeXML is the best way. I just wanted to make sure there was not a more direct way in ConTeXt.
\starttext \unprotected \defineXMLenvironment [p] {\bgroup\def\obeyedspace{\removeunwantedspaces\space\ignorespaces}\ignorelines} {\egroup} \startbuffer <p>test test test test</p> \stopbuffer \processXMLbuffer \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (7)
-
Adam Lindsay
-
h h extern
-
Hans Hagen
-
luigi.scarso
-
Paul Tremblay
-
phthenry@iglou.com
-
Steve Grathwohl