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

RE: javascript problem----- I Got the Answer!!!!!!

Subject: RE: javascript problem----- I Got the Answer!!!!!!
From: "stevenson" <stevenson@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 15 Mar 2002 13:55:25 +0300
activexobject msxml2.domdocument
var oFilteredXML = new ActiveXObject( "Msxml2.DOMDocument.4.0" );
	var oTempXML = new ActiveXObject( "Msxml2.DOMDocument.4.0" );
	var xmlDoc = new ActiveXObject( "Msxml2.DOMDocument.4.0" );

	bSuccess = oFilteredXML.loadXML( "<calls></calls>" );
	var oRoot = oFilteredXML.firstChild;

	bSuccess = oTempXML.loadXML( "<calls></calls>" );
	oNodeList = oCallsXML.selectNodes( sFilterString );
	oTempNode = oNodeList.nextNode;

	while( oTempNode != null )
	{
		oTempXML.firstChild.appendChild( oTempNode.cloneNode( true ) );
		oTempNode = oNodeList.nextNode;
	}

	oChildNode = oTempXML.documentElement.childNodes.nextNode;

	while( oChildNode != null )
	{

		//is oChildNode a DJ
		if( oChildNode.getAttribute( "djid" ) != null )
		{
			//is oChildNode's djDRID in oTempXML
			iDJDRID = oChildNode.getAttribute("djdrid");


			if( oTempXML.selectNodes( 'calls/DevelopmentRequirement[@drid="' +
iDJDRID + '"]' ).length == 0 )
			{

				oChildNewnode = oChildNode.cloneNode(true);
			    oRoot.appendChild( oChildNewnode );
			}
			else
			{

			}
		}
		else //not a DJ so append
		{


			oChildNewnode = oChildNode.cloneNode(true);
		   oRoot.appendChild( oChildNewnode );
		}
		oChildNode = oChildNode.nextSibling;
	}


	window.status = "Applying call stylesheet...";
	//document.all.callDiv.innerHTML = oFilteredXML.documentElement.xml;
	//document.all.callDiv.innerHTML = oFilteredXML.transformNode(
oCallsXSL.documentElement );
	window.status = "Done";

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of stevenson
Sent: 15 March 2002 10:53
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  javascript problem

In the JavaScript below, there is a pseudo-code in comments. Can someone
help me translate the pseudo code to javascript code?
Please assist.

var oFilteredXML = new ActiveXObject( "Msxml2.DOMDocument.4.0" );
        var oTempXML = new ActiveXObject( "Msxml2.DOMDocument.4.0" );

        bSuccess = oFilteredXML.loadXML( "<calls></calls>" );

        var oRoot = oFilteredXML.firstChild;


        oTempXML = oCallsXML.selectNodes( sFilterString );

        oChildNode = oTempXML.nextNode;

        while( oChildNode != null )
        {
                oChildNewnode = oChildNode.cloneNode(true);

                //is oChildNode a DJ

                        //is oChildNode's djDRID in oTempXML

                                //do not append

                        //else
                                //append
                        //end if
                //else
                        //append
                //end
            oRoot.appendChild( oChildNewnode );
                oChildNode = oTempXML.nextNode;
        }


        window.status = "Applying call stylesheet...";
        document.all.callDiv.innerHTML = oFilteredXML.documentElement.xml;
        document.all.callDiv.innerHTML = oFilteredXML.transformNode(
oCallsXSL.documentElement );
        window.status = "Done";



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • javascript problem
    • stevenson - Thu, 14 Mar 2002 07:01:32 -0500 (EST)
      • <Possible follow-ups>
      • stevenson - Fri, 15 Mar 2002 02:47:15 -0500 (EST)
        • stevenson - Fri, 15 Mar 2002 05:48:52 -0500 (EST) <=

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.