Add wildcard support for node names. Allows selecting of all child nodes with a specific namespace (See issue #4).

This commit is contained in:
jim teeuwen 2011-07-13 05:17:00 +02:00
parent 29e84b1aeb
commit 2a2a591c08
5 changed files with 46 additions and 10 deletions

View file

@ -20,7 +20,23 @@ func TestLoadLocal(t *testing.T) {
}
}
func TestLoadRemote(t *testing.T) {
func TestWildcard(t *testing.T) {
doc := New()
if err := doc.LoadFile("test2.xml"); err != nil {
t.Error(err.String())
return
}
list := doc.SelectNodes("xdc", "*")
if len(list) != 8 {
t.Errorf("Wrong number of child elements. Expected 4, got %d.", len(list))
return
}
}
func _TestLoadRemote(t *testing.T) {
doc := New()
if err := doc.LoadUri("http://blog.golang.org/feeds/posts/default"); err != nil {