Good evening,
On 2010-03-07 <13:52:34>, Taco Hoekwater wrote: > >\startxmlsetups xml:afile > > \section{Filename \xmlatt{#1}{file}} > > %\xmlinclude{test} { } {\xmlatt{#1}{file}} > > %\xmlinclude{test} {/*} {\xmlatt{#1}{file}} > > %\xmlinclude{test} {/sect} {\xmlatt{#1}{file}} > > %\xmlinclude{test} {/sect/title} {\xmlatt{#1}{file}} > > \xmlinclude{test} {sect} {\xmlatt{#1}{file}} > >\stopxmlsetups > > > >Where “test” is the name of the document to be processed and "sect” is > >the outermost node from the included file. > > > >This produces nothing, but try uncommenting some lines: context fails > >with a lua error. Why this? xml-mkiv says that the second argument to > >\xmlinclude should be an lpath from “file” and <sect> is the first node > >in the file (I'll attach it). > > I don't pretend to understand all of XML processing, but I believe > \xmlinclude works like this: take the file that is pointed to by > the named attribute #3 from the node pointed to by lpath #2 in > tree #1. > So in this case, you would have \xmlinclude{test}{afile}{file}. Yes, that did it. I thoroughly confused the notion of “lpath” in xml-mkiv.pdf. > But I have no idea what then happens with the generated tree :-/ It's processed on the spot where <afile file="incfile"/> is found. The document should contain \xmlprependsetup{xml:afile} somewhere, too (lxml-ini.mkiv, line 115). > To actually make use of inc.xml in the current document, perhaps > \xmlprocessfile is what you are after? [...] snip That's actually what troubled me in the first mail of this thread. I don't think \xmlprocessfile is intended to include files this way. Thanks again, Philipp PS: XML in ConTeXt rocks! > > Best wishes, > Taco > > > > ___________________________________________________________________________________ > 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 > ___________________________________________________________________________________ -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
pgpXKhJs9HRXu.pgp
Description: PGP signature
___________________________________________________________________________________ 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 ___________________________________________________________________________________