findAll

Undocumented in source. Be warned that the author may not have intended to support it.
findAll

Examples

t
{
	enum xmlText =
		`<doc>` ~
			`<test>Test 1</test>` ~
			`<node id="test2">Test 2</node>` ~
			`<node class="test3">Test 3</node>` ~
		`</doc>`;
	auto doc = xmlText.xmlParse();

	assert(doc.find("test"  ).text == "Test 1");
	assert(doc.find("#test2").text == "Test 2");
	assert(doc.find(".test3").text == "Test 3");

	assert(doc.find("doc test").text == "Test 1");
	assert(doc.find("doc>test").text == "Test 1");
	assert(doc.find("doc> test").text == "Test 1");
	assert(doc.find("doc >test").text == "Test 1");
	assert(doc.find("doc > test").text == "Test 1");

	assert(![doc].find("foo").length);
	assert(![doc].find("#foo").length);
	assert(![doc].find(".foo").length);
	assert(![doc].find("doc foo").length);
	assert(![doc].find("foo test").length);

	assert(doc.find("doc > :nth-child(1)").text == "Test 1");
	assert(doc.find("doc > :nth-child(2)").text == "Test 2");
	assert(doc.find("doc > :nth-child(3)").text == "Test 3"

Meta