java - How to preserve case in jsoup parsing? -
i using jsoup parse html content. after parsing html content, changes camel cased attributes lowercase <svg viewbox='xxxx'>
<svg viewbox='xxxx'>
.
can suggest me how can preserve case while parsing html content using jsoup 1.8.1?
i released jsoup 1.10.1 includes support preserving tag and/or attribute case. can control parsesettings. default html parser continue lower case normalize tags , attributes, , xml parser preserve them. can specify these settings when create parser.
to use xml parser (which preserves case default):
document doc = jsoup.parse(xml, baseurl, parser.xmlparser());
to use html parser , set preserve-case:
parser parser = parser.htmlparser(); parser.settings(new parsesettings(true, true)); // tag, attribute preserve case document doc = parser.parseinput(html, baseurl);
Comments
Post a Comment