You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to sanitize some SVG content and am using Jsoup for that specific case.
It is possible to get an XML Document by using the xmlParser as below:
However, there is no possible way next to clean this XML with a whitelist (Safelist).
It handles the content as if it is HTML.
Is there a way of doing this ? This would be expected with the XML parsing being enabled.
What I need here is preserving case sensitivity on the Attributes and Tags which is only possible when using XML parsing
The text was updated successfully, but these errors were encountered:
Right, the Cleaner right now is designed to take HTML body content and clean that. I had been thinking of adding extra support to clean a complete Document (vs a body fragment). That path would also then support XML Documents.
Another (and for your case, probably better) feature would be to enable case-insensitive attribute checks and output case-preserving HTML. You can almost do that now -- the cleaner checks tag normal names, but does not do that for attributes. So currently through the Cleaner, tag case can be preserved, but not attribute case.
What I need here is preserving case sensitivity on the Attributes and Tags which is only possible when using XML parsing
For just parsing (not the cleaner, as noted above), you can preserve tag and attribute case and still use the HTML parser. E.g.:
Hello,
I'm trying to sanitize some SVG content and am using Jsoup for that specific case.
It is possible to get an XML Document by using the xmlParser as below:
Document document = Jsoup.parse(svg, Parser.xmlParser());
However, there is no possible way next to clean this XML with a whitelist (Safelist).
It handles the content as if it is HTML.
Is there a way of doing this ? This would be expected with the XML parsing being enabled.
What I need here is preserving case sensitivity on the Attributes and Tags which is only possible when using XML parsing
The text was updated successfully, but these errors were encountered: