PDA

View Full Version : Xml


xcx
09-25-2007, 02:27 PM
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()

ypuech
09-25-2007, 03:50 PM
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()

jonlauf
09-25-2007, 03:51 PM
I've never had much luck using the xmlReader class. I use "System.Xml.XmlTextReader" instead. It seems to work just fine

--Jon

xcx
09-25-2007, 04:07 PM
Thanks ypuech!

CGTalk Moderation
09-25-2007, 04:07 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.