From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/82388 Path: news.gmane.org!not-for-mail From: "Meer, H. van der" Newsgroups: gmane.comp.tex.context Subject: Re: makeing xml-node Date: Tue, 7 May 2013 19:12:59 +0000 Message-ID: References: <75DBFCB9-3C78-4A15-9268-B465C01CCF98@uva.nl> <51893C56.8070201@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0880998440==" X-Trace: ger.gmane.org 1367954002 6426 80.91.229.3 (7 May 2013 19:13:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 May 2013 19:13:22 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue May 07 21:13:22 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UZnKB-0001V7-Eu for gctc-ntg-context-518@m.gmane.org; Tue, 07 May 2013 21:13:19 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 253AA101EB; Tue, 7 May 2013 21:13:18 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id kcu9l0+AmBD4; Tue, 7 May 2013 21:13:16 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 73FCD101E7; Tue, 7 May 2013 21:13:16 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6E714101E7 for ; Tue, 7 May 2013 21:13:15 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 2TVHpfXYPzpg for ; Tue, 7 May 2013 21:13:11 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 3185A101E0 for ; Tue, 7 May 2013 21:13:00 +0200 (CEST) Original-Received: from HUB02.uva.nl (hub02.uva.nl [146.50.108.231]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r47JD0t3007495 for ; Tue, 7 May 2013 21:13:00 +0200 Original-Received: from MBX02.uva.nl ([169.254.2.121]) by HUB02.uva.nl ([2002:9232:6ce7::9232:6ce7]) with mapi id 14.02.0342.003; Tue, 7 May 2013 21:12:59 +0200 Thread-Topic: [NTG-context] makeing xml-node Thread-Index: AQHOS0nnSUr5GRY5xUWfiOlfYKZaQpj59aoA In-Reply-To: <51893C56.8070201@wxs.nl> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [82.95.102.36] X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=146.50.108.231; country=NL; region=07; city=Amsterdam; latitude=52.3500; longitude=4.9167; http://maps.google.com/maps?q=52.3500,4.9167&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0QJx7d0SK - 0098f18ee8dc - 20130507 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:82388 Archived-At: --===============0880998440== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_E71EF2B4BF8447A59F1F24F0B3B81135uvanl_" --_000_E71EF2B4BF8447A59F1F24F0B3B81135uvanl_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Alas, this does not solve the problem, iff I am following your suggestion c= orrectly. I did \xmlloadbuffer{thebuffer}{\xmlatt{#1}{buffer}} \xmlfilter{thebuffer}{*/context()} \useMPgraphic.. This works for a buffer content enclosed in any node: \startbuffer[ychannel] <=3D=3D=3D=3D=3D=3D=3D=3D=3D cannot be omitted \startuseMPgraphic{}{} .. \stopuseMPgraphic <=3D=3D=3D=3D=3D=3D=3D=3D=3D cannot be omitted \stopbuffer But it does not work when the content is not enclosed in a node, which is m= y input case: \startbuffer[ychannel] \startuseMPgraphic{}{} .. \stopuseMPgraphic \stopbuffer Now the xml is judged invalid by running it. In the case of a file there is a circumvention through directlua. There I c= an os.execute a chain of commands: echo "" >tmp;cat file >>tmp;echo "= " >>tmp and then \xmlprocessfile the tmp. A bit of a kludge, I am rea= dy to admit, but working. But I don't see how to do this with buffers. Hans van der Meer On 7 May 2013, at 7:39 PM, Hans Hagen >= wrote: On 5/7/2013 5:30 PM, Meer, H. van der wrote: With \xmlload{myroot}{file} I can load an xml file and the execute on its n= odes. However what to do if the file is not of the form file-contents? In that case it would help if I could contruct a node with with some action= s like: \input{fileconytents and then operate with xml commands on tha= t node. Can this be accomplished? you can just filter the node .. \xmlfilter{#myroot}{/some/element ..... --_000_E71EF2B4BF8447A59F1F24F0B3B81135uvanl_ Content-Type: text/html; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable Alas, this does not solve the problem, iff I am following your suggestion c= orrectly.

I did
\xmlloadbuffer{thebuffer}{\xmlatt{#1}{buffer}}
\xmlfilter{thebuffer}{*/context()}
\useMPgraphic..

This works for a buffer content enclosed in any node:
\startbuffer[ychannel]
<anyone>  <=3D=3D=3D=3D=3D=3D=3D=3D=3D cannot be omitted=
\startuseMPgraphic{}{}
..
\stopuseMPgraphic
</anyone>  <=3D=3D=3D=3D=3D=3D=3D=3D=3D cannot be o= mitted
\stopbuffer

But it does not work when the content is not enclosed in a node, which= is my input case:
\startbuffer[ychannel]
\startuseMPgraphic{}{}
..
\stopuseMPgraphic
\stopbuffer
Now the xml is judged invalid by running it.

In the case of a file there is a circumvention through directlua. Ther= e I can os.execute a chain of commands: echo "<node>" >t= mp;cat file >>tmp;echo "<node>" >>tmp and then = \xmlprocessfile the tmp. A bit of a kludge, I am ready to admit, but workin= g. But I don't see how to do this with buffers.

Hans van der Meer



On 7 May 2013, at 7:39 PM, Hans Hagen <pragma@wxs.nl> wrote:

On 5/7/2013 5:30 PM, Meer, H. van der wrote:
With \xmlload{myroot}{file} I can load an xml file and the execute on its n= odes.
However what to do if the file is not of the form <root>file-contents= </root>?
In that case it would help if I could contruct a node with with some action= s like:
<root>\input{fileconytents</root> and then operate with xml com= mands on that <root> node.

Can this be accomplished?

you can just filter the node ..

\xmlfilter{#myroot}{/some/element .....

--_000_E71EF2B4BF8447A59F1F24F0B3B81135uvanl_-- --===============0880998440== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0880998440==--