I did reference the System.Xml.Linq but no matter what I do I keep getting the same error :
Assets/RestInterface.cs(5,18): error CS0234: The type or namespace name `Linq' does not exist in the namespace `System.Xml'. Are you missing an assembly reference?
I did some research on the net but all solutions fail …
Why System.Xml.Linq not System.Linq ?
also ensure to not use stripping (or configure it correctly with the link mapping file - see docs) and especially don’t use .net 2.0 subset but the full .net 2.0
A word of warning: using such web load functions can lead to problems (if they don’t work it will throw an exception though already at compile time), cause you can’t sue System.Web on mobile and some of those web loads tend to base on it not raw tcp sockets. Such cases are no problem though you still can use WWW and then create the xml element from www.text
Hmmm … I’m still new at Unity and mobile development (been doing it for 3 days) … What would be a good way to fetch and process XML in unity ? - Its all I need … Unity is otherwise the perfect tool for me - Just one good way of getting XML from a REST-based web service and then use the information on the iPhone !
PS: I really like linq, but things like XElement is appearently only available i system.xml.linq ?
Well… Unity uses Mono rahter than the actual .Net framework, so you might want to ensure that Mono fully supports System.xml.linq. Even if they do, Unity doesn’t use the very latest mono I believe.
That said, I haven’t tried so don’t take that to mean it can’t work, it’s just an area you might want to check.
Of course Linq is only the lastest-easiest way to use XML, there are other options, and you could always write your own parser and avoid all that overhead to begin with. That’s what I would do before I considered using full .Net 2.0 rather than the subset.
WWW for the fetch of XML from web
Then use System.XML to get an xml object from www.text (the text data)
and then use LINQ to operate on datasets there (unsure if system.xml.linq would have offered special functionalities, but I know that general linq works on mobile to operate on enumerable sets)
Be aware though that System.xml raises the app size by 1-2mb per arch as it has to include system and system.xml, so if you build for ARMV6 + ARMV7 it raises by up to 4mb