Use XML (I mean strict XML version of HTML versus XHTML - or use XHTML if you want) instead of HTML and just parse it as XML in CFMX.  You can even embed CFMX-like variables (e.g. #userName#) in the XML and run evaluate over strings before using them (assuming #userName# is within scope) and the variable will be replaced.  You can also put CFSCRIPT in CDATA blocks and execute that as well.
 
You can either just traverse the XML DOM as you need to, or you can write a generic routine like XMLtoCFMX() that you pass the XML to and it returns a CFMX variable with nested arrays and structs.  We do the latter so programmers only need to use the familiar CFMX syntax instead of learning how to traverse an XML DOM.
 
We use this concept for all our form (multi-section and dynamic) and report specifications.
 
Regards,
Gary

 
On 7/7/05, Martin Orth <[EMAIL PROTECTED]> wrote:
Hi Tim,

> I understand your intentions, but I'd really hate to have to maintain
> code like this:
> > <cfset
> > myHTMLPage=createObject("component","xhtmlcomponents.xhtml.html").init(
> > )>
> > <cfset myHead=myHTMLPage.new("head")>
> > <cfset myTitle= myHead.new("title")>
> > <cfset myTitle.set_value("A page")>
> > <cfset myBody=myHTMLPage.new("body")>
> > <cfset myBody.set_Bgcolor("ff00ff")>
> > <cfset myH1=myBody.new("h1")>
> > <cfset myH1String=myH1.new("string")>
> > <cfset myH1String.set_value("Hello world!")>

A parsing fuction would be nice to parse existing html
templates and convert them to an object structure. This
would avoid a lot of code.

Thanks

Martin


---
You are currently subscribed to farcry-dev as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

--- You are currently subscribed to farcry-dev as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to