Hi,
Thanks for viewing my post.
I'm having a problem trying to use gzipstrem to decompress an xml.gz. Although the xml is quite large all I'm getting is the first two product nodes.
I've tried sevral differant files and all decompress fine when manually unzipped in windows.
code:
code output:
I've tried loads of different methods but all end up the same.
any ideas?
Thanks
Thanks for viewing my post.
I'm having a problem trying to use gzipstrem to decompress an xml.gz. Although the xml is quite large all I'm getting is the first two product nodes.
I've tried sevral differant files and all decompress fine when manually unzipped in windows.
code:
Code:
FileStream fs1 = new FileStream(HttpContext.Current.Server.MapPath("BBC.xml.gz"), FileMode.Open, FileAccess.Read);
GZipStream compStream = new GZipStream(fs1, CompressionMode.Decompress);
StreamReader sr = new StreamReader(compStream, Encoding.UTF8);
string x = sr.ReadToEnd();
compStream.Close();
compStream.Dispose();
sr.Close();
sr.Dispose();
Code:
<?xml version="1.0" encoding="ISO-8859-1"?><products><product> <product_code>0007198728</product_code> <product_name>Little Britain: The Complete Scripts and Stuff: Series Two</product_name> <brand_name></brand_name> <level1>book</level1> <level2>Comedy</level2> <level3></level3> <level4></level4> <level5></level5> <mapped_cat_level1>Books</mapped_cat_level1> <mapped_cat_level2>Humour</mapped_cat_level2> <mapped_cat_id>279</mapped_cat_id> <description>Second in the series of the hilarious published scripts of the hugely successful series. <description> <image_url_2><![CDATA[]]></image_url_2> <currency>GBP</currency> <online_price>11.49</online_price> <offline_price></offline_price> <recurring_charge></recurring_charge> <old_price></old_price> <delivery_cost></delivery_cost> <delivery_time></delivery_time> <availability></availability> <promotion_text></promotion_text> <best_seller></best_seller> <warranty></warranty> <condition></condition> <offer_type></offer_type> <keywords></keywords> <location></location> <duration></duration> <date_from></date_from> <date_to></date_to> <fieldA></fieldA> <fieldB></fieldB> <fieldC></fieldC> <fieldD></fieldD> <fieldE></fieldE> <fieldF></fieldF> <fieldG></fieldG> <fieldH></fieldH> <fieldI></fieldI> <fieldJ></fieldJ> <fieldK></fieldK> <fieldL></fieldL> <fieldM></fieldM> <fieldN></fieldN> <fieldO></fieldO> <fieldP></fieldP> <fieldQ></fieldQ> <fieldR></fieldR> <fieldT></fieldT> <fieldU></fieldU> <fieldV></fieldV> <fieldW></fieldW> <fieldX></fieldX> <fieldY></fieldY> <fieldZ></fieldZ> </product> <product> <product_code>00104</product_code> <product_name>Doctor Who: Rose & The Doctor Backpack</product_name> <brand_name></brand_name> <level1>backpack</level1> <level2>Doctor Who</level2> <level3></level3> <level4></level4> <level5></level5> <mapped_cat_level1>Bags & Belts</mapped_cat_level1> <mapped_cat_level2>Backpacks</mapped_cat_level2> <mapped_cat_id>695</mapped_cat_id> <description>Kids backpack featuring Rose and the Doctor from Season 2. Zip Opening Main Compartment. Two Velcro Closure Side Pockets. Adjustable Straps.</description> <image_url_2><![CDATA[]]></image_url_2> <currency>GBP</currency> <online_price>8.99</online_price> <offline_price></offline_price> <recurring_charge></recurring_charge> <old_price></old_price> <delivery_cost></delivery_cost> <delivery_time></delivery_time> <availability></availability> <promotion_text></promotion_text> <best_seller></best_seller> <warranty></warranty> <condition></condition> <offer_type></offer_type> <keywords></keywords> <location></location> <duration></duration> <date_from></date_from> <date_to></date_to> <fieldA></fieldA> <fieldB></fieldB> <fieldC></fieldC> <fieldD></fieldD> <fieldE></fieldE> <fieldF></fieldF> <fieldG></fieldG> <fieldH></fieldH> <fieldI></fieldI> <fieldJ></fieldJ> <fieldK></fieldK> <fieldL></fieldL> <fieldM></fieldM> <fieldN></fieldN> <fieldO></fieldO> <fieldP></fieldP> <fieldQ></fieldQ> <fieldR></fieldR> <fieldT></fieldT> <fieldU></fieldU> <fieldV></fieldV> <fieldW></fieldW> <fieldX></fieldX> <fieldY></fieldY> <fieldZ></fieldZ> </product>
any ideas?
Thanks
Comment