ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xsl-list
xsl-list
[xsl] Re: WDDX Recordset generic simplification
by Eric Pheatt other posts by this author
Nov 7 2006 5:28PM messages near this date
[xsl] WDDX Recordset generic simplification | Re: [xsl] Re: WDDX Recordset generic simplification
& XSLT I realize it is often bad form to talk to yourself but hopefully it
provides more insight into my problem and therefore more clarity for a
possible solution.

On 11/3/06, Eric Pheatt <eric.pheatt@[...].com>  wrote:
>  Hi all,
> 
>  I have an excerpt of a wddx data being generated from query data in
>  ColdFusion 5 and I need to simplify the structure with an intermediate
>  xsl transform so that I can consume the simplified form in a mail merge

[snipped]

I realize the following code does not work but it is the
pull/procedural approach I keep getting stuck heading towards:

<xsl:template match="var/recordset"> 
	<xsl:variable name="rowCount" select="@rowCount"/> 
	<xsl:variable name="fieldNames" select="@fieldNames"/> 
	<xsl:for-each from="1" to="$rowCount" index="row"> 
		<xsl:element name="{../@name}"> 
			<xsl:for-each list="$fieldNames" index="col"> 
				<xsl:element name="{$fieldNames[$col]}"> 
					<xsl:value-of select="field[@name=$col]::child[position()=$row]"/> 
				<xsl:element> 
			</xsl:for-each> 
		</xsl:element> 
	</xsl:for-each> 
</xsl:template> 

Can anyone point me towards a better approach using a push/functional
approach to make simplification of wddx recordsets contextually
generic?

Thanks,
Eric

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@[...].com> 
--~--
Thread:
Eric Pheatt
Eric Pheatt
Wendell Piez

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved