我有一个包含一些HTML片段如以下示例的输入String
如何使用groovy将某些HTML片段转换为XHTML?
I would have enever thought that <b>those infamous tags</b>,
born in the <abbr title="Don't like that acronym">SGML</abbr> realm,
would make their way into the web of objects that we now experience.
显然,实际之一是通过复杂得多(包括链接,iamges,div的,等等),并且我想写具有以下原型的方法
String toXHTML(String html) {
// What do I have to write here ?
}
退房这样的回答:http://stackoverflow.com/questions/3024488/xmlslurper-nekohtml-document-fragment-parsing-no-html-or-body-tags-wanted – sbglasius