Reputation: 455
I am parsing an html message which may contain user-defined tags, e.g. <usertag uservalue="value" />
.
I am using standard Html.fromHtml() function to parse the html source. Unfortunately it simply ignores non-standard tags and remove these from the output. I would like to keep them.
I've tried to supply my own TagHandler to the fromHtml() function, but I do not know what to do inside the handleTag() function. Looks like I do not have access to the non-standard tag attributes\content from the TagHandler.handleTag() function? How do I use xmlReader passed inside fromHtml()?
Thanks
Upvotes: 1
Views: 2401
Reputation: 1007554
I am parsing an html message which may contain user-defined tags, e.g.
<usertag uservalue="value" />
.
Then you do not have HTML.
Here are some options:
<div>
and <span>
with class
attributes, as the microformats people do)Html.fromHtml()
Upvotes: 1
Reputation: 11669
From what we can see in the javadoc, there seems to be 4 parameters :
It looks like you can't use the attributes, though.
One last solution, although a little bit complicated, would be to reimplement Html
to suit your needs. You can find its source here.
Upvotes: 0