I am developing silverlight web part for sharepoint 2010. In my project I have downloaded the xlsx file from the sharepoint server to the local isolated storage. Now I am zipping the xlsx file with the ICSharpCode.SharpZipLib.Silverlight dll and then I am unzipping that zipped file to a target folder. This all is done through programatically. When I unzip the file it creates the folders _reslx, customXml, docenter code hereProps, xl inside the target folder. In the xl folder there is sharedStrings.xml which is the main xml file. This file contains all the contents of the original xlsx file. I am successfully loading the the xml file with the following code.
xmlDoc = XDocument.Load(readFile);
I am not getting the xml declartion in the loaded xml file. However I can see the xml declartion with the following sentence.
XDeclaration a = xmlDoc.Declaration;
In ‘a’ i am getting the value "{<?xml version="1.0" encoding="UTF-8" standalone="yes"?>}" I am getting the following xml file after loading.
<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="67" uniqueCount="39">
<si>
<t>INVOICE</t>
</si>
<si>
<t>INVOICE #</t>
</si>
<si>
<t>Bill To:</t>
</si>
<si>
<t>DESCRIPTION</t>
</si>
<si>
<t>AMOUNT</t>
</si>
<si>
<t>TOTAL</t>
</si>
<si>
<t>FOR:</t>
</si>
<si>
<t>PBS</t>
</si>
<si>
<t>8108 SE Coconut St.</t>
</si>
<si>
<t>Hobe Sound, FL 33455</t>
</si>
<si>
<t>772-349-6317 Phone 772-675-9100 Fax</t>
</si>
<si>
<t>EIN 20-5268843</t>
</si>
<si>
<t>Provider 693068996</t>
</si>
<si>
<t>Rate</t>
</si>
<si>
<t>Units</t>
</si>
<si>
<t>DATE</t>
</si>
<si>
<t>Michael Nolan Ph.D. BCBA</t>
</si>
<si>
<t>____________________________________________</t>
</si>
<si>
<t>BCBA Date</t>
</si>
<si>
<t>CLIENT:</t>
</si>
<si>
<t>Date:</t>
</si>
<si>
<t>Behavior Assistant- L. Bresson</t>
</si>
<si>
<t>Email:</t>
</si>
<si>
<t>1 Unit = 1 hour</t>
</si>
<si>
<t>TOTALS</t>
</si>
<si>
<t>cvt1970@juno.com</t>
</si>
<si>
<t>Attn: Cecilia</t>
</si>
<si>
<t>Behavior Assistant- B. Bresson</t>
</si>
<si>
<t>Behaviror Ass't -N Giarratano</t>
</si>
<si>
<t>Signature of Representatives Approval Date</t>
</si>
<si>
<r>
<t xml:space="preserve">Behavior Asst- </t>
</r>
<r>
<rPr>
<sz val="9" />
<rFont val="Arial" />
<family val="2" />
</rPr>
<t>N Giarratano-</t>
</r>
<r>
<rPr>
<sz val="10" />
<rFont val="Arial" />
<family val="2" />
</rPr>
<t>08</t>
</r>
</si>
<si>
<t>Behavior Asst- B. Bresson-08</t>
</si>
<si>
<t>Behavior Asst- L. Bresson-08</t>
</si>
<si>
<t><@Invoice></t>
</si>
<si>
<t><@For></t>
</si>
<si>
<t><@Client></t>
</si>
<si>
<t><@Caregiver></t>
</si>
<si>
<t><@Email,@Address,@City,@State,@Zip></t>
</si>
<si>
<t><@Date></t>
</si>
</sst>
When I am quering on this xml file I am getting the result in ‘eles’ as “Enumeration yielded no results”. I am using the following query
var eles = from c in xmlDoc.Descendants("si")
select c;
Why my xml file is not reading properly. Can you please tell me where I am going wrong ? or can you please provide me any link through which I can resolve the above issue?
Specify the namespace.