ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* xml misc
@ 2007-11-01  0:25 Andrea Valle
  2007-11-01  4:47 ` luigi scarso
  2007-11-01  8:23 ` Hans Hagen
  0 siblings, 2 replies; 9+ messages in thread
From: Andrea Valle @ 2007-11-01  0:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2625 bytes --]

Hi to all,

I' ve started playing with xml --> context.
I've read the docs but even if I am able to do some very basic  
operation I'm in troubles doing my first real experiment.

I've  already generated a book from the collection of html help files  
of the SuperCollider language using a cumbersome python script.
But I was guessing that probably using xml mapping would make my life  
easier.

An example file  to be processed is here:
http://supercollider.svn.sourceforge.net/viewvc/supercollider/trunk/ 
build/Help/Style%20Guide/Documentation%20Style%20Guide.html?view=log

The html is w3c compliant and being automatically generated seems to  
be consistent.

I'm able to do easily stuff like this, which is a promising start:

\startenvironment scEnv
\enableregime[utf]
\defineXMLenvironment [body] \starttext \stoptext
%\defineXMLenvironment [style] \starthiding \stophiding
\defineXMLcommand [p] \par
\defineXMLgrouped [b] \bf
\stopenvironment


But:
1. how do I simply skip undesired tags? The \start-\stophiding trick  
(which in any case does not work: why?) was a hack in order to not  
typeset the stile tags
2. how can i map class attributes in order to specify for each of  
them e.g fontname, points, color, indenting?

Thanks as usual

Best

-a-


--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--> andrea.valle@unito.it
--------------------------------------------------


I did this interview where I just mentioned that I read Foucault. Who  
doesn't in university, right? I was in this strip club giving this  
guy a lap dance and all he wanted to do was to discuss Foucault with  
me. Well, I can stand naked and do my little dance, or I can discuss  
Foucault, but not at the same time; too much information.
(Annabel Chong)



--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--> andrea.valle@unito.it
--------------------------------------------------


I did this interview where I just mentioned that I read Foucault. Who  
doesn't in university, right? I was in this strip club giving this  
guy a lap dance and all he wanted to do was to discuss Foucault with  
me. Well, I can stand naked and do my little dance, or I can discuss  
Foucault, but not at the same time; too much information.
(Annabel Chong)





[-- Attachment #1.2: Type: text/html, Size: 12851 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: xml misc
  2007-11-01  0:25 xml misc Andrea Valle
@ 2007-11-01  4:47 ` luigi scarso
  2007-11-02 20:18   ` Andrea Valle
  2007-11-01  8:23 ` Hans Hagen
  1 sibling, 1 reply; 9+ messages in thread
From: luigi scarso @ 2007-11-01  4:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 11/1/07, Andrea Valle <valle@di.unito.it> wrote:
> Hi to all,
>
> I' ve started playing with xml --> context.
> I've read the docs but even if I am able to do some very basic operation I'm
> in troubles doing my first real experiment.
>
> I've  already generated a book from the collection of html help files of the
> SuperCollider language using a cumbersome python script.
> But I was guessing that probably using xml mapping would make my life
> easier.

Indeed, lxml under python is a cool module.
See
http://codespeak.net/lxml/
lxml_in_python  implements also full xpath/xslt

> An example file  to be processed is here:

Please ,if you can, consider luatex+context mkiv; in base folder see
l-xml-edu.lua  lxml-ini.lua  lxml-ini.tex  l-xml.lua
(warning : lxml here has nothing to do with lxml in python, only the same names)
I believe that actually lxml_in_luatex does not implements a full xpath/xslt,
because  not always these are useful in this context.

(If I need a full xpath/xslthere here, then I have a too much complex
xml document, and I preprocessing it with lxml_in_python)

With lxml_in_python_ and lxml_in_luatex_
you can solve all ** reasonable ** problems.
Sometimes only lxml_in_python is need, sometimes only lxm_in_luatex, it depends.

-- 
luigi
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: xml misc
  2007-11-01  0:25 xml misc Andrea Valle
  2007-11-01  4:47 ` luigi scarso
@ 2007-11-01  8:23 ` Hans Hagen
  2007-11-02 20:20   ` Andrea Valle
  1 sibling, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2007-11-01  8:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Andrea Valle wrote:

> The html is w3c compliant and being automatically generated seems to be 
> consistent.
> 
> I'm able to do easily stuff like this, which is a promising start:
> 
> \startenvironment scEnv
> \enableregime[utf]
> \defineXMLenvironment [body] \starttext \stoptext
> %\defineXMLenvironment [style] \starthiding \stophiding
> \defineXMLcommand [p] \par
> \defineXMLgrouped [b] \bf
> \stopenvironment
> 
> 
> But:
> 1. how do I simply skip undesired tags? The \start-\stophiding trick 
> (which in any case does not work: why?) was a hack in order to not 
> typeset the stile tags

these are in fact buffers and buffers work on the unexpanded input stream

\defineXMLignore[style]

> 2. how can i map class attributes in order to specify for each of them 
> e.g fontname, points, color, indenting?

\mapXMLvalue cum suis ... see x-* files for examples

(in mkiv one can use a mixed tree/streem based model)

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
-----------------------------------------------------------------
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: xml misc
  2007-11-01  4:47 ` luigi scarso
@ 2007-11-02 20:18   ` Andrea Valle
  2007-11-02 22:13     ` luigi scarso
  0 siblings, 1 reply; 9+ messages in thread
From: Andrea Valle @ 2007-11-02 20:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3061 bytes --]

Ciao Luigi,

grazie.
I didn't know about lxml. Very goo dto know.
But the idea was to "stay inside" ConTeXt so to be able to generate  
the pdf from inside SuperCollider using the provided  interface to bash.
I'd like to consider luatex, but I'm only a bit scaredby
- installation issued (so I'm waitin for a TeXlive release)
- documentation. (where's lxml_in_luatex documentation? I guess in  
sources)

Best

-a-




On 1 Nov 2007, at 05:47, luigi scarso wrote:

> On 11/1/07, Andrea Valle <valle@di.unito.it> wrote:
>> Hi to all,
>>
>> I' ve started playing with xml --> context.
>> I've read the docs but even if I am able to do some very basic  
>> operation I'm
>> in troubles doing my first real experiment.
>>
>> I've  already generated a book from the collection of html help  
>> files of the
>> SuperCollider language using a cumbersome python script.
>> But I was guessing that probably using xml mapping would make my life
>> easier.
>
> Indeed, lxml under python is a cool module.
> See
> http://codespeak.net/lxml/
> lxml_in_python  implements also full xpath/xslt
>
>> An example file  to be processed is here:
>
> Please ,if you can, consider luatex+context mkiv; in base folder see
> l-xml-edu.lua  lxml-ini.lua  lxml-ini.tex  l-xml.lua
> (warning : lxml here has nothing to do with lxml in python, only  
> the same names)
> I believe that actually lxml_in_luatex does not implements a full  
> xpath/xslt,
> because  not always these are useful in this context.
>
> (If I need a full xpath/xslthere here, then I have a too much complex
> xml document, and I preprocessing it with lxml_in_python)
>
> With lxml_in_python_ and lxml_in_luatex_
> you can solve all ** reasonable ** problems.
> Sometimes only lxml_in_python is need, sometimes only  
> lxm_in_luatex, it depends.
>
> -- 
> luigi
> ______________________________________________________________________ 
> _____________
> 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  : https://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ______________________________________________________________________ 
> _____________

--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--> andrea.valle@unito.it
--------------------------------------------------


I did this interview where I just mentioned that I read Foucault. Who  
doesn't in university, right? I was in this strip club giving this  
guy a lap dance and all he wanted to do was to discuss Foucault with  
me. Well, I can stand naked and do my little dance, or I can discuss  
Foucault, but not at the same time; too much information.
(Annabel Chong)





[-- Attachment #1.2: Type: text/html, Size: 12658 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: xml misc
  2007-11-01  8:23 ` Hans Hagen
@ 2007-11-02 20:20   ` Andrea Valle
  2007-11-03 11:25     ` luigi scarso
  0 siblings, 1 reply; 9+ messages in thread
From: Andrea Valle @ 2007-11-02 20:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1017 bytes --]

Thanks Hans,

On 1 Nov 2007, at 09:23, Hans Hagen wrote:

>
> \defineXMLignore[style]

Ok

> \mapXMLvalue cum suis ... see x-* files for examples

Where? I'm still having difficulties in knowing how to find sources,  
plus on macosx these are typically hidden files so I have to make  
some tricks to have them searchable.

Best

-a-



--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--> andrea.valle@unito.it
--------------------------------------------------


I did this interview where I just mentioned that I read Foucault. Who  
doesn't in university, right? I was in this strip club giving this  
guy a lap dance and all he wanted to do was to discuss Foucault with  
me. Well, I can stand naked and do my little dance, or I can discuss  
Foucault, but not at the same time; too much information.
(Annabel Chong)





[-- Attachment #1.2: Type: text/html, Size: 6103 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: xml misc
  2007-11-02 20:18   ` Andrea Valle
@ 2007-11-02 22:13     ` luigi scarso
  2007-11-05 15:46       ` docs in source, was " Andrea Valle
  0 siblings, 1 reply; 9+ messages in thread
From: luigi scarso @ 2007-11-02 22:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 11/2/07, Andrea Valle <valle@di.unito.it> wrote:
> Ciao Luigi,
>
> grazie.
> I didn't know about lxml. Very goo dto know.
> But the idea was to "stay inside" ConTeXt so to be able to generate the pdf
> from inside SuperCollider using the provided  interface to bash.
Do you mean using \executesystemcommand ?
Be careful, thing can be slow down
> I'd like to consider luatex, but I'm only a bit scaredby
> - installation issued (so I'm waitin for a TeXlive release)
hmm, why don't give it a try ?
You are under linux, isn't it ?
It should be not so difficult to setup a context-mkiv, and
mkiv will be the way .
> - documentation. (where's lxml_in_luatex documentation? I guess in sources)
yes

-- 
luigi
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: xml misc
  2007-11-02 20:20   ` Andrea Valle
@ 2007-11-03 11:25     ` luigi scarso
  2007-11-05 15:40       ` Andrea Valle
  0 siblings, 1 reply; 9+ messages in thread
From: luigi scarso @ 2007-11-03 11:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> macosx these are typically hidden files so I have to make some tricks to
> have them searchable.
>
Ah, macosx , not linux.
BTW
http://minimals.contextgarden.net/
can help to setup a mkiv context

-- 
luigi
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: xml misc
  2007-11-03 11:25     ` luigi scarso
@ 2007-11-05 15:40       ` Andrea Valle
  0 siblings, 0 replies; 9+ messages in thread
From: Andrea Valle @ 2007-11-05 15:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1638 bytes --]

Grazie Luigi,

I'm a bit scared because I'n not a unix person (at least, still) so  
when I encounter some troubles I'm always blocked.

Best

-a-


On 3 Nov 2007, at 12:25, luigi scarso wrote:

>> macosx these are typically hidden files so I have to make some  
>> tricks to
>> have them searchable.
>>
> Ah, macosx , not linux.
> BTW
> http://minimals.contextgarden.net/
> can help to setup a mkiv context
>
> -- 
> luigi
> ______________________________________________________________________ 
> _____________
> 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  : https://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ______________________________________________________________________ 
> _____________

--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--> andrea.valle@unito.it
--------------------------------------------------


I did this interview where I just mentioned that I read Foucault. Who  
doesn't in university, right? I was in this strip club giving this  
guy a lap dance and all he wanted to do was to discuss Foucault with  
me. Well, I can stand naked and do my little dance, or I can discuss  
Foucault, but not at the same time; too much information.
(Annabel Chong)





[-- Attachment #1.2: Type: text/html, Size: 8409 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

* docs in source, was Re:  xml misc
  2007-11-02 22:13     ` luigi scarso
@ 2007-11-05 15:46       ` Andrea Valle
  0 siblings, 0 replies; 9+ messages in thread
From: Andrea Valle @ 2007-11-05 15:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1572 bytes --]

>> - documentation. (where's lxml_in_luatex documentation? I guess in  
>> sources)
> yes

Could anyone write few lines in the wiki to explain how and where to  
extract doc information from sources?
I'm always finding some difficulties in snooping inside ConTeXt
Or if it is discussed on the mailing list I can wikify the results.

Best

-a-





> -- 
> luigi
> ______________________________________________________________________ 
> _____________
> 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  : https://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ______________________________________________________________________ 
> _____________

--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--> andrea.valle@unito.it
--------------------------------------------------


I did this interview where I just mentioned that I read Foucault. Who  
doesn't in university, right? I was in this strip club giving this  
guy a lap dance and all he wanted to do was to discuss Foucault with  
me. Well, I can stand naked and do my little dance, or I can discuss  
Foucault, but not at the same time; too much information.
(Annabel Chong)





[-- Attachment #1.2: Type: text/html, Size: 7847 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-11-05 15:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-01  0:25 xml misc Andrea Valle
2007-11-01  4:47 ` luigi scarso
2007-11-02 20:18   ` Andrea Valle
2007-11-02 22:13     ` luigi scarso
2007-11-05 15:46       ` docs in source, was " Andrea Valle
2007-11-01  8:23 ` Hans Hagen
2007-11-02 20:20   ` Andrea Valle
2007-11-03 11:25     ` luigi scarso
2007-11-05 15:40       ` Andrea Valle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).