[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Calling XML using Javascript

Subject: Calling XML using Javascript
From: "Nistala, Anu" <anistala@xxxxxxxxx>
Date: Mon, 26 Nov 2007 16:13:33 -0600
 Calling XML using Javascript
Hi all,

I have 5 different XML files with the similar structure as below, first
I wanted to merge them and then perform my display actions, tried
various ways, but it wasn't working out as intended and instead
complicating the whole thing.

So, now I have created radio buttons, on one of the 5 xml sheets and by
default the first is selected, and if any other radio button is selected
I have a javascript function for the onclick event of the radio group
that is expected to call the xml file. Now the question is, is it even
possible to do so and if so then how do I do it?

The node names all match in all the xml files. Below is an example of
one XML I have. Does anyone know how to call an xml from javascript to
one xml or directly get data from the xmls to display in one web page?

Thank you all for your help in advance..

<?xml-stylesheet type="text/xsl" href="todropdown.xsl"?>

    <funcname >flNVGLogin</funcname>
    <funcdesc >This function logs into CMM app</funcdesc>
    <CreationDate>2:12 PM 11/14/2007</CreationDate>
    <Author>Anu Nistala</Author>

Part of the XSL Code is

	  <input type="radio" name="ProjType" value="CMM"
onclick="javascript:selectProject(this)" > CMM</input>
	  <input type="radio" name="ProjType" value="CRR"
onclick="javascript:selectProject(this)" > CRR </input>
	  <input type="radio" name="ProjType" value="MIS"
onclick="javascript:selectProject(this)" > MIS </input>
	  <input type="radio" name="ProjType" value="MMS"
onclick="javascript:selectProject(this)" > MMS </input>
	  <input type="radio" name="ProjType" value="MPIM"
onclick="javascript:selectProject(this)" > MPIM </input>

	  <input id="ProjTypeButton" style="font-family:times"
name="ProjTypeButton" type ="button" value="Select Project!"/>

          <hr align="center" width="100%"></hr>

I need help with writing the function!

function selectProject(proj)
	alert ("Selected Project is " + proj.value);

//<xsl:template match="/">
//<xsl:apply-templates select="//funcdef |
document("path/funcdefs2.xml")//funcdef |
//document("path/funcdefs3.xml")//funcdef |
document("path/funcdefs4.xml")//funcdef |


Anu Nistala
512 248 4535 (office)
Nodal Integration Test Automation
Electric Reliability Council of Texas, Inc.

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.