Beispiel #1
0
func (self *Xbrl) getNodeList(xPath string, root *xml.Node) (nodes *xml.Iter) {
	if root == nil {
		root = self.Root
	}
	path := xml.MustCompile(xPath)

	if exists := path.Exists(root); exists {
		return path.Iter(root)
	}

	return nil
}
Beispiel #2
0
func (self *Xbrl) getNode(xPath string, root *xml.Node) (node *xml.Node) {
	if root == nil {
		root = self.Root
	}
	path := xml.MustCompile(xPath)

	if exists := path.Exists(root); exists {
		iterator := path.Iter(root)

		if iterator.Next() {
			return iterator.Node()
		}
	}
	return nil
}