Using the auto toc needs to be coupled with an xpath expression to specify what the toc items are. The default expression works in most cases but not all. Hence the need to create a custom expression for the document. In your case it isn't working. XPath is basically a way to specify elements in an XML document that meet certain criteria.
Have a look at this
XPath tutorial. It is a bit complicated but it allows for precise matching. ldolse gave a good way to go about figuring out what the XPath needs to match. The only change I would make is to surround the chapters with h1 or h2 tags instead of h2 and h3 because h1 and h2 are detected by the default XPath that way you won't have to make your own.