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

RE: Embedding XSL in JavaScript

Subject: RE: Embedding XSL in JavaScript
From: "John Proctor" <jproctor0@xxxxxxxxxxx>
Date: Wed, 05 Mar 2003 20:17:50 +0000
strsearchxpath2

Excellent thank you very much for your kind efforts. John






From: "XSLList" <xsllist@xxxxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE:  Embedding XSL in JavaScript
Date: Wed, 5 Mar 2003 14:12:29 -0500

John,

I've taken 5 and built a (cheesy) example to do what you're talking about.
This example using selectSingleNode directly against the source without a
stylesheet.

http://home.earthlink.net/~xsllist/getcust.htm
http://home.earthlink.net/~xsllist/customer.xml

Use 'John Doe' as a search criteria as I haven't added case-insensitivity or
error-handling. All disclaimers about quality of hastily-prepared examples
apply!


Jeff


>Great Brian what I meant is I have the the following >javascript function and >I would like to perform Xpath functions such as sum() and >return a value >into say a field. So I wondered if it was possible to embed >XSL into the >code in some way? > >function Search() > { > try > { > /**************************************************************** > This section is to input a value from Accno.value > search and then populate the fields > *****************************************************************/ > var strSearchValue = Accno.value; > var strSearchXPath2 = "INVOICE/DETAILS[@ACCNO='" >+strSearchValue + >"']" > var y; > y=docInvoice.getElementsByTagName(strSearchXPath2); > //Assign values to fields > txtCustomer.value = y.item(0).getAttribute("CUSTOMER"); > txtAddress.value = y.item(0).getAttribute("ADDRESS"); > txtCity.value = y.item(0).getAttribute("City"); > txtState.value = y.item(0).getAttribute("STATE"); > txtZip.value = y.item(0).getAttribute("ZIP"); > } > catch (error) > { > alert("An error occured in the function Search() The error was:" + >error.description); > } >}


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


_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today! http://messenger.msn.co.uk



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



Current Thread

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.