spacer
Yehuda Shiran January 27, 2002
Loading XML Strings
Tips: January 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

You can build DOMDocument objects in several different ways. Loading an XML file with the DOMDocument's load() method is one of them. You can also pass an XML string as a parameter to the DOMDocument's loadXML() method. Here is an example that builds a single XML tag using this method:

<SCRIPT LANGUAGE="JavaScript">
<!--
function load() {
  var xmldoc;
  xmldoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
  xmldoc.loadXML("<customer>John Johnson</customer>");
  alert(xmldoc2.xml);
}
// -->
</SCRIPT>
Let's call this script now. The alert box shows the content of xmldoc.


People who read this tip also read these tips:

Look for similar tips by subject:


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS · Sending an HTML and Plain Text E-newsletter with ASP.NET, Part 2
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Top 10 Threats to Wireless Security · Poll: UC Uptake on the Rise · Review: Fluke AirCheck Wi-Fi Tester 1.0