I am attempting to use Beautiful Stone Soup (BSS) to modify existing XML that has case-sensitive tag names. When BSS reads in the XML, it coerces all the tag names to lower case, and I can’t find an easy way to recover the original capitalization pattern when writing it back out to file. This causes problems downstream because the output XML no longer validates against the schema (because schema is expecting the original capitalization). Is there a flag I can set when I first read it in that will tell BSS to treat tag names as case sensitive?
Share
Have you tried ElementTree instead? Beautiful Soup is great for pulling data out of HTML, no doubt. But ElementTree pretty much sets the bar for Pythonic handling of XML.
It has been a while since I needed it, but I don’t remember ET doing anything untoward to my tag names.