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

Applying XSL and Javascript to XMLDOMNode objects

Subject: Applying XSL and Javascript to XMLDOMNode objects
From: ClareEvans@xxxxxxxxxxxxx
Date: Wed, 23 Feb 2000 19:18:00 -0000
xmldomnode
Scenario: creating an on-line form on the fly from datastore using XML and
XSL

Exert from XML I am working with to dynamically create form is:

<RECORD>
	<INTRODUCTION>Please complete all sections of the form before
submitting</INTRODUCTION>
	<SECTIONNAME>User Details</SECTIONNAME>
	<QUESTION>Name</QUESTION>
	<ANSWERTYPE>text</ANSWERTYPE>
	<DESCRIPTION></DESCRIPTION>
	<VALIDATION>Required</VALIDATION>
</RECORD>
<RECORD>
	<INTRODUCTION>Please complete all sections of the form before
submitting</INTRODUCTION>
	<SECTIONNAME>User Details</SECTIONNAME>
	<QUESTION>Department</QUESTION>
	<ANSWERTYPE>radio</ANSWERTYPE>
	<DESCRIPTION>Information Systems</DESCRIPTION>
	<VALIDATION>Required</VALIDATION>
</RECORD>

Exert from XSL record template for this particular section is as follows:

<xsl:when match=".//ANSWERTYPE[.='text']">
	<input >
		<xsl:attribute
name="class"><xsl:eval>funcValidation(this)</xsl:eval></xsl:attribute>
		<xsl:attribute name="id"><xsl:value-of
select="."/></xsl:attribute>
		<xsl:attribute name="type"><xsl:value-of
select="."/></xsl:attribute>
	</input>
</xsl:when>

Problem: need to write a JavaScript function ( as referenced above at
funcValidation) called locally when parsing the <ANSWERTYPE> element.
Function will assign the value of <VALIDATION> to the class attribute of the
<input> tag.

However using Javascript how the heckas can I do this at run-time (using
IE4)?

Beer to the man that can.

Clare

 02/23/00 19:18:05
------------------------------------------------------------------------------
Part of the Halifax Group, Halifax Group plc, Registered in England No. 2367076.  Registered Office: Trinity Road, Halifax, West Yorkshire HX1 2RG. Represents only the Halifax Financial Services Marketing Group for the purposes of advising on and selling life assurance, pensions and unit trust business.  The Marketing Group is regulated by the Personal Investment Authority.  Switchboard 01422 333333.


==============================================================================


 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.