* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license. */ require_once '../src/qp.php'; // Begin with an HTML stub document (XHTML, actually), and navigate to the title. qp(QueryPath::HTML_STUB, 'title') // Add some text to the title ->text('Example of QueryPath.') // Now look for the
element ->top('body') // Inside the body, add a title and paragraph. ->append('Test text
') // Now we select the paragraph we just created inside the body ->children('p') // Add a 'class="some-class"' attribute to the paragraph ->attr('class', 'some-class') // And add a style attribute, too, setting the background color. ->css('background-color', '#eee') // Now go back to the paragraph again ->parent() // Before the paragraph and the title, add an empty table. ->prepend('