Notifications
Clear all

[Closed] Xml

 xcx

This says

– Runtime error: dotNet runtime exception: Non-static method requires a target.

What I am doing wrong?


dotNet.loadAssembly "System.Xml"
XMLReader = dotNetClass "System.Xml.XMLReader"

XMLReader.create "cube.xml"
XMLReader.read()

3 Replies

XMLReader is a static class (it was created with dotNetClass). Use the returned value from the static create method:

dotNet.loadAssembly "System.Xml"
XMLReader = dotNetClass "System.Xml.XMLReader"

Reader = XMLReader.create "cube.xml"
Reader.read()

I’ve never had much luck using the xmlReader class. I use “System.Xml.XmlTextReader” instead. It seems to work just fine

–Jon

 xcx

Thanks ypuech!