PDA

View Full Version : how do i write javascript to display nodes attributes


skankman
10-04-2005, 08:39 AM
I'm new to javascript so go easy on me if you can help me with my problem, which may seem easy to many.

I would like someone to show me how I can use javascript to retrieve the data or text that is stored in an xml, elements attribute ie I want to write a javascript statement that will display the attributes of <title> on the screen

<?xml version="1.0" encoding="UTF-8"?>

<?xml:stylesheet type = "text/xsl" href = "Recipe.xsl"?>
<!-- Recipe2.xml -->

<recipe schemaLocation="Recipe.xsd">
<title created-date="2005-06-01" modified_date="2005-06-01">Smoked Chicken Pizza</title>
<number_of_servings>Makes enough for one person.</number_of_servings>
<comment>My favourite</comment>
</recipe>


appreciate any help

rm-f
10-06-2005, 02:26 AM
XML for <SCRIPT> is a powerful, standards-compliant JavaScript XML parser that is designed to help web application designers implement cross platform applications that take advantage of client-side manipulation of XML data. XML for <SCRIPT> provides a full suite of tools, including:

* A standards-compliant W3C DOM Level 2 processor
* An XPath processor
* A standards-compliant SAX processor
* A simple (classic) DOM processor
* Proxies for XML retrieval from any domain
* Utilities for XML and application development


http://xmljs.sourceforge.net/