nick364
nick364

Reputation: 33

Write XML in Silverlight with VB

is it possible to write xml in silverlight with vb

Upvotes: 1

Views: 1597

Answers (5)

Braulio
Braulio

Reputation: 1728

In my application the model layer is XML based, I use LINQ To XML (supported by SL) pretty good stuff (if you are handling XML that are bellow some Mb, it's like DOM builds up the tree in memory).

On the other hand to store the XML in the isolated storage, or in the server I just convert the XML into an string, quite standard param :), only take care when using services to configure the params tu support more than 64 K's string parametrs (if you are in that case).

HTH

Upvotes: 1

A1exandr Belan
A1exandr Belan

Reputation: 4780

For example you can easy create XML from object using XMLSerialization.

Upvotes: 0

JaredPar
JaredPar

Reputation: 755269

Other users have covered the actual writing of physical XML so please refer to their answers for that.

I was wondering though, are you talking about VB XML literals? If so, then yes it's possible to use VB XML literals in a Silverlight App. This extends to the use of XML literals and XLINQ.

Upvotes: 1

AnthonyWJones
AnthonyWJones

Reputation: 189505

Yes you can write XML in silverlight. Silverlight's System.Xml dll supports XmlWriter which allows you to write XML to a Stream, TextWriter or a StringBuilder.

If you are looking for standard XML DOM implementation you won't find it, Silverlight does not have that nor does it have XPath. Instead if you are looking to build an XML document in memory you can use System.Xml.Linq. Use the XDocument, XElement and XAttribute to create your document.

Upvotes: 2

Mark Allen
Mark Allen

Reputation: 1205

Yes, you can write Silverlight applications and web pages using VB(.NET), and they can save XML files, but they're going to be constrained by the security/sandboxing with Silverlight.

So, you can do it but you have to use the isolated storage stuff.

http://www.danielmoth.com/Blog/2008/04/isolatedstorage-in-siverlight-2-beta-1.html

I apologize that this answer isn't better, so I'm marking it community wiki.

Upvotes: 1

Related Questions