[AC-5726] Ti.XML.DOMImplementation.createDocument undefined object
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | n/a |
| Status | Resolved |
| Resolution | Invalid |
| Resolution Date | 2018-05-06T00:29:06.000+0000 |
| Affected Version/s | Appcelerator Studio 4.5.0 |
| Fix Version/s | n/a |
| Components | Titanium SDK & CLI |
| Labels | n/a |
| Reporter | Tony Lau |
| Assignee | Shak Hossain |
| Created | 2018-05-05T23:25:22.000+0000 |
| Updated | 2018-05-06T19:12:53.000+0000 |
Description
In index.js, I have
var myTestXML = Ti.XML.DOMImplementation.createDocument(null,'TESTXML',null);
I keep getting 'undefined is not an object (evaluating Ti.XML.DOMImplementation.createDocument)' error
I tried the followings too and yield the same results:
Ti.XML.DOMImplementation.createDocument('test.xml','TESTXML',null);
Ti.XML.DOMImplementation.createDocument(Ti.Filesystem.applicationDataDictionary + 'test.xml','TESTXML',null);
You should call method on object instances, e.g.
domImplementation.createDocument(args). You receive an instance by using the Ti.XML API's (implementationproperty) on aTi.XML.Documentinstance. Read more [here](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.XML.Document-property-implementation).