ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* getting inside xhtml / mkii
@ 2008-05-08 21:32 Jelle Huisman
  2008-05-08 21:55 ` Hans Hagen
  0 siblings, 1 reply; 20+ messages in thread
From: Jelle Huisman @ 2008-05-08 21:32 UTC (permalink / raw)
  To: @mailing list for ConTeXt users

Hello,

I want to process have a rather complicated xhtml file with dictionary 
data containing lots of entries like:

<span class="word" lang="nld">papa</span>
<span class="defenition" lang="en">
    <span class="xlanguagetag" lang="en">Eng </span>
        daddy</span>

I tried to write some code to get the individual data elements into my 
ConTeXt-module, but I didn't succeed. This:

\defineXMLargument [span 
class="word"]{\Mywordstyle{\XMLvar{class="word"}{}}}

for example fails, it gives all the data within all the different 
span's, whereas I want to select the different data items using the 
<span class-attributes (and typeset the different items in different 
ways afterwards). Maybe I miss something obvious, but I would appreciate 
some help to solve this. (BTW: I use MKII for this project)

Thanks,

Jelle

___________________________________________________________________________________
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] 20+ messages in thread

* Re: getting inside xhtml / mkii
  2008-05-08 21:32 getting inside xhtml / mkii Jelle Huisman
@ 2008-05-08 21:55 ` Hans Hagen
  2008-05-09  8:59   ` Jelle Huisman
  0 siblings, 1 reply; 20+ messages in thread
From: Hans Hagen @ 2008-05-08 21:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Jelle Huisman wrote:
> Hello,
> 
> I want to process have a rather complicated xhtml file with dictionary 
> data containing lots of entries like:
> 
> <span class="word" lang="nld">papa</span>
> <span class="defenition" lang="en">
>     <span class="xlanguagetag" lang="en">Eng </span>
>         daddy</span>
> 
> I tried to write some code to get the individual data elements into my 
> ConTeXt-module, but I didn't succeed. This:
> 
> \defineXMLargument [span 
> class="word"]{\Mywordstyle{\XMLvar{class="word"}{}}}


  \defineXMLargument
    [span]
    [class=word]
    {\Mywordstyle{\XMLpar{span}{class}{default-value}}}

> for example fails, it gives all the data within all the different 
> span's, whereas I want to select the different data items using the 
> <span class-attributes (and typeset the different items in different 
> ways afterwards). Maybe I miss something obvious, but I would appreciate 
> some help to solve this. (BTW: I use MKII for this project)

consider switching to context mkiv which gives access to the xml tree

-----------------------------------------------------------------
                                           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] 20+ messages in thread

* Re: getting inside xhtml / mkii
  2008-05-08 21:55 ` Hans Hagen
@ 2008-05-09  8:59   ` Jelle Huisman
  2008-05-09  9:30     ` Wolfgang Schuster
  0 siblings, 1 reply; 20+ messages in thread
From: Jelle Huisman @ 2008-05-09  8:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Thanks Hans, but for this bit of data:
>> <span class="word" lang="nld">papa</span>
this code:
> \defineXMLargument
>     [span]
>     [class=word]
>     {\Mywordstyle{\XMLpar{span}{class}{default-value}}}
>   
applies the \Mywordstyle to the class attribute "word", whereas I'm 
looking for a solution that applies the style to the word included in 
the span element, nl. "papa", and it shouldn't print the attribute 
'word' at all... (maybe my question wasn't clear the first time.)
> consider switching to context mkiv which gives access to the xml tree
I consider doing this for a future project, but I can't do that for this 
project since I need to use XeTeX for Graphite enabled fonts.

Thanks,

Jelle
___________________________________________________________________________________
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] 20+ messages in thread

* Re: getting inside xhtml / mkii
  2008-05-09  8:59   ` Jelle Huisman
@ 2008-05-09  9:30     ` Wolfgang Schuster
  2008-05-09  9:56       ` Jelle Huisman
  0 siblings, 1 reply; 20+ messages in thread
From: Wolfgang Schuster @ 2008-05-09  9:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, May 9, 2008 at 10:59 AM, Jelle Huisman <jelle@jhnet.nl> wrote:
> Thanks Hans, but for this bit of data:
>>> <span class="word" lang="nld">papa</span>
> this code:
>> \defineXMLargument
>>     [span]
>>     [class=word]
>>     {\Mywordstyle{\XMLpar{span}{class}{default-value}}}
>>
> applies the \Mywordstyle to the class attribute "word", whereas I'm
> looking for a solution that applies the style to the word included in
> the span element, nl. "papa", and it shouldn't print the attribute
> 'word' at all... (maybe my question wasn't clear the first time.)
>> consider switching to context mkiv which gives access to the xml tree
> I consider doing this for a future project, but I can't do that for this
> project since I need to use XeTeX for Graphite enabled fonts.

Did this come closer to what you want.

\defineXMLenvironment [span] [class=]
  {\bgroup
   \processaction
     [\XMLpar{span}{class}{}]
     [word=>\let\FormatSpan\bold,
      defenition=>\let\FormatSpan\mono]%
   \FormatSpan}
  {\egroup}


\starttext

\startXMLdata
<span class="word" lang="nld">papa</span>
<span class="defenition" lang="en">
  <span class="xlanguagetag" lang="en">Eng</span>
  daddy
</span>
\stopXMLdata

\stoptext

You should give us more information too help you, how is \Mywordstyle
defined because \defineXMLargument can't be nested.

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


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

* Re: getting inside xhtml / mkii
  2008-05-09  9:30     ` Wolfgang Schuster
@ 2008-05-09  9:56       ` Jelle Huisman
  2008-05-09 10:06         ` Wolfgang Schuster
  0 siblings, 1 reply; 20+ messages in thread
From: Jelle Huisman @ 2008-05-09  9:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Wolfgang Schuster wrote:
> Did this come closer to what you want.
>   
Almost, however I added "xlanguagetag=>\let\FormatSpan\bold" to get to 
the nested span element and that didn't work. Any suggestions?
> \defineXMLenvironment [span] [class=]
>   {\bgroup
>    \processaction
>      [\XMLpar{span}{class}{}]
>      [word=>\let\FormatSpan\bold,
>       defenition=>\let\FormatSpan\mono]%
>   
                xlanguagetag=>\let\FormatSpan\bold % <- this does not 
work (because it is nested?)
>    \FormatSpan}
>   {\egroup}
>
>
> \starttext
>
> \startXMLdata
> <span class="word" lang="nld">papa</span>
> <span class="defenition" lang="en">
>   <span class="xlanguagetag" lang="en">Eng</span>
>   daddy
> </span>
> \stopXMLdata
>
> \stoptext
>
> You should give us more information too help you, how is \Mywordstyle
> defined because \defineXMLargument can't be nested.
\Mywordstyle is a font switch:
\def\Mywordstyle #1{\switchtobodyfont[GentiumItalics] 
#1\switchtobodyfont[Gentium]}

Thanks again,

Jelle
___________________________________________________________________________________
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] 20+ messages in thread

* Re: getting inside xhtml / mkii
  2008-05-09  9:56       ` Jelle Huisman
@ 2008-05-09 10:06         ` Wolfgang Schuster
  2008-05-09 12:53           ` Jelle Huisman
  2008-05-09 13:05           ` Hans Hagen
  0 siblings, 2 replies; 20+ messages in thread
From: Wolfgang Schuster @ 2008-05-09 10:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, May 9, 2008 at 11:56 AM, Jelle Huisman <jelle@jhnet.nl> wrote:
> Wolfgang Schuster wrote:
>> Did this come closer to what you want.
>>
> Almost, however I added "xlanguagetag=>\let\FormatSpan\bold" to get to
> the nested span element and that didn't work. Any suggestions?
>> \defineXMLenvironment [span] [class=]
>>   {\bgroup
>>    \processaction
>>      [\XMLpar{span}{class}{}]
>>      [word=>\let\FormatSpan\bold,
>>       defenition=>\let\FormatSpan\mono]%
>>
>                xlanguagetag=>\let\FormatSpan\bold % <- this does not
> work (because it is nested?)
>>    \FormatSpan}
>>   {\egroup}

\defineXMLenvironment [span] [class=]
 {\bgroup
  \processaction
    [\XMLpar{span}{class}{}]
    [word=>\let\FormatSpan\bold,
     defenition=>\let\FormatSpan\mono,
     xlanguagetag=>\let\FormatSpan\italic]%
  \FormatSpan}
 {\egroup}

>> \starttext
>>
>> \startXMLdata
>> <span class="word" lang="nld">papa</span>
>> <span class="defenition" lang="en">
>>   <span class="xlanguagetag" lang="en">Eng</span>
>>   daddy
>> </span>
>> \stopXMLdata
>>
>> \stoptext
>>
>> You should give us more information too help you, how is \Mywordstyle
>> defined because \defineXMLargument can't be nested.

> \Mywordstyle is a font switch:
> \def\Mywordstyle #1{\switchtobodyfont[GentiumItalics]
> #1\switchtobodyfont[Gentium]}

Do you really want a font switch, isn't a style switch enough in your case
from roman to italic and back.

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


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

* Re: getting inside xhtml / mkii
  2008-05-09 10:06         ` Wolfgang Schuster
@ 2008-05-09 12:53           ` Jelle Huisman
  2008-05-09 13:14             ` Wolfgang Schuster
  2008-05-09 13:05           ` Hans Hagen
  1 sibling, 1 reply; 20+ messages in thread
From: Jelle Huisman @ 2008-05-09 12:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Wolfgang Schuster wrote:
>> \Mywordstyle is a font switch:
>> \def\Mywordstyle #1 {\switchtobodyfont[GentiumItalics]{#1} \switchtobodyfont[Gentium]}
>>     
>
> Do you really want a font switch, isn't a style switch enough in your case
> from roman to italic and back.
Since I also need to be able to switch to a Non-Roman script I do need a 
font switch here (that's also the reason why I use XeTeX and MKII.) 
Anyway when I use \Mywordstyle inside the FormatSpan like this:

    [\XMLpar{span}{class}{}]
    [word=>\let\FormatSpan\Mywordstyle,
     defenition=>\let\FormatSpan\Mywordstyle,
     xlanguagetag=>\let\FormatSpan\Mywordstyle]%

the font change is applied to the "word" and "xlanguagetag"-items, but 
not to the definition-item!?(see attachment) Any idea why and how to 
solve this? (And it looks like there is some unwanted extra space 
inserted between the "word" and "xlanguagetag" as well.)

Jelle

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

[-- Attachment #2: xmltest.pdf --]
[-- Type: application/pdf, Size: 19505 bytes --]

[-- Attachment #3: 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] 20+ messages in thread

* Re: getting inside xhtml / mkii
  2008-05-09 10:06         ` Wolfgang Schuster
  2008-05-09 12:53           ` Jelle Huisman
@ 2008-05-09 13:05           ` Hans Hagen
  2008-05-09 13:54             ` Jelle Huisman
  2008-05-15 11:33             ` Jelle Huisman
  1 sibling, 2 replies; 20+ messages in thread
From: Hans Hagen @ 2008-05-09 13:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Wolfgang Schuster wrote:
> On Fri, May 9, 2008 at 11:56 AM, Jelle Huisman <jelle@jhnet.nl> wrote:
>> Wolfgang Schuster wrote:
>>> Did this come closer to what you want.
>>>
>> Almost, however I added "xlanguagetag=>\let\FormatSpan\bold" to get to
>> the nested span element and that didn't work. Any suggestions?
>>> \defineXMLenvironment [span] [class=]
>>>   {\bgroup
>>>    \processaction
>>>      [\XMLpar{span}{class}{}]
>>>      [word=>\let\FormatSpan\bold,
>>>       defenition=>\let\FormatSpan\mono]%
>>>
>>                xlanguagetag=>\let\FormatSpan\bold % <- this does not
>> work (because it is nested?)
>>>    \FormatSpan}
>>>   {\egroup}
> 
> \defineXMLenvironment [span] [class=]
>  {\bgroup
>   \processaction
>     [\XMLpar{span}{class}{}]
>     [word=>\let\FormatSpan\bold,
>      defenition=>\let\FormatSpan\mono,
>      xlanguagetag=>\let\FormatSpan\italic]%
>   \FormatSpan}
>  {\egroup}

grep for \XMLmapvalue and \XMLval and so ... faster than processaction

-----------------------------------------------------------------
                                           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] 20+ messages in thread

* Re: getting inside xhtml / mkii
  2008-05-09 12:53           ` Jelle Huisman
@ 2008-05-09 13:14             ` Wolfgang Schuster
  2008-05-09 13:57               ` Jelle Huisman
  0 siblings, 1 reply; 20+ messages in thread
From: Wolfgang Schuster @ 2008-05-09 13:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, May 9, 2008 at 2:53 PM, Jelle Huisman <jelle@jhnet.nl> wrote:
> Wolfgang Schuster wrote:
>
> \Mywordstyle is a font switch:
> \def\Mywordstyle #1 {\switchtobodyfont[GentiumItalics]{#1}
> \switchtobodyfont[Gentium]}
>
>
> Do you really want a font switch, isn't a style switch enough in your case
> from roman to italic and back.
>
> Since I also need to be able to switch to a Non-Roman script I do need a
> font switch here (that's also the reason why I use XeTeX and MKII.) Anyway
> when I use \Mywordstyle inside the FormatSpan like this:
>
>     [\XMLpar{span}{class}{}]
>     [word=>\let\FormatSpan\Mywordstyle,
>      defenition=>\let\FormatSpan\Mywordstyle,
>      xlanguagetag=>\let\FormatSpan\Mywordstyle]%
>
> the font change is applied to the "word" and "xlanguagetag"-items, but not
> to the definition-item!?(see attachment) Any idea why and how to solve this?
> (And it looks like there is some unwanted extra space inserted between the
> "word" and "xlanguagetag" as well.)

You could also switch between different typescripts. If you really want to relly
on \switchtobodyfont use it inside of a group because the font switch will be
local to the group and you go back to the global font after the group.

\usetypescript[palatino,times]
\setupbodyfont[palatino]

\defineXMLenvironment [span] [class=]
 {\bgroup
 \processaction
   [\XMLpar{span}{class}{}]
   [word=>\let\FormatSpan\italic,
    defenition=>\let\FormatSpan\bold,
    xlanguagetag=>\def\FormatSpan{\switchtotypeface[times]}]%
 \FormatSpan}
 {\egroup}

\starttext
\startXMLdata

<span class="word" lang="nld">papa</span>

<span class="defenition" lang="en">
 <span class="xlanguagetag" lang="en">Eng</span>
 daddy
</span>

\stopXMLdata

\stoptext

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


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

* Re: getting inside xhtml / mkii
  2008-05-09 13:05           ` Hans Hagen
@ 2008-05-09 13:54             ` Jelle Huisman
  2008-05-15 11:33             ` Jelle Huisman
  1 sibling, 0 replies; 20+ messages in thread
From: Jelle Huisman @ 2008-05-09 13:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hans Hagen wrote:
> grep for \XMLmapvalue and \XMLval and so ... faster than processaction
You mean \mapXMLvalue? (can't find \XMLmapvalue...) Time for example.pdf 
again :-)

Thanks,

Jelle
___________________________________________________________________________________
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] 20+ messages in thread

* Re: getting inside xhtml / mkii
  2008-05-09 13:14             ` Wolfgang Schuster
@ 2008-05-09 13:57               ` Jelle Huisman
  0 siblings, 0 replies; 20+ messages in thread
From: Jelle Huisman @ 2008-05-09 13:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Wolfgang Schuster wrote:
> You could also switch between different typescripts. If you really want to relly
> on \switchtobodyfont use it inside of a group because the font switch will be
> local to the group and you go back to the global font after the group.
Thanks Wolfgang, I'll try the typescripts approach.

Jelle
___________________________________________________________________________________
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] 20+ messages in thread

* Re: getting inside xhtml / mkii
  2008-05-09 13:05           ` Hans Hagen
  2008-05-09 13:54             ` Jelle Huisman
@ 2008-05-15 11:33             ` Jelle Huisman
  2008-05-15 13:07               ` Wolfgang Schuster
  1 sibling, 1 reply; 20+ messages in thread
From: Jelle Huisman @ 2008-05-15 11:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi again,

I'm working on my xhtml file again but somehow I don't get it... 
Consider this bit of xml:

      <body class="dicBody">
            <div class="letHead">
                  <div class="letter">A a</div>

I want to pickup the "A a"-bit and put it in a \chapter. I tried a good 
number of variations like this:

\defineXMLargument [div] \chapter{\XMLpar{div}{class="letter"}{}}

but this does not work. Any hints to solve (and understand!) this would 
be appreciated! Thanks,

Jelle
___________________________________________________________________________________
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] 20+ messages in thread

* Re: getting inside xhtml / mkii
  2008-05-15 11:33             ` Jelle Huisman
@ 2008-05-15 13:07               ` Wolfgang Schuster
  2008-05-15 13:27                 ` Jelle Huisman
  0 siblings, 1 reply; 20+ messages in thread
From: Wolfgang Schuster @ 2008-05-15 13:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, May 15, 2008 at 1:33 PM, Jelle Huisman <jelle@jhnet.nl> wrote:
> Hi again,
>
> I'm working on my xhtml file again but somehow I don't get it...
> Consider this bit of xml:
>
>      <body class="dicBody">
>            <div class="letHead">
>                  <div class="letter">A a</div>
>
> I want to pickup the "A a"-bit and put it in a \chapter. I tried a good
> number of variations like this:
>
> \defineXMLargument [div] \chapter{\XMLpar{div}{class="letter"}{}}
>
> but this does not work. Any hints to solve (and understand!) this would
> be appreciated! Thanks,

You're misusing the div element for something it is not meant, could
you use h1 ... elements in your html and map them to ConTeXt's own
header commands.

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


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

* Re: getting inside xhtml / mkii
  2008-05-15 13:07               ` Wolfgang Schuster
@ 2008-05-15 13:27                 ` Jelle Huisman
  2008-05-15 13:52                   ` Wolfgang Schuster
  0 siblings, 1 reply; 20+ messages in thread
From: Jelle Huisman @ 2008-05-15 13:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Wolfgang Schuster wrote:
> You're misusing the div element for something it is not meant, could
> you use h1 ... elements in your html and map them to ConTeXt's own
> header commands.
Yes, I know that the xhtml is not very nice (if only I could write my 
own xml...) The situation is that I get this file from a customer and I 
want to avoid having to reformat it (for compatibility reasons). That's 
why I try to make it work, but it seems I'm out of luck here... :-(

Jelle
___________________________________________________________________________________
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] 20+ messages in thread

* Re: getting inside xhtml / mkii
  2008-05-15 13:27                 ` Jelle Huisman
@ 2008-05-15 13:52                   ` Wolfgang Schuster
  2008-05-15 19:54                     ` Jelle Huisman
  0 siblings, 1 reply; 20+ messages in thread
From: Wolfgang Schuster @ 2008-05-15 13:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, May 15, 2008 at 3:27 PM, Jelle Huisman <jelle@jhnet.nl> wrote:
> Wolfgang Schuster wrote:
>> You're misusing the div element for something it is not meant, could
>> you use h1 ... elements in your html and map them to ConTeXt's own
>> header commands.

> Yes, I know that the xhtml is not very nice (if only I could write my
> own xml...) The situation is that I get this file from a customer and I
> want to avoid having to reformat it (for compatibility reasons). That's
> why I try to make it work, but it seems I'm out of luck here... :-(

It's not impossible but a pain to achive with MkII, I made a example
but it did not really woth because the XML-Environment for div is
overloaded with the first chapter and you will loose the selection dependent
on the value for class.

\defineXMLenvironment [div] [class=]
  {%\bgroup
   \processaction
     [\XMLpar{div}{class}{}]
     [letHead=>\def\next{\defineXMLargument[div]{\chapter}}]%
   \next}
  {%\egroup
   }

\starttext

\startXMLdata
<body class="dicBody">
  <div class="letHead">
    <div class="letter">A a</div>
  </div>
</body>
\stopXMLdata

\stoptext

If you want to do this project you should consider switching
to MkIV with it's XML setups, they are more powerfull in this
case and sometimes easier to write.

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


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

* Re: getting inside xhtml / mkii
  2008-05-15 13:52                   ` Wolfgang Schuster
@ 2008-05-15 19:54                     ` Jelle Huisman
  2008-05-16  9:54                       ` Wolfgang Schuster
  0 siblings, 1 reply; 20+ messages in thread
From: Jelle Huisman @ 2008-05-15 19:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Wolfgang Schuster wrote:
>> Yes, I know that the xhtml is not very nice (if only I could write my
>> own xml...) The situation is that I get this file from a customer and I
>> want to avoid having to reformat it (for compatibility reasons). That's
>> why I try to make it work, but it seems I'm out of luck here... :-(
>>     
>
> It's not impossible but a pain to achive with MkII, 
It is a pain indeed, I'll try and see if I can reformat the file a bit. 
Thanks for your comments, they were helpful,

Jelle

[-- Attachment #1.2: Type: text/html, Size: 928 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] 20+ messages in thread

* Re: getting inside xhtml / mkii
  2008-05-15 19:54                     ` Jelle Huisman
@ 2008-05-16  9:54                       ` Wolfgang Schuster
  2008-05-16 10:19                         ` Jelle Huisman
  0 siblings, 1 reply; 20+ messages in thread
From: Wolfgang Schuster @ 2008-05-16  9:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, May 15, 2008 at 9:54 PM, Jelle Huisman <jelle@jhnet.nl> wrote:

> Yes, I know that the xhtml is not very nice (if only I could write my
> own xml...) The situation is that I get this file from a customer and I
> want to avoid having to reformat it (for compatibility reasons). That's
> why I try to make it work, but it seems I'm out of luck here... :-(
>
> It's not impossible but a pain to achive with MkII,
>
> It is a pain indeed, I'll try and see if I can reformat the file a bit.
> Thanks for your comments, they were helpful,

You should be switch to MkIV if possible, it is easier to select
the elements and you don't need different commands for normal
div elements as environments or as commands.

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


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

* Re: getting inside xhtml / mkii
  2008-05-16  9:54                       ` Wolfgang Schuster
@ 2008-05-16 10:19                         ` Jelle Huisman
  2008-05-16 10:25                           ` Wolfgang Schuster
  0 siblings, 1 reply; 20+ messages in thread
From: Jelle Huisman @ 2008-05-16 10:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Wolfgang Schuster wrote:
> You should be switch to MkIV if possible, it is easier to select
> the elements and you don't need different commands for normal
> div elements as environments or as commands.
Problem is that I have to use XeTeX for some special fonts, so I have to 
stay with MkII for this project. (Unless there is a way to mix MkII and 
MkIV that would allow me to use the MkIV xml handling together with the 
MkII/XeTeX back end. I guess that would involve using MkIV (at least for 
the xml bit) but shipping the pages to XeTeX rather then to luaTeX. 
Which is not possible, as far as I know...)

Jelle
___________________________________________________________________________________
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] 20+ messages in thread

* Re: getting inside xhtml / mkii
  2008-05-16 10:19                         ` Jelle Huisman
@ 2008-05-16 10:25                           ` Wolfgang Schuster
  2008-05-16 10:41                             ` Jelle Huisman
  0 siblings, 1 reply; 20+ messages in thread
From: Wolfgang Schuster @ 2008-05-16 10:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, May 16, 2008 at 12:19 PM, Jelle Huisman <jelle@jhnet.nl> wrote:
> Wolfgang Schuster wrote:
>> You should be switch to MkIV if possible, it is easier to select
>> the elements and you don't need different commands for normal
>> div elements as environments or as commands.

> Problem is that I have to use XeTeX for some special fonts, so I have to
> stay with MkII for this project. (Unless there is a way to mix MkII and
> MkIV that would allow me to use the MkIV xml handling together with the
> MkII/XeTeX back end. I guess that would involve using MkIV (at least for
> the xml bit) but shipping the pages to XeTeX rather then to luaTeX.
> Which is not possible, as far as I know...)

What special fonts or features do you use with XeTeX which are not
possible with LuaTeX.

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


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

* Re: getting inside xhtml / mkii
  2008-05-16 10:25                           ` Wolfgang Schuster
@ 2008-05-16 10:41                             ` Jelle Huisman
  0 siblings, 0 replies; 20+ messages in thread
From: Jelle Huisman @ 2008-05-16 10:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Wolfgang Schuster wrote:
> What special fonts or features do you use with XeTeX which are not
> possible with LuaTeX.
I need to support Graphite enabled fonts for the rendering of complex 
non-roman scripts [1], Graphite can currently only be used with XeTeX. 
Anyway, I'll reformat my source file to something more readable in MkII. 
In the meantime I'm still interested in ways to mix MkIV xml-support 
into MkII usage or to output from MkIV to XeTeX.

Jelle

[1] http://scripts.sil.org/RenderingGraphite
___________________________________________________________________________________
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] 20+ messages in thread

end of thread, other threads:[~2008-05-16 10:41 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-08 21:32 getting inside xhtml / mkii Jelle Huisman
2008-05-08 21:55 ` Hans Hagen
2008-05-09  8:59   ` Jelle Huisman
2008-05-09  9:30     ` Wolfgang Schuster
2008-05-09  9:56       ` Jelle Huisman
2008-05-09 10:06         ` Wolfgang Schuster
2008-05-09 12:53           ` Jelle Huisman
2008-05-09 13:14             ` Wolfgang Schuster
2008-05-09 13:57               ` Jelle Huisman
2008-05-09 13:05           ` Hans Hagen
2008-05-09 13:54             ` Jelle Huisman
2008-05-15 11:33             ` Jelle Huisman
2008-05-15 13:07               ` Wolfgang Schuster
2008-05-15 13:27                 ` Jelle Huisman
2008-05-15 13:52                   ` Wolfgang Schuster
2008-05-15 19:54                     ` Jelle Huisman
2008-05-16  9:54                       ` Wolfgang Schuster
2008-05-16 10:19                         ` Jelle Huisman
2008-05-16 10:25                           ` Wolfgang Schuster
2008-05-16 10:41                             ` Jelle Huisman

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).