[Javascript] AJAX: Reading the XML file

Michael Borchers list at tridemail.de
Fri Feb 9 03:08:24 CST 2007


I receive the following XML file and want to parse it into a form input 
f.e.:
<?xml version="1.0" encoding="iso-8859-1"?>
<product>
<products_name>Dienstleistungen Layout, Redaktion</products_name>
<products_price>1300.00</products_price>
<products_description></products_description>
</product>I tried it his way and it works fine as long the 
products_descriptionis not empty, but otherwise, like in this case above, it 
won't work: var product              = 
productsRequest.responseXML.getElementsByTagName('product').item(0); var 
productDescription   = 
product.getElementsByTagName('products_description').item(0).firstChild.data;which 
ist the "finest" way to read out my XML file?!thanks 




More information about the Javascript mailing list