It's a hack, but it should work:

<cfscript>
xml = cfhttp.fileContent;
pos1 = find("<string",xml);
pos2 = find(">",xml,pos1);
xml=removeChars(xml,1,pos2);
pos3 = find("</string",xml);
str = removeChars(xml,pos3,len(xml));
</cfscript>

When I grow up, I'll become a RegEx guru :-)

---
Billy Cravens


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, December 14, 2001 2:06 PM
Subject: Re: How to take only a CUSTID number from XML code


> How would you take out only the customer ID number from the following XML
> response from a CFHTTP post:
>
> This is the response that comes from the server we do the CFHTTP post to.
>
>
> <?xml version="1.0" encoding="utf-8"?>
> <string xmlns="http://tempuri.org/";>892028</string>
>
>
> We need to take out only the '892028' number and insert it into our
> database. Right now it tries to insert all the XML code. The customer ID
is
> always in the same place in the code as far as position in the code.
Thanks
> in advance for any help.
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to