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