Overview | File | Class | Tree | Index | Help
| Jala 1.3
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class jala.HtmlDocument

    Object
       |
       +--jala.HtmlDocument

class jala.HtmlDocument

This class provides easy access to the elements of an arbitrary HTML document. By using TagSoup, Dom4J and Jaxen even invalid HTML can be parsed, turned into an object tree and easily be processed with XPath expressions.
Defined in HtmlDocument.js

Constructor Summary
`jala.HtmlDocument (<String> source)` Construct a new HTML document.

Method Summary
`Array` | `getAll(<String> elementName)` Retrieves all elements by name from the document.
`Array` | `getLinks()` Get all link elements of the HTML document.
`org.dom4j.tree.DefaultElement` | `scrape(<String> xpathExpr)` Get all document nodes from an XPath expression.
`String` | `toString()` Get a string representation of the HTML document.

Constructor Detail

### jala.HtmlDocument

    jala.HtmlDocument(<String> source)

Construct a new HTML document.

Parameters:

`source` - The HTML source code.

Returns:

A new HTML document.

Method Detail

### getAll

    Array getAll(<String> elementName)

Retrieves all elements by name from the document. The returned object structure is compatible for usage in jala.XmlWriter.

Parameters:

`elementName` - The name of the desired element

Returns:

The list of available elements in the document

### getLinks

    Array getLinks()

Get all link elements of the HTML document.

Returns:

A list of link elements.

### scrape

    org.dom4j.tree.DefaultElement scrape(<String> xpathExpr)

Get all document nodes from an XPath expression.

Parameters:

`xpathExpr` - An XPath expression.

Returns:

A list of HTML elements.

### toString

    String toString()

Get a string representation of the HTML document.

Returns:

A string representation of the HTML document.

Overview | File | Class | Tree | Index | Help
| Jala 1.3
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Documentation generated by JSDoc on Tue Jan 8 15:45:31 2008