p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Dreamweaver (all versions) (http://p2p.wrox.com/forumdisplay.php?f=58)
-   -   Reading XML in DW MX 2004 (http://p2p.wrox.com/showthread.php?t=17095)

bommi_k August 19th, 2004 12:57 AM

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
//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>






Snib August 19th, 2004 01:07 PM

Yet another cross-post: http://p2p.wrox.com/topic.asp?TOPIC_ID=17817

Snib

<><


All times are GMT -4. The time now is 04:26 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.