Exemplo n.º 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
}
Exemplo n.º 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
}