The WDDX packet was created from a CFML query using CFWDDX
ACTION="CFML2WDDX".  Sure, I can convert it back to CFML using
ACTION="WDDX2CFML".  But then the output CFML has the same problem that
the original CFML query has: its columns are not in the desired order,
the order in which they appear in the SELECT clause.

This is a nuisance for me since my app's queries are created dynamically
by the user, so the app doesn't know the proper order in which to output
the columns.

I convert the query to WDDX because, as Michael Caulfield pointed out,
the WDDX packet *is* in the same order as the SELECT clause.  Then I can
parse the WDDX packet to create a new query, preserving the ordering.

When I've got this packaged into a custom tag, I'll do something like
this:

<CFQUERY Name="qEmp">#SQLStatement#</CFQUERY>
<CF_Nice_Query InputQuery="qEmp" OutputQuery="qEmpNice">
<CFOUTPUT Query="qEmpNice">

-David

On Fri, 16 Feb 2001 07:31:40 -0500 "Lord, Heath"
<[EMAIL PROTECTED]> writes:
> I'm not sure if I understand exactly what your issue is...
> You have a WDDX packet that you have created with CF.
> That packet contains variables that you want to extract with CF.
> 
> If those two statements are correct, then why not just use:??
> <cfwddx action="WDDX2CFML" input="#my_packet#" 
> output="My_CF_Variable">
> 
> Then all of the variables are available to you within CF.
> 
> Is there something else that we are missing?
> 
> Just asking...
> Heath
> 
> -----Original Message-----
> From: David Shadovitz [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 16, 2001 2:00 AM
> To: CF-Talk
> Subject: Re: RegExp to extract info between tags
> 
> 
> Dan,
> 
> Not sure what you mean by using WDDX to get the values out.
> 
> I had thought of using REFindNoCase with that 4th argument, but I 
> think
> it only gives the position of the 1st match.  In my case, that would 
> be
> the tag name, but I need to get my hands on the value between the 
> tags.
> 
> I'm going to try out Dick Applebaum's technique of using REReplace 
> to
> create a delimited list of the values.
> 
> I appreciate your help.
> 
> -David
> 
> On Thu, 15 Feb 2001 11:08:13 -0500 "Dan G. Switzer, II"
> <[EMAIL PROTECTED]> writes:
> > David,
> > 
> > Why aren't you just using WDDX to get the values out? If for some 
> 
> > reason you
> > can't, look in to using REFindNoCase with the "return 
> subexpression" 
> > option
> > set to true (this is the fourth argument in the function.)
> > 
> > This will return a structure containing a single item array which 
> 
> > will mark
> > the starting position and the length of the match. You can then do 
> 
> > a
> > recursive call until you get down to just the data.
> > 
> > This is going to be a slow process to try to do in just CFML. If 
> you 
> > can't
> > use CFWDDX, you might want to look into create a COM object to do 
> it 
> > for
> > you, and then use CFOBJECT to call the COM object.
> > 
> > -Dan
> > 
> > -----Original Message-----
> > From: David Shadovitz [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, February 15, 2001 10:32 AM
> > To: CF-Talk
> > Subject: Re: RegExp to extract info between tags
> > 
> > My, we're demanding ;)
> > 
> > I'm trying to parse an XML packet.  Specifically, a WDDX packet 
> > created
> > by running CFWDDX ACTION="CFML2WDDX" on a CFML query.  Here's an 
> > example:
> > 
> > <wddxPacket version='0.9'>
> > <header></header>
> > <data>
> > <recordset rowCount='3' fieldNames='EMPID,EMPNAME'>
> > <field name='EMPID'>
> > <number>1</number>
> > <number>2</number>
> > <number>5</number>
> > </field>
> > <field name='EMPNAME'>
> > <string>Joe</string>
> > <string>Tom</string>
> > <string>Sam</string>
> > </field>
> > </recordset>
> > </data>
> > </wddxPacket>
> > 
> > I can get to each field easily enough, but I could use help with 
> > getting
> > at the data.
> > 
> > -David
> > 
> > On Thu, 15 Feb 2001 08:03:48 -0700 Dick Applebaum 
> <[EMAIL PROTECTED]>
> > writes:
> > > David,
> > >
> > > Not sure what you are trying to accomplish from your 
> > dscription...
> > > Are you trying to remove all tags?
> > > Just tag pairs?
> > > Can there be nested pairs as in an XML packet.
> > >
> > > A real world before/after data example, bigger than 1 tag pair,
> > > would help.
> > >
> > > Dick
> > >
> > > At 6:02 AM -0800 2/15/01, David Shadovitz wrote:
> > > > Dick,
> > > > That's good, but it's for a hard-wired tag, "number".  I'd 
> like
> > > > to handle *any* tag.  The tag will not have any attributes.
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to