Re: [NTG-context] XML - accessing parental children attribute (was: some troubles)

2015-02-17 Thread Hans Hagen
On 2/17/2015 3:25 PM, Procházka Lukáš Ing. - Pontex s. r. o. wrote: Hello, a slightly modified example: t.xml a aa number=111AA/aa ab number=222AB/ab /a and the Ctx source: t.mkiv \startxmlsetups xml:T \xmlfunction{#1}{test} \xmlsetsetup{\xmldocument}{*}{+} %

Re: [NTG-context] XML Processing with Verbatim (VIM-Typing)

2015-02-13 Thread Andreas Schneider
Am 12.02.2015 15:44, schrieb Hans Hagen: so then you have to wikify it (or add it to the t-vim module docu) You are right ofcourse :-) Done: http://wiki.contextgarden.net/Verbatim_XML ___ If your question is of

Re: [NTG-context] XML Processing with Verbatim (VIM-Typing)

2015-02-12 Thread Aditya Mahajan
On Thu, 12 Feb 2015, Hans Hagen wrote: On 2/11/2015 12:15 PM, Andreas Schneider wrote: Am 10.02.2015 22:45, schrieb Hans Hagen: \startluacode function xml.functions.processJSON(t) buffers.assign(foo,\\startJSON\n .. tostring(xml.text(t)) .. \n\\stopJSON) context.getbuffer

Re: [NTG-context] XML Processing with Verbatim (VIM-Typing)

2015-02-12 Thread Hans Hagen
On 2/11/2015 12:15 PM, Andreas Schneider wrote: Am 10.02.2015 22:45, schrieb Hans Hagen: \startluacode function xml.functions.processJSON(t) buffers.assign(foo,\\startJSON\n .. tostring(xml.text(t)) .. \n\\stopJSON) context.getbuffer { foo } end \stopluacode

Re: [NTG-context] XML Processing with Verbatim (VIM-Typing)

2015-02-11 Thread Andreas Schneider
Am 10.02.2015 22:45, schrieb Hans Hagen: \startluacode function xml.functions.processJSON(t) buffers.assign(foo,\\startJSON\n .. tostring(xml.text(t)) .. \n\\stopJSON) context.getbuffer { foo } end \stopluacode \startxmlsetups xml:json \pushcatcodetable

[NTG-context] XML Processing with Verbatim (VIM-Typing)

2015-02-10 Thread Andreas Schneider
Hello, as a few other topics on this Mailing List already discussed, it's not (easily?) possible to use \starttyping\stoptyping within XML setups. If it was simple verbatim, there would be a few workarounds. However, I want to provide formatted verbatim (i.e. \startJSON \stopJSON, after

Re: [NTG-context] XML Processing with Verbatim (VIM-Typing)

2015-02-10 Thread Hans Hagen
On 2/10/2015 5:59 PM, Andreas Schneider wrote: Hello, as a few other topics on this Mailing List already discussed, it's not (easily?) possible to use \starttyping\stoptyping within XML setups. If it was simple verbatim, there would be a few workarounds. However, I want to provide formatted

[NTG-context] XML, XHTML, and HTML export issue with in URL

2014-08-28 Thread Rik Kabel
With the following example, the output xml writer fails to properly transform to the html entity amp; in some urls; \hyphenatedurl works fine. The generated xhtml and html files have this problem as well as more issues with the transformation, including what appears to be mistaken

Re: [NTG-context] XML as source (was: E-books and XML)

2014-08-28 Thread Mica Semrick
The best commercial XML editor is oxygenxml IMHO. If you need free, look at xmlmind. -m On August 27, 2014 7:03:06 AM PDT, Procházka Lukáš Ing. - Pontex s. r. o. l...@pontex.cz wrote: Hello Thomas, I'm just curious: - Which editor(s) (including commercial one(s)) do you usually use to create

Re: [NTG-context] XML, XHTML, and HTML export issue with in URL

2014-08-28 Thread Hans Hagen
On 8/28/2014 6:20 PM, Rik Kabel wrote: With the following example, the output xml writer fails to properly transform to the html entity amp; in some urls; \hyphenatedurl works fine. The generated xhtml and html files have this problem as well as more issues with the transformation, including

[NTG-context] XML as source (was: E-books and XML)

2014-08-27 Thread Procházka Lukáš Ing . - Pontex s . r . o .
Hello Thomas, I'm just curious: - Which editor(s) (including commercial one(s)) do you usually use to create XML source for Ctx? (Under Windows?) - XML input vs. .tex (.cld) source: IMHO, when one needs to program parts of Ctx source, it's better to use TeX source/language combined with Lua

Re: [NTG-context] XML as source (was: E-books and XML)

2014-08-27 Thread Jan Tosovsky
On 2014-08-27 Procházka Lukáš Ing. - Pontex s. r. o. wrote: Which editor(s) (including commercial one(s)) do you usually use to create XML source for Ctx? (Under Windows?) This is IMO the best you can currently get: http://www.oxygenxml.com/xml_author.html - XML input vs. .tex (.cld) source:

Re: [NTG-context] XML and ConTeXt - no XML text showing up in output

2014-01-06 Thread Hans Hagen
On 12/27/2013 1:15 AM, Steve Anderson wrote: I'm following the instructions in http://pragma-ade.com/general/manuals/xml-mkiv.pdf for using XML in ConTeXt. When I run the first example, I get a PDF, but only the hard-coded text string Contents is in the PDF; none of the strings from the XML

[NTG-context] XML and ConTeXt - no XML text showing up in output

2013-12-27 Thread Steve Anderson
I'm following the instructions in http://pragma-ade.com/general/manuals/xml-mkiv.pdf for using XML in ConTeXt. When I run the first example, I get a PDF, but only the hard-coded text string Contents is in the PDF; none of the strings from the XML file are in the PDF. Any ideas? - Steve Mac

[NTG-context] xml selection on attribute expressions

2013-12-03 Thread H. van der Meer
Following an example in the chapter on Expressions and filters for xml-processing one can select on an attribute ‘name’ in the node file name=“whatever”/ file[@name==whatever”]/command(todo) However, I would like to select on a combination of alternatives, so that equivalent are file

Re: [NTG-context] xml selection on attribute expressions

2013-12-03 Thread H. van der Meer
Sorry for the noise, but I just forget to try the obvious and correct solution: \xmlfilter{#1}{file[@name==whatever or @src==whatever]/command(todo)} Must have been a temporary ‘blindness’. Hans van der Meer On 3 dec. 2013, at 10:14, H. van der Meer h.vanderm...@uva.nl wrote: Following

Re: [NTG-context] XML export and font switches

2013-10-13 Thread Hans Hagen
On 10/13/2013 12:42 AM, Marco Patzer wrote: Hi, certain font switches fail when XML export is used. Example: \setupbackend [export=foo.xml] \definehighlight [emph] [style=\ita] %% \bfa works \starttext \ita Foobar%% works Foo \emph{Bar} %% fails \stoptext LuaTeX error

Re: [NTG-context] XML export and font switches

2013-10-13 Thread Marco Patzer
On 2013–10–13 Hans Hagen wrote: On 10/13/2013 12:42 AM, Marco Patzer wrote: Hi, certain font switches fail when XML export is used. Example: \setupbackend [export=foo.xml] \definehighlight [emph] [style=\ita] %% \bfa works \starttext \ita Foobar%% works Foo

Re: [NTG-context] xml attribute trickery possible?

2013-05-07 Thread Hans Hagen
On 5/6/2013 1:53 PM, Meer, H. van der wrote: In the xml setup one may call a command on the current node like: \startxmlsetups xam:define:get \xmlcommand{#1}{}{xmlcommon:whatever} \stopxmlsetups The current node will have attributes and these can be used in the execution of the command

[NTG-context] xml attribute trickery possible?

2013-05-06 Thread Meer, H. van der
In the xml setup one may call a command on the current node like: \startxmlsetups xam:define:get \xmlcommand{#1}{}{xmlcommon:whatever} \stopxmlsetups The current node will have attributes and these can be used in the execution of the command xmlcommon:whatever. The question is the following:

[NTG-context] xml path

2013-04-21 Thread Meer, H. van der
Having for example xml-structure: rootnode node1subnode1../subnode1/node1 node2/ /node3/ /rootnode With the path expression \xmlall{#1}{!node1} the node1 should be suppressed, as happens in case. However, nodes under node1 like subnode1 should be suppressed because

Re: [NTG-context] XML Lua engine in ConTeXt

2013-03-05 Thread Thomas A. Schmitz
On 03/05/2013 10:59 AM, Procházka Lukáš Ing. - Pontex s. r. o. wrote: which XML processing Lua engine is used by ConTeXt? There are more XML processors developed for Lua - LuaXML, LuaExpat etc. Does ConTeXt use one of these or another, or its own - a built-in one? As I'm processing XML tables

[NTG-context] XML and Lua/Ctx

2012-11-14 Thread Procházka Lukáš Ing . - Pontex s . r . o .
Hello, I've read that when Ctx is to process a XML file, the whole XML tree is loaded first and processed as wanted. I'd need to process a XML file which represents an Excel workbook saved as .xml. When working in pure Lua, I'm using Expat library

[NTG-context] XML and Lua/Ctx

2012-11-14 Thread Procházka Lukáš Ing . - Pontex s . r . o .
Hello, I've read that when Ctx is to process a XML file, the whole XML tree is loaded first and processed as wanted. I'd need to process a XML file which represents an Excel workbook saved as .xml. When working in pure Lua, I'm using Expat library

Re: [NTG-context] XML and Lua/Ctx

2012-11-14 Thread luigi scarso
On Wed, Nov 14, 2012 at 4:44 PM, Procházka Lukáš Ing. - Pontex s. r. o. l...@pontex.cz wrote: Hello, I've read that when Ctx is to process a XML file, the whole XML tree is loaded first and processed as wanted. I'd need to process a XML file which represents an Excel workbook saved as

Re: [NTG-context] XML and Lua/Ctx

2012-11-14 Thread Procházka Lukáš Ing . - Pontex s . r . o .
On Wed, 14 Nov 2012 16:50:50 +0100, luigi scarso luigi.sca...@gmail.com wrote: However, this solution cannot be used with Ctx as it causes Ctx to crash. Windows , Linux or MacOS ? WinXP 32b -- Ing. Lukáš Procházka [mailto:l...@pontex.cz] Pontex s. r. o. [mailto:pon...@pontex.cz]

Re: [NTG-context] XML and Lua/Ctx

2012-11-14 Thread luigi scarso
On Wed, Nov 14, 2012 at 4:52 PM, Procházka Lukáš Ing. - Pontex s. r. o. l...@pontex.cz wrote: On Wed, 14 Nov 2012 16:50:50 +0100, luigi scarso luigi.sca...@gmail.com wrote: However, this solution cannot be used with Ctx as it causes Ctx to crash. Windows , Linux or MacOS ? WinXP 32b

Re: [NTG-context] xml cross-references in lua?

2012-09-12 Thread Thomas A. Schmitz
On 09/11/2012 08:18 PM, Hans Hagen wrote: If the number of bib items is not that large hashing does not save much. (In x-xfdf.mkiv you can see another example). \starttext \startbuffer[demo] document bibitem xml:id=hagen2011 authorHans Hagen/author titleThe Meaning of Life Is 42/title

[NTG-context] xml cross-references in lua?

2012-09-11 Thread Thomas A. Schmitz
Hi all, I have a question about xml processing and I think that what I want/need can best be achieved by using lua code, but so far, I'm not really sure how to proceed, so any help from one of the resident lua gurus would be welcome. So: the question. xml allows to provide elements with

Re: [NTG-context] xml cross-references in lua?

2012-09-11 Thread Hans Hagen
On 11-9-2012 19:22, Thomas A. Schmitz wrote: Hi all, I have a question about xml processing and I think that what I want/need can best be achieved by using lua code, but so far, I'm not really sure how to proceed, so any help from one of the resident lua gurus would be welcome. So: the

[NTG-context] xml export with footnote

2012-04-03 Thread Matthew Claus
Greetings all, The document element exported by this small example appears to be prematurely closed. Removing either the footnote or the second chapter will hide the problem. Do I have something wrong here? Thanks, Matt \setupbackend[export=yes] \starttext \startchapter \startsection

[NTG-context] xml manual typo

2012-03-22 Thread Meer, H. van der
I am reporting a typo in the MKIV XML-manual. It can put one on the wrong track. Section 3.7 Setups: \xmlsetup{name}{node} expands setup name and pass node as argument Note that name and node in the parameters are interchanged. It should read: \xmlsetup{node}{name} expands setup name and pass

[NTG-context] xml--verbatim in error?

2012-03-21 Thread Meer, H. van der
I found something that might be an error in the current xml-processing. In the following minimal example een Undefined control sequence error occurs for the \xmldisplayverbatim and \xmlinlineverbatims. The \xmlverbatim doesn't. \startxmldisplayverbatim ...\doinitializeverbatim

[NTG-context] xml error

2012-03-21 Thread Meer, H. van der
lxml-ini.mkiv defines: \unexpanded\def\xmlregisteredsetups {\xmlstarttiming \xmlflushsetups \xmldefaulttotext\xmldocument % after include \xmlstoptiming} but \xmlflushsetups can be found here only, nowhere else in the ConTeXt base-files does a search for it match. Calling

[NTG-context] xml tree extension?

2012-03-14 Thread Meer, H. van der
Is it possible to have the following order of actions? root file name=filename1 file name=filename2 .. /root The file contains an xml-tree starting at fileroot.. At the moment I am processing the files with \xmlprocessfile{fileroot}{filename}{}, but this generate separate node-lists for

[NTG-context] xml file inclusion

2012-01-04 Thread Hans van der Meer
I would like to include files with the following input xml-file root file location=.. other_attributes/file /root In the xmlsetup for file I thought to place a call to \xmlinclude: \startxmlsetups xml:file \xmlinclude{#1}{.}{location} \stopxmlsetups But this does not work and I get

Re: [NTG-context] xml file inclusion

2012-01-04 Thread Hans van der Meer
After a lot of experimenting I finally succeeded including a file with thw \xmlinclude macro. The next hurdle is how to extend the xml tree with its xml contents (if that is possibl, of course). Thus the main file being: ?xml version=1.0 encoding=UTF-8? main .. /main I would like to extend

Re: [NTG-context] xml processing

2012-01-01 Thread Hans Hagen
On 31-12-2011 21:55, Meer, H. van der wrote: Is there a macro to retrieve the name of the file when inside a call to \xmlprocessfile? no, there isn't -- - Hans Hagen | PRAGMA ADE

[NTG-context] xml processing

2011-12-31 Thread Meer, H. van der
Is there a macro to retrieve the name of the file when inside a call to \xmlprocessfile? Hans van der Meer ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist :

Re: [NTG-context] xml attribute conditional

2011-12-14 Thread Jon Crump
@xml:id==string.sub('#N020-18', 2) -     (ll.at and ll.at['xml:id'])==string.sub('#N020-18', 2) ! Missing number, treated as zero. lua error with sub .. not sure what you want t o test here indeed an error will prevent the multipass file to be saved (feature) Hans Thanks Hans, It's

Re: [NTG-context] xml attribute conditional

2011-12-14 Thread Hans Hagen
On 14-12-2011 19:33, Jon Crump wrote: @xml:id==string.sub('#N020-18', 2) - (ll.at and ll.at['xml:id'])==string.sub('#N020-18', 2) ! Missing number, treated as zero. lua error with sub .. not sure what you want t o test here indeed an error will prevent the multipass file to be saved

Re: [NTG-context] xml attribute conditional

2011-12-14 Thread Jon Crump
Hans, Thanks for this. It's almost what I need. I truly appreciate the effort, and it does give me some ideas about things to try. However, if I change your example buffer slightly (for clarity) to this: text div type='a' arab ref target=#N01 foo /ref arab ref target=#N02 bar

Re: [NTG-context] xml attribute conditional

2011-12-13 Thread Hans Hagen
On 13-12-2011 00:48, Jon Crump wrote: All, I have a conditional expression that checks to see if the current node has any ancestor whose xml:id attribute matches a string \xmldoifelse{#1}{ancestor::div[@xml:id='apr_engl']} What I need is a test to see if the current node has any ancestor

Re: [NTG-context] xml attribute conditional

2011-12-13 Thread Jon Crump
Hans et alia, Thanks for helping out with the right xpath expression. That was indeed the problem: div elements in the ancestor axis that had no xml:id attribute. Unfortunately, this doesn't solve my root problem. I have a tei/xml marked up text with English and Arabic sections. For each ref tag

Re: [NTG-context] xml attribute conditional

2011-12-13 Thread Hans Hagen
On 13-12-2011 20:21, Jon Crump wrote: @xml:id==string.sub('#N020-18', 2) - (ll.at and ll.at['xml:id'])==string.sub('#N020-18', 2) ! Missing number, treated as zero. lua error with sub .. not sure what you want t o test here indeed an error will prevent the multipass file to be saved

[NTG-context] xml attribute conditional

2011-12-12 Thread Jon Crump
All, I have a conditional expression that checks to see if the current node has any ancestor whose xml:id attribute matches a string \xmldoifelse{#1}{ancestor::div[@xml:id='apr_engl']} What I need is a test to see if the current node has any ancestor whose xml:id attribute _contains_ a

Re: [NTG-context] xml and lua again

2011-10-28 Thread Thomas A. Schmitz
On 10/27/11 13:05, Hans Hagen wrote: With “tex.dimen[…]” you get the value in scaled points but util-dim.lua provides some functions to convert the value in points, centimeter etc. \starttext \startluacode context.blackrule{ width = number.topoints(tex.dimen[textwidth]/2) } \stopluacode

Re: [NTG-context] xml and lua again

2011-10-28 Thread luigi scarso
On Fri, Oct 28, 2011 at 8:23 AM, Thomas A. Schmitz thomas.schm...@uni-bonn.de wrote: On 10/27/11 13:05, Hans Hagen wrote: With “tex.dimen[…]” you get the value in scaled points but util-dim.lua provides some functions to convert the value in points, centimeter etc. \starttext \startluacode

Re: [NTG-context] xml and lua again

2011-10-28 Thread luigi scarso
On Fri, Oct 28, 2011 at 8:37 AM, luigi scarso luigi.sca...@gmail.com wrote: soryy, typos number.topoints(tex.dimen[textwidth]/2) gives XYZ.ABSpt number.topoints(tex.dimen[textwidth]/2) gives XYZ.ABCpt TeX reads XYZ.ABC.pt and convert to xyzsp and drops sp TeX reads XYZ.ABCpt and convert to

Re: [NTG-context] xml and lua again

2011-10-28 Thread Patrick Gundlach
context.blackrule{ width = number.topoints(tex.dimen[textwidth]/2) } or just tex.dimen[textwidth]/2 .. sp Wait, just so I understand: your solution would imply that tex.dimen[textwidth] holds a number, not a dimension, right? (Because you simply concatenate it with a dimension

Re: [NTG-context] xml and lua again

2011-10-28 Thread Thomas A. Schmitz
On 10/28/11 08:44, Patrick Gundlach wrote: context.blackrule{ width = number.topoints(tex.dimen[textwidth]/2) } or just tex.dimen[textwidth]/2 .. sp Wait, just so I understand: your solution would imply that tex.dimen[textwidth] holds a number, not a dimension, right? (Because you

Re: [NTG-context] xml and lua again

2011-10-28 Thread Wolfgang Schuster
Am 28.10.2011 um 08:55 schrieb Thomas A. Schmitz: Luigi, Patrick, thanks for your explanations! The point of my question was: can I feed the content of tex.dimen[textwidth] directly back to TeX, and the answer to this appears to be no; you need to add some unit to it (otherwise, you get

Re: [NTG-context] xml and lua again

2011-10-28 Thread Hans Hagen
Hi Thomas, thanks for your explanations! The point of my question was: can I feed the content of tex.dimen[textwidth] directly back to TeX, and the answer to this appears to be no; you need to add some unit to it (otherwise, you get an error message). Which was a bit confusing to me at first,

Re: [NTG-context] xml and lua again

2011-10-28 Thread Hans Hagen
On 28-10-2011 10:35, Wolfgang Schuster wrote: Am 28.10.2011 um 08:55 schrieb Thomas A. Schmitz: Luigi, Patrick, thanks for your explanations! The point of my question was: can I feed the content of tex.dimen[textwidth] directly back to TeX, and the answer to this appears to be no; you need

Re: [NTG-context] xml and lua again

2011-10-28 Thread Thomas A. Schmitz
On 10/28/11 10:56, Hans Hagen wrote: Just switch to philosopher mode for a while and ask yourself what implications that would have in the rather fuzzy world of printing. What is a 'real' dimension? What we call points (pt) is in other application also called points but happens to be basepoints

Re: [NTG-context] xml and lua again

2011-10-28 Thread luigi scarso
On Fri, Oct 28, 2011 at 10:56 AM, Hans Hagen pra...@wxs.nl wrote: Hi Thomas, thanks for your explanations! The point of my question was: can I feed the content of tex.dimen[textwidth] directly back to TeX, and the answer to this appears to be no; you need to add some unit to it (otherwise,

Re: [NTG-context] xml and lua again

2011-10-28 Thread Hans Hagen
i.e it's a Lua number -- a floating point. So a kind of conversion can happen between a floating point and a sp number (which has a limited range) Of course Lua has its routines, but probably they differs from TeX If I recall correctly, both use 32 bits, but if you extend to lets say 48 bit

Re: [NTG-context] xml and lua again

2011-10-27 Thread Thomas A. Schmitz
On 10/25/2011 12:27 PM, Thomas A. Schmitz wrote: Wolfgang, Hans, thanks a lot, this works now. Will now try and move the code to a ctxluafile and see if I can make it work again. If not, I'll be back; no good deed goes unpunished... Thomas OK, I'm slowly making progress processing xml in

Re: [NTG-context] xml and lua again

2011-10-27 Thread Wolfgang Schuster
Am 27.10.2011 um 11:23 schrieb Thomas A. Schmitz: On 10/25/2011 12:27 PM, Thomas A. Schmitz wrote: Wolfgang, Hans, thanks a lot, this works now. Will now try and move the code to a ctxluafile and see if I can make it work again. If not, I'll be back; no good deed goes unpunished...

Re: [NTG-context] xml and lua again

2011-10-27 Thread Thomas A. Schmitz
On 10/27/2011 11:53 AM, Wolfgang Schuster wrote: With “tex.dimen[…]” you get the value in scaled points but util-dim.lua provides some functions to convert the value in points, centimeter etc. \starttext \startluacode context.blackrule{ width = number.topoints(tex.dimen[textwidth]/2) }

Re: [NTG-context] xml and lua again

2011-10-27 Thread Hans Hagen
On 27-10-2011 12:32, Thomas A. Schmitz wrote: On 10/27/2011 11:53 AM, Wolfgang Schuster wrote: With “tex.dimen[…]” you get the value in scaled points but util-dim.lua provides some functions to convert the value in points, centimeter etc. \starttext \startluacode context.blackrule{ width =

Re: [NTG-context] xml and lua again

2011-10-25 Thread Thomas A. Schmitz
On 10/24/11 8:48 PM, Hans Hagen wrote: sure, oryou can play with if xml.filter(t,.[@frame=on]) then the x-*.lua show some tricks OK, I'm in my stubborn mode then: why doesn't this work: \startbuffer[test] a nattable frame=on tr td1/td td2/td td3/td td4/td

Re: [NTG-context] xml and lua again

2011-10-25 Thread Wolfgang Schuster
Am 25.10.2011 um 11:43 schrieb Thomas A. Schmitz: On 10/24/11 8:48 PM, Hans Hagen wrote: sure, oryou can play with if xml.filter(t,.[@frame=on]) then the x-*.lua show some tricks OK, I'm in my stubborn mode then: why doesn't this work: […] \startxmlsetups xml:nattable

Re: [NTG-context] xml and lua again

2011-10-25 Thread Hans Hagen
On 25-10-2011 11:43, Thomas A. Schmitz wrote: \startxmlsetups xml:nattable \startluacode if xml.attribute(t, /, frame, off) == on then context(Yes, the frame is really on!) else context(Nope, sorry, it's still off.) end context(true) context.placefigure( { here }, none , function()

Re: [NTG-context] xml and lua again

2011-10-25 Thread Thomas A. Schmitz
On 10/25/11 12:17 PM, Hans Hagen wrote: see Wolfgangs answer anyway, best move the lua code and wrap it in a function document.MyWhatever ... now its get defined each time Hans Wolfgang, Hans, thanks a lot, this works now. Will now try and move the code to a ctxluafile and see if I can

[NTG-context] xml and lpath

2011-10-25 Thread Martin Fechner
Hi all, I'm testing the possibilities of xml and ConTeXt. I was wondering if it is possible to make an extra setup for every text-element. So it would be possible to have an setup in a very flexible way. It should be something like this: \startbuffer[text] a b First text. hiding

Re: [NTG-context] xml and lpath

2011-10-25 Thread Hans Hagen
On 25-10-2011 12:52, Martin Fechner wrote: Hi all, I'm testing the possibilities of xml and ConTeXt. I was wondering if it is possible to make an extra setup for every text-element. So it would be possible to have an setup in a very flexible way. It should be something like this:

Re: [NTG-context] xml and lpath

2011-10-25 Thread Martin Fechner
Am 25.10.2011 14:20, schrieb Hans Hagen: \startxmlsetups xml:hiding \doifelse {\xmlatt{#1}{type}} {begin} { \startnointerference } { \stopnointerference } \stopxmlsetups \starttext \xmlprocessbuffer{main}{text}{} \stoptext maybe it makes sense to have a 'hide' flag built in the serializer

Re: [NTG-context] xml and lua again

2011-10-24 Thread Hans Hagen
On 22-10-2011 18:46, Thomas A. Schmitz wrote: Hi all, again, I'm playing a bit with processing my xml in lua. I want a simple interface for processing tables (I don't need all the power and complexity of cals tables and want to learn something in the process). And I thought that collecting the

Re: [NTG-context] xml and lua again

2011-10-24 Thread Thomas A. Schmitz
On 10/24/2011 12:17 PM, Hans Hagen wrote: why so complex Hi Hans, yes, I'm aware that this procedure is quite silly for this example, this was just for myself, for educational purposes. As soon as the setup becomes more complex, I thought it might be easier to collect and process the

Re: [NTG-context] xml and lua again

2011-10-24 Thread Hans Hagen
On 24-10-2011 14:18, Thomas A. Schmitz wrote: On 10/24/2011 12:17 PM, Hans Hagen wrote: why so complex Hi Hans, yes, I'm aware that this procedure is quite silly for this example, this was just for myself, for educational purposes. As soon as the setup becomes more complex, I thought it

Re: [NTG-context] xml and lua again

2011-10-24 Thread Thomas A. Schmitz
On 10/24/2011 02:26 PM, Hans Hagen wrote: if lxml.att(t, frame) == on then context(Yes, the frame is really on!) else context(Nope, sorry, it's still off.) end I don't really understand what kind of object a call such as lxml.att(t, frame) produces. all lxml.* calls print something to tex, so

Re: [NTG-context] xml and lua again

2011-10-24 Thread Hans Hagen
On 24-10-2011 19:00, Thomas A. Schmitz wrote: On 10/24/2011 02:26 PM, Hans Hagen wrote: if lxml.att(t, frame) == on then context(Yes, the frame is really on!) else context(Nope, sorry, it's still off.) end I don't really understand what kind of object a call such as lxml.att(t, frame)

Re: [NTG-context] xml and lua again

2011-10-23 Thread Peter Rolf
Hi Thomas, Am 22.10.2011 18:46, schrieb Thomas A. Schmitz: Hi all, again, I'm playing a bit with processing my xml in lua. I want a simple interface for processing tables (I don't need all the power and complexity of cals tables and want to learn something in the process). And I thought

Re: [NTG-context] xml and lua again

2011-10-23 Thread Thomas A. Schmitz
Hi Peter, thanks for your reply, and I'll keep the bit about goat milk in mind :-). frame= .. tostring(framestate) It has the advantage of making the example compile. It has the drawback of not doing anything :-) seems to work. Anyhow, if you are planning to do some more complex stuff,

Re: [NTG-context] xml and lua again

2011-10-23 Thread Peter Rolf
Am 23.10.2011 16:37, schrieb Thomas A. Schmitz: Hi Peter, thanks for your reply, and I'll keep the bit about goat milk in mind :-). frame= .. tostring(framestate) It has the advantage of making the example compile. It has the drawback of not doing anything :-) (sadly) true :-) I

Re: [NTG-context] xml and lua again

2011-10-23 Thread Peter Rolf
Am 22.10.2011 18:46, schrieb Thomas A. Schmitz: Hi all, again, I'm playing a bit with processing my xml in lua. I want a simple interface for processing tables (I don't need all the power and complexity of cals tables and want to learn something in the process). And I thought that

[NTG-context] xml and lua again

2011-10-22 Thread Thomas A. Schmitz
Hi all, again, I'm playing a bit with processing my xml in lua. I want a simple interface for processing tables (I don't need all the power and complexity of cals tables and want to learn something in the process). And I thought that collecting the setups in lua might be the easiest way, but

[NTG-context] xml processing in lua

2011-09-26 Thread Thomas A. Schmitz
Hi all, after boring people with xml processing in TeX at the meeting in Bassenge, I'm looking for new challenges and am trying my hand at processing xml in lua. But so far, even the simplest things escape me. Here's an example: \startbuffer[test] a bOne/b cTwo/c /a \stopbuffer

Re: [NTG-context] xml processing in lua

2011-09-26 Thread Wolfgang Schuster
Am 26.09.2011 um 20:57 schrieb Thomas A. Schmitz: Hi all, after boring people with xml processing in TeX at the meeting in Bassenge, I'm looking for new challenges and am trying my hand at processing xml in lua. But so far, even the simplest things escape me. Here's an example:

Re: [NTG-context] xml processing in lua

2011-09-26 Thread Aditya Mahajan
On Mon, 26 Sep 2011, Thomas A. Schmitz wrote: Hi all, after boring people with xml processing in TeX at the meeting in Bassenge, I'm looking for new challenges and am trying my hand at processing xml in lua. But so far, even the simplest things escape me. Here's an example:

Re: [NTG-context] xml processing in lua

2011-09-26 Thread Thomas A. Schmitz
On 09/26/2011 09:15 PM, Aditya Mahajan wrote: On Mon, 26 Sep 2011, Thomas A. Schmitz wrote: Hi all, after boring people with xml processing in TeX at the meeting in Bassenge, I'm looking for new challenges and am trying my hand at processing xml in lua. But so far, even the simplest things

Re: [NTG-context] xml syntax for \externalfigure

2011-06-04 Thread Thomas A. Schmitz
On Jun 4, 2011, at 12:14 AM, Peter Münster wrote: \startluacode function my_externalfigure(file, t) local args_present for k, v in pairs(t) do if v == then t[k] = nil else args_present = true end end

[NTG-context] xml syntax for \externalfigure

2011-06-03 Thread Thomas A. Schmitz
Hi all, I'm pulling my hair - thought this was easy, but turns out to be more difficult. The \externalfigure command can take a width and/or a height parameter, and context will be happy to take either one into account. I'm trying to translate that into xml syntax. Here's a minimal example

Re: [NTG-context] xml syntax for \externalfigure

2011-06-03 Thread Aditya Mahajan
On Fri, 3 Jun 2011, Thomas A. Schmitz wrote: Hi all, I'm pulling my hair - thought this was easy, but turns out to be more difficult. The \externalfigure command can take a width and/or a height parameter, and context will be happy to take either one into account. I'm trying to translate

Re: [NTG-context] xml syntax for \externalfigure

2011-06-03 Thread Thomas A. Schmitz
On Jun 3, 2011, at 9:57 PM, Aditya Mahajan wrote: (untested) \exeternalfigure[...][height=\doifemptyelse{\xmlatt{#1}{height}}{fit}{\xmlatt{#1}{height}}] Aditya Hmm, almost... Gives the dreaded Missing number, treated as zero error. But your fit gave me an idea: this works:

Re: [NTG-context] xml syntax for \externalfigure

2011-06-03 Thread Hans Hagen
On 3-6-2011 10:19, Thomas A. Schmitz wrote: On Jun 3, 2011, at 9:57 PM, Aditya Mahajan wrote: (untested) \exeternalfigure[...][height=\doifemptyelse{\xmlatt{#1}{height}}{fit}{\xmlatt{#1}{height}}] Aditya Hmm, almost... Gives the dreaded Missing number, treated as zero error. But your fit

Re: [NTG-context] xml syntax for \externalfigure

2011-06-03 Thread Thomas A. Schmitz
On Jun 3, 2011, at 10:50 PM, Hans Hagen wrote: On 3-6-2011 10:19, Thomas A. Schmitz wrote: Hmm, almost... Gives the dreaded Missing number, treated as zero error. But your fit gave me an idea: this works: [height=\xmlattdef{#1}{height}{fit}] but only if I have a real dimension as in

Re: [NTG-context] xml syntax for \externalfigure

2011-06-03 Thread Peter Münster
On Fri, Jun 03 2011, Thomas A. Schmitz wrote: Ah, expdoifelse is for expanded doifelse, right? Any examples for such a lua helper? Sounds good, but I still haven't been able to understand how to mix xml and lua code. \startluacode function my_externalfigure(file, t) local args_present

Re: [NTG-context] xml syntax for \externalfigure

2011-06-03 Thread Hans Hagen
On 4-6-2011 12:14, Peter Münster wrote: On Fri, Jun 03 2011, Thomas A. Schmitz wrote: Ah, expdoifelse is for expanded doifelse, right? Any examples for such a lua helper? Sounds good, but I still haven't been able to understand how to mix xml and lua code. \startluacode function

[NTG-context] xml - handling of figures

2011-03-06 Thread R. Ermers, Midden Oosten Perspectief
Dear all, I converted a latex file to xml docbook by means of pandoc. In intend to process the file with context. The first results are very promising. I have some questions on processing graphics. The source file looks like this: inlinemediaobject imageobject

[NTG-context] xml-processing: missing or ungrouped '='

2011-01-07 Thread Achim Jander
Hi all a problem with processing XML data (maybe a lack of knowledge). If in the example below I set the chapter-attributes directly in \startxmlsetups xml:title (commented out) everything is like I expected. Because I have headings to be treated equally in multiple hierarchies I tried to

Re: [NTG-context] xml-processing: missing or ungrouped '='

2011-01-07 Thread Hans Hagen
On 7-1-2011 7:04, Achim Jander wrote: \startxmlsetups xml:title \startchapter[ \xmlcommand{#1}{.}{xml:splitHeader} title=... %number=\xmldoifelse{#1}{/num}{yes}{no}, %works %ownnumber=\xmldoifelse{#1}{/num}{\xmlcommand{#1}{/num}{xml:ueberForceFlush}}{},%works %title={\xmlflush{#1}},%works

[NTG-context] xml: test for attribute

2010-12-13 Thread Thomas Schmitz
Hi all, I thought I had done this and it was easy, but I can't find a solution: I want to test whether a xml tag has an attribute and vary the typeset content accordingly. There used to be \xmldoifelseempty, but that has been commented out (lxml-ini.mkiv). What else could I use? Here's a

Re: [NTG-context] xml: test for attribute

2010-12-13 Thread Hans Hagen
On 13-12-2010 8:58, Thomas Schmitz wrote: Hi all, I thought I had done this and it was easy, but I can't find a solution: I want to test whether a xml tag has an attribute and vary the typeset content accordingly. There used to be \xmldoifelseempty, but that has been commented out

Re: [NTG-context] xml: test for attribute

2010-12-13 Thread Thomas Schmitz
Hans, thanks a lot! On Mon, 13 Dec 2010 21:17:23 +0100 Hans Hagen pra...@wxs.nl wrote: something like this: \doifelse {\xmlatt{#1}{important}} {} { \color[darkblue]{EMPTY: \xmlflush{#1}} } { \color[darkred]{NOTEMPTY: \xmlatt{#1}{important}} } \par Yes, this works! or (untested):

Re: [NTG-context] XML pretty printer?

2010-11-21 Thread Hans Hagen
On 20-11-2010 8:40, Renaud AUBIN wrote: I have a first operational version of my lpeg-based xml pretty printer: http://www.nibua-r.org/gitsnap/pret-xml/ operational means: A remark: I'm currently replacing the current pretty printing interface and the new infrastructure is based on lpeg

Re: [NTG-context] XML pretty printer?

2010-11-20 Thread Renaud AUBIN
Hi ConTeXters, I have a first operational version of my lpeg-based xml pretty printer: http://www.nibua-r.org/gitsnap/pret-xml/ operational means: 1 − That pretty printer will type only partially valid xml file test/other will be considered valid test att=testsome invalid text / is not

Re: [NTG-context] XML pretty printer?

2010-11-20 Thread Renaud AUBIN
Ooops, it's not a detail but I need to precise that if the xml input is not valid (from my custom pret-xml pov), nothing will be processed! Renaud Le 20/11/2010 20:40, Renaud AUBIN a écrit : Hi ConTeXters, I have a first operational version of my lpeg-based xml pretty printer:

Re: [NTG-context] XML pretty printer?

2010-11-20 Thread Renaud AUBIN
+ zip and tar.gz available http://www.nibua-r.org/gitsnap/ I have a first operational version of my lpeg-based xml pretty printer: http://www.nibua-r.org/gitsnap/pret-xml/ ___ If your question is of interest

<    1   2   3   4   5   6   >