Parsing multiple head, body tags in document using Sitemesh 3

163 views
Skip to first unread message

Shirish Padalkar

unread,
Nov 7, 2012, 11:19:59 PM11/7/12
to sitemes...@googlegroups.com
Hi all,

I have posted a question on StackOverflow about how to parse a document which can have duplicate head and body tags.


Can you guys have a look at it and try to answer?

Thanks and regards,
Shirish

phamti

unread,
Nov 16, 2012, 12:25:54 AM11/16/12
to sitemes...@googlegroups.com
Hi Shirish,

The purpose behind SiteMesh and with most parsers in general is to work with well formed and syntactically valid html/xml. If you are not already familiar, the W3C is a good place to learn about this.

As such at least with SiteMesh 2 and most likely with SiteMesh 3 there are no configurations to handle a scenario where an html page has two body tags. You can certainly extend SiteMesh as danielbodart pointed out.

I will add to danielbodart's answer with two more suggestions,

A)
When composing with FreeMarker, compose valid html. I am not sure how you are combining the two html files, but that is where I would make adjustments.

B)
If you are using servlets add your own filter before SiteMesh to combine the content of the two body and head tags into one.

Good luck and we would like to hear what you end up doing.
Reply all
Reply to author
Forward
0 new messages