How to use XMLDocument in Silverlight
Last post 05-12-2008 2:04 AM by Jim Mangaly. 7 replies.
Sort Posts:
03-15-2008 2:37 AM
How to use XMLDocument in Silverlight

Hello,

I want to use System.XML, so we can parse the xml document with XMLDocument class, but in xaml.cs I am not able to find XMLDocument, so how can I do that....

Thanks

Laxmilal 

 

 

lmenaria

Joined on 04-06-2007
Posts 13
03-15-2008 3:22 AM
Marked as Answer
Re: How to use XMLDocument in Silverlight

 You can use XDocument from LINQ. I used to use like that. It's pretty cool

 

 XDocument xmlProducts = XDocument.Parse(xmlContent);

                    var products = from product in xmlProducts.Descendants("Product")
                                   select new
                                   {
                                       ProductID = Convert.ToInt32(product.Element("ProductId").Value),
                                       ProductName = (string)product.Element("ProductName").Value
                                   };

(If this has answered your question, please click on "Mark as Answer" on this post. Thank you!)

Best Regards,
Michael Sync

Blog : http://michaelsync.net
Feed : http://michaelsync.net/feed

mchlSync

Joined on 09-16-2005
Singapore
Posts 2,021
05-09-2008 2:44 AM
Re: How to use XMLDocument in Silverlight

Hi,

iam getting the xmlcontent,

but in the products iam not getting any values,

iam getting error like this: [EmptyEnumerable]
Arguments:
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30226.2&File=System.Core.dll&Key=EmptyEnumerable

 

Can any one tell how to the xmlconent?

iam getting the string in xmlformat ,

it contains some nodes,

i want to get the value of the node into a arry ,

Can u please explaine how u read the product?

deepikaFO

Joined on 04-25-2008
Posts 7
05-09-2008 11:10 AM
Re: How to use XMLDocument in Silverlight

Can you show your XML here?

 

Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

sladapter

Joined on 03-05-2008
Indiana, US
Posts 404
05-10-2008 6:57 AM
Re: Re: How to use XMLDocument in Silverlight

Thanks For Replying,

i solved that problem,

i have one more error:

An exception of type 'System.ServiceModel.ProtocolException' occurred in System.ServiceModel.dll but was not handled in user code

How to solve this?

when isearched i got ans as add "clientaccesspolicy.xml" in the root domain.

this one iam not getting how to add?

i have one "silverlight Applciation"

one "Web service"

after calling web service in silverlgith application and run iam getting this error.

Please Reply me ASAP.

Thanks & Reagards

Deepika

 

deepikaFO

Joined on 04-25-2008
Posts 7
05-10-2008 8:37 AM
Re: Re: Re: How to use XMLDocument in Silverlight

Deepika,

Try this http://silverlight.net/forums/p/12495/41047.aspx

Thanks
 

lmenaria

Joined on 04-06-2007
Posts 13
05-12-2008 1:52 AM
Re: Re: Re: How to use XMLDocument in Silverlight

Hi,

i have seen that http://silverlight.net/forums/p/12495/41047.aspx.

But iam not understanding properly what to do?

Can any one gives me steps how to access Webservice from silverlgiht application?

Thanks

Deepika

deepikaFO

Joined on 04-25-2008
Posts 7
05-12-2008 2:04 AM
Re: Re: Re: How to use XMLDocument in Silverlight

Please see this post: http://silverlight.net/forums/p/15888/52427.aspx#52427. Check out the Tim Heuer post I referred to in that thread. You will find a sample in that post that shows how you can access a web service from a Silverlight app.

Hope this helps,
Jim (http://jimmangaly.blogspot.com/)

Please MARK the replies as answers if they answered your question

http://www.identitymine.com/

Jim Mangaly

Joined on 04-21-2008
Kochi, India
Posts 108