<html>
<head>
<script src="/demo/loadxmldoc.js">
</script>
</head>
<body>
<script>
xmlDoc=loadXMLDoc("books_ns.xml");
x=xmlDoc.getElementsByTagName("book")[0];
ns="/edition/";
x.setAttributeNS(ns,"edition","first");
document.write(x.getAttributeNS(ns,"edition"));
</script>
</body>
</html>