Re: [NTG-context] Custom XML Export

2015-09-12 Thread Aditya Mahajan

On Sat, 12 Sep 2015, Henning Hraban Ramm wrote:

Do you know a good XSLT processor except Saxon? Its free version is just 
too limited.


Why not just use your favorite programming language; most languages have a 
decent XML parsing library?


Aditya
___
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
___

[NTG-context] Custom XML Export

2015-09-12 Thread Toby Miller
I'm using ConTeXt's export to XML feature, but I'd like more control
over the XML output. Is there a way to define a TeX command that will
output a specific tag (content) around some text in the output?

Ideally I'd like to write a completely custom XML printer; it would be
very simple, but would allow me to define what tags I want for different
things. Is there a way to change the behaviour of the existing one, or
could you recommend a starting point for writing a new one?

Many thanks,

Toby
___
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
___

Re: [NTG-context] Space between both environments

2015-09-12 Thread Fabrice Couvreur
Hi Wolfgang,
Thank you for your help, it works fine.
Fabrice

2015-09-08 20:24 GMT+02:00 Wolfgang Schuster :

> Fabrice Couvreur 
> 8. September 2015 18:29
> Hi,
> @Otared I accept your answer until I can not fix my code, thank you.
>
> A better solution is to increase the space before each environment because
> the part of the title which sticks out of the box does not exist for TeX.
>
> Changing the before value to “before={\blank[line,halfline]}” should be
> enough.
>
> @Woffgang  I have to change the code (how ?) because I realize that the
> text of the second environment exceeds the frame (if you draw it).
>
> Add
>
> maxwidth=\availablehsize,
>
> to your column setup.
>
> Wolfgang
>
>
> ___
> 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
>
> ___
>
___
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
___

Re: [NTG-context] Custom XML Export

2015-09-12 Thread Hans Hagen

On 9/11/2015 4:21 PM, Toby Miller wrote:

I'm using ConTeXt's export to XML feature, but I'd like more control
over the XML output. Is there a way to define a TeX command that will
output a specific tag (content) around some text in the output?


\setupbackend[export=yes]

\definehighlight[this]

\starttext
\startelement[what]
 \this{that}  \input ward
\stopelement
\stoptext

(there are also ways to add extra properties)


Ideally I'd like to write a completely custom XML printer; it would be
very simple, but would allow me to define what tags I want for different
things. Is there a way to change the behaviour of the existing one, or
could you recommend a starting point for writing a new one?


the export resembles the structure used in the source and making each 
aspect configurable not only adds much overhead but is also kind of 
useless as one can easily transform xml into other xml; it's no problem 
to add a few more details here or there , but th emain indea behind the 
export is to have standardized and predictable output that then can be 
either rendered using css or converted (for that the raw file is best).


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Custom XML Export

2015-09-12 Thread Hans Hagen

On 9/12/2015 2:14 PM, luigi scarso wrote:


xsltproc for xslt 1.0, but you are looking for xslt 2.0 , right ?


for regular transformations that's good enough

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Custom XML Export

2015-09-12 Thread luigi scarso
On Sat, Sep 12, 2015 at 2:04 PM, Henning Hraban Ramm  wrote:

> Am 2015-09-12 um 17:37 schrieb Toby Miller :
>
> > I have a few other things I'd like to be able to do with this kind of
> > thing (print '' self-closed tags for example, and add attributes
> > as you say), but I feel bad about posting to the list for them. Is there
> > any documentation for these features at all? I couldn't find any
> > reference to the \startelement command when I looked, but perhaps I'm
> > looking in the wrong place.
> >
> > I'll take your advice and not try to adapt the export system. Now that I
> > can print tags at least I think XML transformation should be able to
> > deal with everything I need if it comes to it.
>
> Hi Toby, have a look at
>
> http://wiki.contextgarden.net/XML
> http://wiki.contextgarden.net/Export
> http://wiki.contextgarden.net/ePub
>
> Since my ePub workflow is now running, I’ll hopefully soon enhance these
> pages...
>
> There’s also a useful manual in
> texmf-context/doc/context/documents/general/manuals/epub-mkiv.pdf
>
> Do you know a good XSLT processor except Saxon? Its free version is just
> too limited.
>
>
xsltproc for xslt 1.0, but you are looking for xslt 2.0 , right ?

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

Re: [NTG-context] Custom XML Export

2015-09-12 Thread Toby Miller


On 12/09/15 13:00, Hans Hagen wrote:
> On 9/12/2015 1:37 PM, Toby Miller wrote:
>> Thank you! That's exactly what I was looking for.
>>
>> I have a few other things I'd like to be able to do with this kind of
>> thing (print '' self-closed tags for example, and add attributes
>> as you say), but I feel bad about posting to the list for them. Is there
>> any documentation for these features at all? I couldn't find any
>> reference to the \startelement command when I looked, but perhaps I'm
>> looking in the wrong place.
>
> \setupbackend[export=yes]
> \setupexport[properties=yes]
>
> \starttext
>  \startelement[test][this=that]whatever\stopelement
> \stoptext
>
> arbitrary empty elements are tricky as there is no content then, so
> that needs thinking
>
> (you can of course abuse \startelement
>
> \startelement[br]x\stopelement
>
> and then remove the x from the exported xml. I'll think about it (no
> time now).
>
> Hans

Makes sense! I think I have what I need for the moment; thanks for your
help.

Toby

>
>
>> I'll take your advice and not try to adapt the export system. Now that I
>> can print tags at least I think XML transformation should be able to
>> deal with everything I need if it comes to it.
>>
>> Toby
>>
>> On 12/09/15 10:53, Hans Hagen wrote:
>>> On 9/11/2015 4:21 PM, Toby Miller wrote:
 I'm using ConTeXt's export to XML feature, but I'd like more control
 over the XML output. Is there a way to define a TeX command that will
 output a specific tag (content) around some text in the
 output?
>>>
>>> \setupbackend[export=yes]
>>>
>>> \definehighlight[this]
>>>
>>> \starttext
>>>  \startelement[what]
>>>   \this{that}  \input ward
>>>  \stopelement
>>> \stoptext
>>>
>>> (there are also ways to add extra properties)
>>>
 Ideally I'd like to write a completely custom XML printer; it would be
 very simple, but would allow me to define what tags I want for
 different
 things. Is there a way to change the behaviour of the existing one, or
 could you recommend a starting point for writing a new one?
>>>
>>> the export resembles the structure used in the source and making each
>>> aspect configurable not only adds much overhead but is also kind of
>>> useless as one can easily transform xml into other xml; it's no
>>> problem to add a few more details here or there , but th emain indea
>>> behind the export is to have standardized and predictable output that
>>> then can be either rendered using css or converted (for that the raw
>>> file is best).
>>>
>>> Hans
>>>
>>> -
>>>Hans Hagen | PRAGMA ADE
>>>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>>>  tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
>>> wiki : http://contextgarden.net
>>> ___
>>>
>>
>> ___
>>
>> 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
>> ___
>>
>>
>
>

___
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
___

Re: [NTG-context] Custom XML Export

2015-09-12 Thread Toby Miller
Thank you! That's exactly what I was looking for.

I have a few other things I'd like to be able to do with this kind of
thing (print '' self-closed tags for example, and add attributes
as you say), but I feel bad about posting to the list for them. Is there
any documentation for these features at all? I couldn't find any
reference to the \startelement command when I looked, but perhaps I'm
looking in the wrong place.

I'll take your advice and not try to adapt the export system. Now that I
can print tags at least I think XML transformation should be able to
deal with everything I need if it comes to it.

Toby

On 12/09/15 10:53, Hans Hagen wrote:
> On 9/11/2015 4:21 PM, Toby Miller wrote:
>> I'm using ConTeXt's export to XML feature, but I'd like more control
>> over the XML output. Is there a way to define a TeX command that will
>> output a specific tag (content) around some text in the
>> output?
>
> \setupbackend[export=yes]
>
> \definehighlight[this]
>
> \starttext
> \startelement[what]
>  \this{that}  \input ward
> \stopelement
> \stoptext
>
> (there are also ways to add extra properties)
>
>> Ideally I'd like to write a completely custom XML printer; it would be
>> very simple, but would allow me to define what tags I want for different
>> things. Is there a way to change the behaviour of the existing one, or
>> could you recommend a starting point for writing a new one?
>
> the export resembles the structure used in the source and making each
> aspect configurable not only adds much overhead but is also kind of
> useless as one can easily transform xml into other xml; it's no
> problem to add a few more details here or there , but th emain indea
> behind the export is to have standardized and predictable output that
> then can be either rendered using css or converted (for that the raw
> file is best).
>
> Hans
>
> -
>   Hans Hagen | PRAGMA ADE
>   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
> ___

___
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
___

Re: [NTG-context] Custom XML Export

2015-09-12 Thread Hans Hagen

On 9/12/2015 1:37 PM, Toby Miller wrote:

Thank you! That's exactly what I was looking for.

I have a few other things I'd like to be able to do with this kind of
thing (print '' self-closed tags for example, and add attributes
as you say), but I feel bad about posting to the list for them. Is there
any documentation for these features at all? I couldn't find any
reference to the \startelement command when I looked, but perhaps I'm
looking in the wrong place.


\setupbackend[export=yes]
\setupexport[properties=yes]

\starttext
 \startelement[test][this=that]whatever\stopelement
\stoptext

arbitrary empty elements are tricky as there is no content then, so that 
needs thinking


(you can of course abuse \startelement

\startelement[br]x\stopelement

and then remove the x from the exported xml. I'll think about it (no 
time now).


Hans



I'll take your advice and not try to adapt the export system. Now that I
can print tags at least I think XML transformation should be able to
deal with everything I need if it comes to it.

Toby

On 12/09/15 10:53, Hans Hagen wrote:

On 9/11/2015 4:21 PM, Toby Miller wrote:

I'm using ConTeXt's export to XML feature, but I'd like more control
over the XML output. Is there a way to define a TeX command that will
output a specific tag (content) around some text in the
output?


\setupbackend[export=yes]

\definehighlight[this]

\starttext
 \startelement[what]
  \this{that}  \input ward
 \stopelement
\stoptext

(there are also ways to add extra properties)


Ideally I'd like to write a completely custom XML printer; it would be
very simple, but would allow me to define what tags I want for different
things. Is there a way to change the behaviour of the existing one, or
could you recommend a starting point for writing a new one?


the export resembles the structure used in the source and making each
aspect configurable not only adds much overhead but is also kind of
useless as one can easily transform xml into other xml; it's no
problem to add a few more details here or there , but th emain indea
behind the export is to have standardized and predictable output that
then can be either rendered using css or converted (for that the raw
file is best).

Hans

-
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


___
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
___




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Custom XML Export

2015-09-12 Thread Henning Hraban Ramm
Am 2015-09-12 um 17:37 schrieb Toby Miller :

> I have a few other things I'd like to be able to do with this kind of
> thing (print '' self-closed tags for example, and add attributes
> as you say), but I feel bad about posting to the list for them. Is there
> any documentation for these features at all? I couldn't find any
> reference to the \startelement command when I looked, but perhaps I'm
> looking in the wrong place.
> 
> I'll take your advice and not try to adapt the export system. Now that I
> can print tags at least I think XML transformation should be able to
> deal with everything I need if it comes to it.

Hi Toby, have a look at

http://wiki.contextgarden.net/XML
http://wiki.contextgarden.net/Export
http://wiki.contextgarden.net/ePub

Since my ePub workflow is now running, I’ll hopefully soon enhance these 
pages...

There’s also a useful manual in 
texmf-context/doc/context/documents/general/manuals/epub-mkiv.pdf

Do you know a good XSLT processor except Saxon? Its free version is just too 
limited.


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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
___

Re: [NTG-context] Custom XML Export

2015-09-12 Thread Hans Hagen

On 9/12/2015 2:04 PM, Henning Hraban Ramm wrote:

Am 2015-09-12 um 17:37 schrieb Toby Miller :


I have a few other things I'd like to be able to do with this kind of
thing (print '' self-closed tags for example, and add attributes
as you say), but I feel bad about posting to the list for them. Is there
any documentation for these features at all? I couldn't find any
reference to the \startelement command when I looked, but perhaps I'm
looking in the wrong place.

I'll take your advice and not try to adapt the export system. Now that I
can print tags at least I think XML transformation should be able to
deal with everything I need if it comes to it.


Hi Toby, have a look at

http://wiki.contextgarden.net/XML
http://wiki.contextgarden.net/Export
http://wiki.contextgarden.net/ePub

Since my ePub workflow is now running, I’ll hopefully soon enhance these 
pages...

There’s also a useful manual in 
texmf-context/doc/context/documents/general/manuals/epub-mkiv.pdf

Do you know a good XSLT processor except Saxon? Its free version is just too 
limited.


I must admit that it's years ago that I really looked into it but we use 
xsltproc for generating the website (each time we update the 
distrubution we regenerate the pages). If I had to transform I'd use 
xsltproc.


http://xmlsoft.org/XSLT/xsltproc2.html

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Custom XML Export

2015-09-12 Thread Toby Miller


On 12/09/15 13:14, Hans Hagen wrote:
> On 9/12/2015 2:04 PM, Henning Hraban Ramm wrote:
>> Am 2015-09-12 um 17:37 schrieb Toby Miller :
>>
>>> I have a few other things I'd like to be able to do with this kind of
>>> thing (print '' self-closed tags for example, and add attributes
>>> as you say), but I feel bad about posting to the list for them. Is
>>> there
>>> any documentation for these features at all? I couldn't find any
>>> reference to the \startelement command when I looked, but perhaps I'm
>>> looking in the wrong place.
>>>
>>> I'll take your advice and not try to adapt the export system. Now
>>> that I
>>> can print tags at least I think XML transformation should be able to
>>> deal with everything I need if it comes to it.
>>
>> Hi Toby, have a look at
>>
>> http://wiki.contextgarden.net/XML
>> http://wiki.contextgarden.net/Export
>> http://wiki.contextgarden.net/ePub
>>
>> Since my ePub workflow is now running, I’ll hopefully soon enhance
>> these pages...
>>
>> There’s also a useful manual in
>> texmf-context/doc/context/documents/general/manuals/epub-mkiv.pdf
>>
>> Do you know a good XSLT processor except Saxon? Its free version is
>> just too limited.
>
> I must admit that it's years ago that I really looked into it but we
> use xsltproc for generating the website (each time we update the
> distrubution we regenerate the pages). If I had to transform I'd use
> xsltproc.
>
> http://xmlsoft.org/XSLT/xsltproc2.html
>
> Hans

Thanks for the suggestions. I had found those pages, but I'll keep
watching them for updates.

I hadn't particularly planned how I would do the XML transformation, and
I haven't done it before, but a quick Google would suggest xsltproc too,
and that's what I'll start with if I need to.

Toby
___
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
___

Re: [NTG-context] Custom XML Export

2015-09-12 Thread Henning Hraban Ramm
Am 2015-09-12 um 18:14 schrieb luigi scarso :

>> Do you know a good XSLT processor except Saxon? Its free version is just too 
>> limited.
> 
> xsltproc for xslt 1.0, but you are looking for xslt 2.0 , right ?

More like 3.0, I guess ;)
No, the only extension from commercial Saxon that I would need are global 
variables.

I didn’t yet dive into xsltproc’s (libxml2’s) documentation to see what might 
be possible.

E.g. if I don’t markup all my paragraphs (because it clutters the source too 
much and is tedious), I get s between the original paragraphs. I could 
convert these to HTML s like:


0











1

0



Maybe there’s another solution, but I’m not comfortable enough in XSL to see it.


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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
___