Lines Matching refs:element
27 A set of helpful functions for dealing with BeautifulSoup element trees.
67 raise ValueError("Unsupported tag type '%s' for element '%s'" \
77 def find_parent_by_name(element, names):
79 Find the ancestor for an element whose name matches one of those
83 element: A BeautifulSoup Tag corresponding to an XML node
86 A BeautifulSoup element corresponding to the matched parent, or None.
96 # el is now a value pointing to the '<static>' element
98 matching_parents = [i.name for i in element.parents if i.name in names]
105 def find_all_child_tags(element, tag):
112 element: A BeautifulSoup Tag corresponding to an XML node
130 matching_tags = [i for i in element.children if isinstance(i, Tag) and i.name == tag]
133 def find_child_tag(element, tag):
138 element: a BeautifulSoup Tag
155 matching_tags = find_all_child_tags(element, tag)
161 def find_kind(element):
163 Finds the kind Tag ancestor for an element.
166 element: a BeautifulSoup Tag
176 parent_kind = find_parent_by_name(element, kinds)
191 Validate that all <clone> elements point to an existing <entry> element.
253 "missing child element <%s>") \