For a flat structure, it's pretty simple. You could write a tag or udf that
takes the struct as an org, and perhaps second arg to define the top level
element. Here is some sample code:

<!--- assume s has some keys --->
<cfsavecontent variable="packet">
<cfoutput>
<root>
<cfloop item="key" collection="#s#">
<#key#>#s[key]#</#key#>
</cfloop>
</root>
</cfoutput>
</cfsavecontent>

This assumes s[key] is a simple value. You could easily change it to a check
for IsStruct, and if true, it calls itself (as a custom tag or udf) which
would make it nest as deep as it needs to.

Does this work?
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to