|
Re: migrating from custom tags: msg#00006java.enhydra.xmlc
At 03:27 PM 10/1/2003 -0700, you wrote: Would there be any problem turning that custom tag into a utility class that just returns the whole nested table HTML as one fat String and slapping that into the DOM with a setFooText(fatStringHere) call? Or do we need to create new nodes in the DOM and create every HTML element present in the nested table structure? Well, there is a quick hack you can use that might work for you. However, you get no guarantee of a well formed document since the markup will pass through un-parsed. Anyway, here's the hack if you want to try it.... Node msgPlaceHolder = page.getElementMessage(); Node report = page.createCDATASection(sb.toString()); msgPlaceHolder.getParentNode().replaceChild(report, msgPlaceHolder); You'll have to make sure that you remove any <html>, <head>, or <body> tags from the string of HTML. The alternative is to load your database-stored HTML document as a DOM. In order to do this, you'll have to parse it with an HTML parser such as JTidy, NeckoHTML, or Jivan (which uses NeckoHTML). You could use XMLC's dynamic loading for this purpose, although I believe it expects the data to be loaded from a file located in a configured resource path. I wonder if an enhancement wouldn't be to be able to also allow loading from an InputStream? Anyway, I guess I'd try out the CDATA hack to see if that works first since it is so simple. Jake
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Re: Migrating away from JSP, etc., David Corbin |
|---|---|
| Next by Date: | Re: migrating from custom tags, Matthew Hixson |
| Previous by Thread: | migrating from custom tags, Matthew Hixson |
| Next by Thread: | Re: migrating from custom tags, Matthew Hixson |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |