# XML for <SCRIPT>

## Warning: As this sample uses the getContent method to load XML data it does not work with Netscape 4.

XML for <SCRIPT> is not a part of dFrameAPI but an Open Source project:

"XML for <SCRIPT> is a simple, non-validating XML DOM and SAX parser written in JavaScript. It was designed to help web application designers implement cross platform, client side manipulation of XML data. XML for <SCRIPT> is licensed under the terms of the GNU Lesser General Public Licence (LGPL)"

The fileset of this project is in the ext directory of dFrameAPI but refer to http://xmljs.sourceforge.net/ for new releases.

A test of this parser has been done in :

file: advanced.XML.html

Run the example

See the source code

## Remarks

· The XML data is loaded with the getContent method and onContentLoad function.

· The XML data is stored in a HTML file (.html file extension). It seems that there must be "something" (the "A" letter in the sample file contacts_XML.html) between the <HTML> tag and the first XML tag in order XML tags are correctly recognized after beeing loaded with the getContent method of DFrameAPI:

<HTML>A<CONTACTS><CONTACT><FIRSTNAME>John</FIRSTNAME> …

· Do not use ADDRESS as a XML tag within a HTML file

· Specific to NS6: getElements method of XML for <SCRIPT>: objNode.getElements(|tag name|)

It seems that the tag name parameter must be in lower case. This is done in the sample with the cTCC function:

firstName = trim(objUser.getElements(cTCC("FIRSTNAME"))[0].getText(),true, true);