RE: [xsl] Calling XML using Javascript

Subject: RE: [xsl] Calling XML using Javascript
From: "Nistala, Anu" <anistala@xxxxxxxxx>
Date: Wed, 28 Nov 2007 17:21:38 -0600
Hi all,

Good news is I got this problem solved, using the same document function
as Scott has suggested in the first place. Sorry it took me so long to
implement it. Silly me...

SO that's solved now :)

Now, the original problem is the XMLs that I use to display on the
webpage are a generated from a vbs file. The conversion is made using
QTP, QA automation tool. The QTP script is ready, all I have to do is
execute it from xsl file.

Now, I want to implement the file system object and execute the qtp
script at run time to create the corresponding XMLs. (if that's the
correct way to do so)

I would love if I can help implementing the FSO for executing the QTP
script to generate XMLs.
Any help is greatly appreciated.

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

-----Original Message-----
From: Nistala, Anu
Sent: Monday, November 26, 2007 4:14 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] 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