On 9/14/07, Hans Hagen wrote:
> Mojca Miklavec wrote:
> > Hello,
> >
> > I was trying to figure out how to process simple HTML files with the
> > new code, but I fail to understand the details. Here's a simple file I
> > would like to process:
> >
> keep in mind that this is still somewhat experimental

Sure :)
That's why I'm sending files for testing :) :) :)

> % best define mappings before loading the file
>
> \startxmlsetups all:html
>      \xmlsetsetup{main}{head|h1|h2}{*}
> \stopxmlsetups
>
> \xmlregistersetup{all:html}
>
> % register this so that it's done for each load
>
> \startxmlsetups h1
>      \subject{\xmlflush{#1}}
> \stopxmlsetups
>
> \startxmlsetups h2
>      \subsubject{\xmlflush{#1}}
> \stopxmlsetups
>
> \startxmlsetups head
>      \startstandardmakeup
>          THIS IS ABOUT: \xmlfilter{main}{/head/title/text()}
>      \stopstandardmakeup
> \stopxmlsetups
>
> % that's it
>
>
> \setupcolors[state=start]
> \setuphead[subject][style=\bfd,color=blue]
> \setuphead[subsubject][style=\bfc,color=blue]
>
> \starttext
>
> \xmlprocess{main}{test.html}{}
>
> \stoptext

Great! This works perfect and seems much easier to write than the old
code, though I still have no idea how to implement some parts of it:
- where to plug in the entities such as  , ≤, ...
- how to catch classes: how to differentiate between <h1>title</h1>
and <h1 class="...">title</h1>
- and some more - there are some simple examples in the attachment
(too long to copy-paste)

Thanks again,
    Mojca

Attachment: frogs.tex
Description: TeX document

Title: Frogs

Frogs

frog.c, frog.cpp, frog.pas, frog.java

If class equals filename, H2 should be treated slightly different.

Some entities cause problems:  , ≤, ≥, ...

Simple table
12
threefour

Constraints

We have X and Y (1 ≤ X, Y ≤ 1000) ...

For xfrog yfrog xfroggie and yfroggie there is a weird line breaking ...

Sample input

4 4
1 1 4 2

2
2 1 3 3
4 3 4 4
4 4
1 1 4 2

1
2 1 3 4
7 6
4 2 7 6

5
4 1 7 1
5 1 5 5
2 4 3 4
7 5 7 5
6 6 6 6
0 0

Sample output

14
no path found
12
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 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
___________________________________________________________________________________

Reply via email to