Jump to content

Recommended Posts

Can some one help me out with this? I am trying to parse this xml file but my code is not parsing the whole file.

 

my code

<?php 

$file = "http://www.xxxxxxxxxxxxxx.com/partners/access/xml/xml.asp?uid=xxxxxxxxxxxxxx"; 

function contents($parser, $data){ 
    echo $data; 
} 

function startTag($parser, $data){ 
    echo "<b>"; 
} 

function endTag($parser, $data){ 
    echo "</b><br />"; 
} 


$xml_parser = xml_parser_create(); 

xml_set_element_handler($xml_parser, "startTag", "endTag"); 

xml_set_character_data_handler($xml_parser, "contents"); 

$fp = fopen($file, "r"); 

$data = fread($fp, 90000); 

if(!(xml_parse($xml_parser, $data, feof($fp)))){ 
    die("Error on line " . xml_get_current_line_number($xml_parser)); 
} 

xml_parser_free($xml_parser); 

fclose($fp); 

?> 

Link to comment
https://forums.phpfreaks.com/topic/71194-php-not-parsing-all-the-xml-file/
Share on other sites

php version 4.3

 

<?xml version="1.0" encoding="ISO-8859-1"?>	

<cardlist client="Find a Credit Solution" contact="xxxxx">
<client>Find a Credit Solution</client><contact>xxxxxx</contact>
<order option="allcreditcards.issuer">
	<syntax><![CDATA[<ELEMENT>xml.asp?uid=0000&order=appliedto&direction=up<ELEMENT>]]></syntax>
	<direction option="asc">
		<choice>asc</choice>
		<choice>desc</choice>
	</direction>
	<choice>creditcard</choice>
	<choice>issuer</choice>
	<choice>generallinkbarabs</choice>
	<choice>generallinkbarabs2</choice>
	<choice>introductoryratenum</choice>
	<choice>timperiodnum</choice>
	<choice>picturehtmlcardnoshadow</choice>
	<choice>review</choice>
	<choice>best</choice>
	<choice>worst</choice>
	<choice>additionalperks</choice>
	<choice>notations</choice>
	<choice>link</choice>
	<choice>aprpurchnum</choice>
	<choice>varfixpurch</choice>
	<choice>annual</choice>
	<choice>category</choice>
	<choice>specialrequests</choice>
	<choice>onspecialrequests</choice>
	<choice>appliedto</choice>
</order>

<card>
	<cid><![CDATA[<ELEMENT>1144<ELEMENT>]]></cid>
	<creditcard><![CDATA[<ELEMENT>Advanta Life of Balance Platinum Card<ELEMENT>]]></creditcard>
	<issuer><![CDATA[<ELEMENT>Advanta<ELEMENT>]]></issuer>
	<category><![CDATA[<ELEMENT>Business<ELEMENT>]]></category>
	<status><![CDATA[<ELEMENT>Platinum<ELEMENT>]]></status>
	<cardtype><![CDATA[<ELEMENT>MasterCard<ELEMENT>]]></cardtype>
	<introductoryrate><![CDATA[<ELEMENT><ELEMENT>]]></introductoryrate>
	<timeperiod><![CDATA[<ELEMENT><ELEMENT>]]></timeperiod>
	<appliedto><![CDATA[<ELEMENT>Balance Transfers<ELEMENT>]]></appliedto>
	<introdetails><![CDATA[<ELEMENT>The introductory rate is available on balance transfers submitted during the first three months.<ELEMENT>]]></introdetails>
	<aprpurchnum><![CDATA[<ELEMENT><ELEMENT>]]></aprpurchnum>
	<minimumaprpurch><![CDATA[<ELEMENT><ELEMENT>]]></minimumaprpurch>
	<varfixpurch><![CDATA[<ELEMENT>Variable<ELEMENT>]]></varfixpurch>
	<aprcashnum><![CDATA[<ELEMENT>9.99<ELEMENT>]]></aprcashnum>
	<minimumaprcash><![CDATA[<ELEMENT>No<ELEMENT>]]></minimumaprcash>
	<varfixcash><![CDATA[<ELEMENT>Variable<ELEMENT>]]></varfixcash>
	<financeconfiguration><![CDATA[<ELEMENT>Average Daily Balance (including new purchases)<ELEMENT>]]></financeconfiguration>
	<annual><![CDATA[<ELEMENT>$0<ELEMENT>]]></annual>
	<annualnum><![CDATA[<ELEMENT>0<ELEMENT>]]></annualnum>
	<annualadditional><![CDATA[<ELEMENT>$0<ELEMENT>]]></annualadditional>
	<annualdetails><![CDATA[<ELEMENT>None<ELEMENT>]]></annualdetails>
	<graceperiod><![CDATA[<ELEMENT>20 Days (Min.)<ELEMENT>]]></graceperiod>
	<latepayfee><![CDATA[<ELEMENT>$19 if balance is less than $250; $39 if balance is $250 or more<ELEMENT>]]></latepayfee>
	<overlimitfee><![CDATA[<ELEMENT>$15 on balances up to $501; $29 on balances of $501 up to $1,001; and $39 on balances over $1,001<ELEMENT>]]></overlimitfee>
	<cashadvfee><![CDATA[<ELEMENT>3%, $5 minimum ($50 maximum on convenience checks)<ELEMENT>]]></cashadvfee>
	<baltransfee><![CDATA[<ELEMENT>3%, $5 minimum, $50 maximum<ELEMENT>]]></baltransfee>
	<minimumlimit><![CDATA[<ELEMENT><ELEMENT>]]></minimumlimit>
	<maximumlimit><![CDATA[<ELEMENT><ELEMENT>]]></maximumlimit>
	<minimumdeposit><![CDATA[<ELEMENT><ELEMENT>]]></minimumdeposit>
	<maximumdeposit><![CDATA[<ELEMENT><ELEMENT>]]></maximumdeposit>
	<applicationfee><![CDATA[<ELEMENT><ELEMENT>]]></applicationfee>
	<participationfee><![CDATA[<ELEMENT><ELEMENT>]]></participationfee>
	<reloadfee><![CDATA[<ELEMENT><ELEMENT>]]></reloadfee>
	<inactivefee><![CDATA[<ELEMENT><ELEMENT>]]></inactivefee>
	<depositinterest><![CDATA[<ELEMENT><ELEMENT>]]></depositinterest>
	<totalfirstyearfees><![CDATA[<ELEMENT><ELEMENT>]]></totalfirstyearfees>
	<typeofreward><![CDATA[<ELEMENT>Rebate<ELEMENT>]]></typeofreward>
	<optionalreward><![CDATA[<ELEMENT>No<ELEMENT>]]></optionalreward>
	<optionalannualfee><![CDATA[<ELEMENT><ELEMENT>]]></optionalannualfee>
	<rebateminimum><![CDATA[<ELEMENT>.25%<ELEMENT>]]></rebateminimum>
	<rebatemaximum><![CDATA[<ELEMENT>6%<ELEMENT>]]></rebatemaximum>
	<additionalrebates><![CDATA[<ELEMENT>Cardholders will earn bonus rebates in their choice of one of the following categories: "gasoline and diesel fuel," "computer equipment and office supplies," "building supplies," "restaurant dining," or "utilities and telecommunications." The amount earned is based on the following scale: .5% on up to $10,000 in purchases; 1% between $10,001 and $20,000; 2% between $20,001 and $30,000; 3% between $30,001 and $40,000; 6% between $40,001 and $50,000; and .5% on purchases over $50,000.<ELEMENT>]]></additionalrebates>
	<rebatedetails><![CDATA[<ELEMENT>The amount of rebates earned on all other purchases is based on the following scale: .25% on up to $5,000 in purchases; .5% between $5,001 and $15,000; .75% between $15,001 and $25,000; 1% between $25,001 and $50,000; 2% between $50,001 and $125,000; and .5% on purchases over $125,000. Rebate checks are automatically issued when the cardholder reaches $50 in earned rebates.<ELEMENT>]]></rebatedetails>
	<pointsperdollarspent><![CDATA[<ELEMENT><ELEMENT>]]></pointsperdollarspent>
	<milesperdollarspent><![CDATA[<ELEMENT><ELEMENT>]]></milesperdollarspent>
	<additionalpoints><![CDATA[<ELEMENT><ELEMENT>]]></additionalpoints>
	<pointdetails><![CDATA[<ELEMENT><ELEMENT>]]></pointdetails>
	<milescompatiblewithff><![CDATA[<ELEMENT><ELEMENT>]]></milescompatiblewithff>
	<expiration><![CDATA[<ELEMENT>None<ELEMENT>]]></expiration>
	<yearlylimit><![CDATA[<ELEMENT>None<ELEMENT>]]></yearlylimit>
	<bonusapproval><![CDATA[<ELEMENT>None<ELEMENT>]]></bonusapproval>
	<bonusother><![CDATA[<ELEMENT>None<ELEMENT>]]></bonusother>
	<bonusdetails><![CDATA[<ELEMENT>None<ELEMENT>]]></bonusdetails>
	<review><![CDATA[<ELEMENT>The Advanta Life of Balance Platinum Card, issued by Advanta, is designed for business owners who are looking to consolidate their business expenses onto one credit card and are interested in a cash back reward program that can be personalized to fit their business needs.

The unique feature of this reward program is that the cardholder chooses the category in which they will earn up to 6% in cash rebates. The choice of categories includes "gasoline and diesel fuel," "computer equipment and office supplies," "building supplies," "restaurant dining," and "utilities and telecommunications." Cardholders will also earn up to 2% in cash rebates for all other purchases. Rebate checks are issued each time that $50 in rebates are earned, and there is no limit on the amount of rebates that can be earned. However, the rebate percentage earned is based on a sliding scale and the highest available rebate will not be earned on all purchases. Cardholders also have the option to choose the travel rewards program. See the terms and conditions for full details.

Besides the reward program, this card offers a 2.99% fixed APR for the life of balance transfers that are submitted within the first three months of cardmembership. This provides a great option to business owners who want to consolidate their expenses. The card also has no annual fee and a reasonably low interest rate for purchases.

It is important to note that the APRs for purchases, balance transfers, and cash advances are tied to the highest Prime Rate during a three-month period. Due to this policy, the APRs may never reach the lowest possible interest rate.

This card also offers benefits such as personalized business checks, various Internet account related services, and discounts on various products and services from participating retailers and merchants. Plus, the cardholder&#39;s online account reports are compatible with Quicken&#174; and Microsoft Money&#174; software.

Therefore, those who will be able to take advantage of the cash back reward program, the introductory rate for the life of balance transfers, and the various online business tools will benefit most from what the Advanta Life of Balance Platinum Card has to offer.<ELEMENT>]]></review>
	<best><![CDATA[<ELEMENT>Reasonably low APR; no annual fee; discounts on various products and services; choice of travel rewards or cash back program.<ELEMENT>]]></best>
	<worst><![CDATA[<ELEMENT>APRs based on the highest Prime Rate during a 90-day period.<ELEMENT>]]></worst>
	<perks><![CDATA[<ELEMENT>Various Internet account related services.
Personalized business design.
Personalized business checks.
Online statements and management reports.
Discounts on products and services at participating merchants and retailers. 
Compatible with Quicken&#174; and Microsoft Money&#174; software.
Access to travel rewards or rebate program.
See website for additional benefits.<ELEMENT>]]></perks>
	<notations><![CDATA[<ELEMENT>The APR is based on the highest Prime Rate during a 90-day period.
Cardholders can only enroll in either the cash back rebate program or the travel rewards program.
The APR for cash advances varies according to the applicant&#39;s credit history and will be either 1.74% or 11.74% + Prime Rate.
See website for complete terms and conditions of card usage and application disclosure.<ELEMENT>]]></notations>
	<ba><![CDATA[<ELEMENT>2.99% Fixed APR for Life on Balances Transferred within 3 Months<ELEMENT>]]></ba>
	<bb><![CDATA[<ELEMENT>Choice of 6% Cash Back or Travel Rewards<ELEMENT>]]></bb>
	<bc><![CDATA[<ELEMENT>No Annual Fee and No Limit on Earnings<ELEMENT>]]></bc>
	<bd><![CDATA[<ELEMENT>$0 Fraud Liability<ELEMENT>]]></bd>
	<be><![CDATA[<ELEMENT>Personalized Card - Your Company Name on the Top of the Card<ELEMENT>]]></be>
	<bf><![CDATA[<ELEMENT><ELEMENT>]]></bf>
	<bg><![CDATA[<ELEMENT><ELEMENT>]]></bg>
	<bh><![CDATA[<ELEMENT><ELEMENT>]]></bh>
	<generallinkbarabs><![CDATA[<ELEMENT><p><img border="0" src="http://www.cardoffers.com/images/bars/transparent/5bar.gif" width="77" height="11" align="center"></p><ELEMENT>]]></generallinkbarabs>
	<generallinkbarabs2><![CDATA[<ELEMENT><p><img border="0" src="http://www.cardoffers.com/images/bars/transparent/4bar.gif" width="77" height="11" align="center"></p><ELEMENT>]]></generallinkbarabs2>
	<cardpicture><![CDATA[<ELEMENT><img border="0" alt="Advanta Life of Balance Platinum Card" src="http://www.cardoffers.com/images/credit_cards/advanta/lifeofbalance_ns.jpg" width="99" height="65"><ELEMENT>]]></cardpicture>
	<picturehtmlcard><![CDATA[<ELEMENT><img border="0" alt="Advanta Life of Balance Platinum Card" src="http://www.cardoffers.com/images/credit_cards/advanta/lifeofbalance.jpg" width="99" height="65"><ELEMENT>]]></picturehtmlcard>
	<picurlnoshadow><![CDATA[<ELEMENT>http://www.cardoffers.com/images/credit_cards/advanta/lifeofbalance_ns.jpg<ELEMENT>]]></picurlnoshadow>
	<specialrequests><![CDATA[<ELEMENT><ELEMENT>]]></specialrequests>
	<onspecialrequests><![CDATA[<ELEMENT>No<ELEMENT>]]></onspecialrequests>
	<cpa><![CDATA[<ELEMENT>60<ELEMENT>]]></cpa>
	<link><![CDATA[<ELEMENT>http://www.cardoffers.com/manage/track/e.asp?ID=xxxxxxxx<ELEMENT>]]></link>
</card>
</cardlist>

 

there are more <card></card> but I only listed one.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.