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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -