我可以改变BeautifulSoup的有关转换XML标记为小写的行为呢? [英] Can I change BeautifulSoup's behavior regarding converting XML tags to lowercase?
问题描述
我的工作code解析XML编写的配置文件,其中的XML标记都是大小写混合的情况下显著。美丽的汤似乎转换XML标签默认为小写,我想改变这种行为。
I'm working on code to parse a configuration file written in XML, where the XML tags are mixed case and the case is significant. Beautiful Soup appears to convert XML tags to lowercase by default, and I would like to change this behavior.
我不是第一个问一个问题,关于这个问题[见<一href=\"http://stackoverflow.com/questions/567999/$p$pventing-beautifulsoup-from-converting-my-xml-tags-to-lowercase\">here].不过,我不明白给这个问题,并在BeautifulSoup-3.1.0.1 BeautifulSoup.py答案似乎不包含的任何实例连接codedName
或标记STR .__ __
I'm not the first to ask a question on this subject [see here]. However, I did not understand the answer given to that question and in BeautifulSoup-3.1.0.1 BeautifulSoup.py does not appear to contain any instances of "encodedName
" or "Tag.__str__
"
推荐答案
据伦纳德·理查森,创作者|美丽的汤的维护者,你的无法的。
According to Leonard Richardson, creator|maintainer of Beautiful Soup, you can't.
这篇关于我可以改变BeautifulSoup的有关转换XML标记为小写的行为呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!