tag 505442 + upstream
severity 505442 minor
thanks

> BeautifulStoneSoup parses this as
...
> which is incorrect.

Yes but BeautifulSoup doesn't claim to be an accurate XML parser. You'll
have to tell it that module can be nested inside module.depends.

According to its documentation:
| The BeautifulSoup class is full of web-browser-like heuristics for
| divining the intent of HTML authors. But XML doesn't have a fixed tag
| set, so those heuristics don't apply. So BeautifulSoup doesn't do XML
| very well.

However, your example XML does appear to be parsed correctly by
BeautifulSoup trunk. Example script attached.

SR

-- 
Stefano Rivera
  http://tumbleweed.org.za/
  H: +27 21 465 6908 C: +27 72 419 8559  UCT: x3127
#!/usr/bin/env python
import beautifulsoup

soup = beautifulsoup.BeautifulStoneSoup("""
<module>
  <rawname>findmefollow</rawname>
  <name>Follow Me</name>
  <version>2.5.1.7</version>
  <depends>
    <version>2.5.0alpha1</version>
    <module>recordings ge 3.3.8</module>
  </depends>
  <location>release/2.5/findmefollow-2.5.1.7.tgz</location>
</module>
""")

print soup.prettify()

Reply via email to