Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 19th, 2004, 12:57 AM
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
//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>





 
Old August 19th, 2004, 01:07 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

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

Snib

<><




Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! Pop-Up Menu in DW MX 2004 Maverick Dreamweaver (all versions) 5 November 20th, 2004 12:08 PM
Beginning DW.MX 2004 Global Soccer terry s Dreamweaver (all versions) 6 October 13th, 2004 02:40 PM





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