View Single Post
  #1 (permalink)  
Old August 19th, 2004, 12:57 AM
bommi_k bommi_k is offline
Registered User
Join Date: Aug 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to bommi_k
Default Reading XML in DW MX 2004

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
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=""
<abcd id="abcdid">

//File named as test.html

<script language="java-script" src="../shared/Test/test.js"></script>
<form name="frm">
<input type="button" name="Click Me" value="Click Me" onClick="A()">

Reply With Quote