On 17 déc, 02:52, jchimene <[email protected]> wrote:
> Hi,
>
> I'm running the results of RichTextArea.getHTML() through xsltproc.
> It's complaining about unclosed tags. The culprit seems to be the
> break tag:
> <report>
>         <case>
>                 <condition><span style="background-color: green;">some
> text</span><br></condition>
>         </case>
> </report>
>
> doesn't parse (parser error : Opening and ending tag mismatch: br line
> xxx and condition)
>
> When I convert to:
> <report>
>         <case>
>                 <condition><span style="background-color: green;">some
> text</span><br/></condition>
>         </case>
> </report>
>
> happiness ensues.
>
> Any thoughts?

HTML is not XML; XHTML would be, but that's not what browsers give you
(why should they?)

Either use an HTML parser (http://about.validator.nu/htmlparser/ ) and
then serialize back to XML; or try to get XML in the first place (put
RichTextArea.getHTML() result in a hidden div with setInnerHTML and
then walk the DOM tree, building XML in a StringBuilder --should be
much faster than replicating the tree in a com.google.gwt.xml.client.*
tree that you would serialize back)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to