Bug#505442: Tags containing tags named the same cause BeautifulStoneSoup problems

2011-02-13 Thread Stefano Rivera
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
  rawnamefindmefollow/rawname
  nameFollow Me/name
  version2.5.1.7/version
  depends
version2.5.0alpha1/version
modulerecordings ge 3.3.8/module
  /depends
  locationrelease/2.5/findmefollow-2.5.1.7.tgz/location
/module
)

print soup.prettify()


Bug#505442: Tags containing tags named the same cause BeautifulStoneSoup problems

2008-11-12 Thread Daniel Watkins
Package: python-beautifulsoup
Version: 3.0.7-1
Severity: normal

Take, for example:
module
  rawnamefindmefollow/rawname
  nameFollow Me/name
  version2.5.1.7/version
  depends
version2.5.0alpha1/version
modulerecordings ge 3.3.8/module
  /depends
  locationrelease/2.5/findmefollow-2.5.1.7.tgz/location
/module

BeautifulStoneSoup parses this as:

module
  rawnamefindmefollow/rawname
  nameFollow Me/name
  version2.5.1.7/version
  depends
version2.5.0alpha1/version
  /depends
/module
modulerecordings ge 3.3.8/module
locationrelease/2.5/findmefollow-2.5.1.7.tgz/location

which is incorrect.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.24-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages python-beautifulsoup depends on:
ii  python2.5.2-3An interactive high-level object-o
ii  python-support0.8.7  automated rebuilding support for P

python-beautifulsoup recommends no packages.

python-beautifulsoup suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]