# [NTG-context] How to process simple HTML files with LuaTeX

Mojca Miklavec mojca.miklavec.lists at gmail.com
Thu Sep 13 15:04:34 CEST 2007

```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:

<html>
<title>My first HTML2ConTeXt</title>
<body>
<h1>Main Title</h1>
<p>Some text ...</p>
<h2>Subtitle</h2>
<p>Some text again ...</p>
<h1>Second title</h1>
<p>... and not much more text here either ...</p>
</body>
</html>

And the failed tries here:

% engine=luatex
\setupcolors[state=start]

\starttext
\xmlgrab{main}{h1}{h1}
\xmlgrab{main}{h2}{h2}

\startxmlsetups h1
\subject{H1: #1}
\stopxmlsetups

\startxmlsetups h2
\subsubject{H2: #1}
\stopxmlsetups

How to grab only the title out of here?