Forums

XmlAttributeAttribute

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Re: XmlAttributeAttribute

Postby hopscc » Tue Mar 01, 2011 4:04 am

The new Test (130-attributes-tricky-names.cobra) fails on a non Linq supporting system ( .Net <4.0 ? .Net 2 at least)

Code: Select all
OS Version:   Microsoft Windows NT 5.1.2600 Service Pack 3
CLR Platform: .NET
CLR Version:  2.0.50727.3603


# From r-testify
Code: Select all
RUN 130-attributes-tricky-names.cobra
    C:\home\hops\src\cobra\wkspace0\Tests\320-misc-two\800-attributes\130-attributes-tricky-names.cobra
    Test #6
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
error: Metadata file "System.Xml.Linq.dll" could not be found
Compilation failed - 1 error, 0 warnings
----------------------------------------------------------------------------------------------------



You dont need Linq for the test anyway so its just unnecessary cut-and-paste cruft from the original example
Code: Select all
use System.Xml
#use System.Xml.Linq
use System.Xml.Serialization

class Season has Serializable
   
   pro number from var as int = 0
      has XmlAttribute(attributeName='no')
      
   pro episodes from var as List<of Episode> = List<of Episode>()
      has XmlElement('episode')

class Episode has Serializable, XmlRoot("episode")

   pro number from var as int = 0
      has XmlElement('epnum')
      
   pro seasonNumber from var as int = 0
      has XmlElement('seasonnum')
      
   pro airdate from var as DateTime
      has XmlElement('airdate')
   
   pro title from var as String?
      has XmlElement('title')

   def main
      pass



Works fine
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Previous

Return to Discussion

Who is online

Users browsing this forum: No registered users and 49 guests