XmlNode not supported in Silverlight: reimplement or use string parsing?

I wrote a WPF application that I want to connect to Silverlight 2.

My business logic and model (for the MV-VM design pattern) are packaged in a separate assembly, which I am trying to remake as a Silverlight class library.

Unfortunately, the XmlNode class that I use to parse the XML file with model data is not supported by Silverlight 2. It aims to use LING in XML instead ( http://silverlight.net/forums/t/14577.aspx ). Using LINQ seems redundant to my task. I am considering replacing XML parsing code using an XML DOM regex-based schema (for parsing attributes). Alternatively, I am considering writing my own implementation of XmlNode, which will be referenced if the project was compiled for Sliverlight 2.

Has anyone come across a similar choice? Does anyone have any suggestions (possibly a third option) on how to proceed (RegEx or rewrite)?

+3
source share
2 answers

Not sure how Linq to Xml overflows. It is actually much easier to parse Xml with Linq2xml as soon as you hang it. I would say that regex or writing your own XmlNode would be redundant.

If you post some of the XmlNode work that you do, I am sure you will get good translations. Meanwhile, here is a good introduction on how easy it is to parse documents with Linq in Xml.

Update: In response to a performance issue, all I could find was that linq to xml is faster than XmlDocument .

+2
source

System.Xml.Linq XML DOM, XDocument, XElement, XNode XAttribute, XmlDocument, XmlElemnt .. Linq, Linq to Xml . !

0

Source: https://habr.com/ru/post/1699392/


All Articles