Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do create an XMLDOM ?

Status
Not open for further replies.

silversurfer

Programmer
Nov 8, 2000
19
GB
Hi there!

I am getting a little bit lost in the XML and related areas dschungel. I have no problems creating an xml document and I managed to create an xsl do display the page in a brwowser, but I would like to use javascript to process information stored in the xml document. To do that I need to create suitable objects (which makes sense to me) but how do I actually do that?

Thank for your help
 
Dear silversurfer,

One way is to use the <xml> tag like this:

<XML id=&quot;source&quot; src=&quot;myxml.xml&quot;></XML>
<XML id=&quot;style&quot; src=&quot;myview.xsl&quot;></XML>
<SCRIPT event=&quot;onload&quot; for=&quot;window&quot;>
var result = new String(&quot;&quot;);
if ( source.parseError.errorCode != 0)
result = reportParseError( source.parseError);
else{

if ( style.parseError.errorCode != 0)
result = reportParseError( style.parseError);
else{

try{
result = source.transformNode( style.XMLDocument);
}catch(exception){
result = reportRuntimeError(exception);
}
}
}
showResult.innerHTML = result;
</SCRIPT>

Hope this helps
-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top