We are in the process of writing a extension tool in DW MX 2004.After our investigating we have found that the xml file is not read properly in DW MX 2004.To prove this point we have written a small program (to be run as an extension).and surprisingly it fails when we try to read the xml file.
Is this a known bug? or am i doing some wrong?
I have tested this behaviour on Windows 2000 and DW MX 2004.
Could you please help me find a solution to this?.Thanks in Advance.
Thanks & Regards.,
B.Naveen Kumar
//File to be placed in shared folder and named as test.
js
//SHARE-IN-MEMORY=true
function A(){
//var courseListFile= dw.getConfigurationPath()+"/shared/Test/test.xml";
var courseListFile= "file:///D|/test.xml";
alert('courseListFile '+courseListFile);
var DOMObj = dreamweaver.getDocumentDOM(courseListFile);
var Elements = DOMObj.getElementsByTagName("manifest");
for (var i=0;i<Elements.length;i++) {
FirstElement = Elements[i];
id = FirstElement.getAttribute('identifier');
alert("identifier "+id);
version = FirstElement.getAttribute('version');
alert("version "+version); //alerts as "undefined"
var tArray = FirstElement.childNodes; // java-script error as "Object not defined"
alert('tArray '+tArray.length);
}
}
//File to be placed in D:\ drive(if you put on c:\ then change in the
js file) and named as test.xml
XML File:- (test.xml)
<?xml version="1.0" standalone="no" ?>
<manifest identifier="test" version="1.2" xmlns="http://www.imsproject.org/xsd/imscp_rootv1p1p2"
xmlns:adlcp="http://www.adlnet.org/xsd/adlcp_rootv1p2">
<lom>
<abcd id="abcdid">
</abcd>
</lom>
</manifest>
//File named as test.html
<html>
<script language="java-script" src="../shared/Test/test.
js"></script>
<body>
<form name="frm">
<input type="button" name="Click Me" value="Click Me" onClick="A()">
</form>
</body>
</html>