Try
<cfset Extract = Trim(ReReplaceNoCase(input, "<[^>]+>", "#Chr(9)#", "ALL"))>
<cfset Extract = ReReplaceNoCase(Extract, "#Chr(9)#+", "#Chr(9)#", "ALL")>
This will replace all tags <...> with a tab
Then replace all cases of multiple tabs with a single tab
you are left with a tab-delimited list of values.
Your input becomes:
1*2*5*Joe*Tom*Sam
where tabs are shown as an asterisk (*)
HTH
Dick
At 7:32 AM -0800 2/15/01, David Shadovitz wrote:
>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