Home > Domino Tips > Developer > JavaScript > Loading XML from JavaScript
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

JAVASCRIPT

Loading XML from JavaScript


Chandra Teja
02.13.2007
Rating: -1.67- (out of 5)


Lotus Notes, Domino, Workplace and WebSphere tips and advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


When creating and consuming Web services in Internet Explorer, you need to be familiar with operations in Extensible Markup Language (XML). Specifically, you have to know how to load an XML file from JavaScript and manipulate the data loaded into the Web browser.

The data read from an XML file is arranged in Internet Explorer's memory as an object called DOMDocument. The DOMDocument object has 35 properties, 25 methods, and three events.

With this object, you can load XML files, navigate the document graph model and query nodes of the graph. The first thing you need to do is create an empty object, which you can accomplish with the ActiveXObject creator:

xmldoc = new ActiveXObject("Msxml2.DOMDocument.3.0");

Now you can load the XML file with the load() method:

xmldoc.load("mydvd.xml");

The following script loads an XML file and prints its content to an alert box. Try it in Internet Explorer. You should get the XML file echoed back in an alert box.

<SCRIPT LANGUAGE="JavaScript">
<!--
  var xmldoc=new ActiveXObject("MSXML2.DOMDocument.3.0");
  xmldoc.load("mydvd.xml");
  alert(xmldoc.documentElement.xml);
// -->
</SCRIPT>

Do you have comments on this tip? Let us know.

Related information from SearchDomino.com:

  • Learning Guide: Extensible Markup Language
  • Learning Guide: JavaScript
  • Tip: Transferring Domino information to JavaScript
  • Reference Center: JavaScript tips and resources
  • Reference Center: XML/Web services tips and resources

    This tip was submitted to the SearchDomino.com tip library by member Chandra Teja. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

    Rate this Tip
    To rate tips, you must be a member of SearchDomino.com.
    Register now to start rating these tips. Log in if you are already a member.




    Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


    RELATED CONTENT
    JavaScript for Lotus Notes Domino
    Trap an attachment path via the Domino file upload control field
    Converting Lotus Notes views to XML documents using JavaScript
    Mimic Lotus Notes Domino application functionality on the Web
    Prevent errors on iFramed pages with JavaScript
    Top 10 Lotus Notes Domino programming and development tips of 2007
    How to add keyboard functionality for Lotus Notes documents
    Validate Lotus Notes Domino fields using JavaScript
    How to support Flash objects in any Web browser for a Lotus Notes Domino application
    How to validate Lotus Notes forms on a Domino server without losing entered data
    A bevy of Notes/Domino development tips

    XML and Web Services for Lotus Notes Domino
    Verify scheduled agent status with Domino Extensible Language (DXL)
    Top 10 Lotus Notes Domino programming and development tips of 2007
    A bevy of Notes/Domino development tips
    How to apply XSL style sheets to XML views
    Top 10 Notes/Domino developer tips of 2006
    A smorgasbord of Notes/Domino development tips
    Converting XML files into Lotus Notes documents
    Finding the properties of a doclinked Lotus Notes document
    How to override default Lotus Notes print settings
    Workplace Forms add XML future to WebSphere-Domino environments

    JavaScript
    Trap an attachment path via the Domino file upload control field
    Converting Lotus Notes views to XML documents using JavaScript
    Prevent errors on iFramed pages with JavaScript
    How to add keyboard functionality for Lotus Notes documents
    Validate Lotus Notes Domino fields using JavaScript
    How to support Flash objects in any Web browser for a Lotus Notes Domino application
    How to validate Lotus Notes forms on a Domino server without losing entered data
    Ajax code equivalent of the @DBColumn formula for Lotus Notes
    A bevy of Notes/Domino development tips
    Delimiting the main code in JScript.NET

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary

    DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



  • Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
    HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




    All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts