OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

XSLT



Hi,
     I have the following XML and XSL files,
XML file :

<SurveyList surveyid="1">
<Survey>
<questionid questdepend="1" ansdepend="2">1</questionid>
<question>How much do you know about the technology team?</question>
<answers><answer questid="1" ansid="1">Fully</answer>
<answer questid="1" ansid="2">Partially</answer>
<answer questid="1" ansid="3">Not at all</answer>
</answers>
<defaultoption>1</defaultoption>
<delflagQ>N</delflagQ>
<controltype>radio</controltype>
</Survey>

and the following is the part of the xsl file

<xsl:variable name="questdepend" select
="questionid/@questdepend"></xsl:variable>
<xsl:variable name="ansdepend" select
="questionid/@ansdepend"></xsl:variable>
<xsl:variable name="questid" select="questionid"></xsl:variable>


<xsl:element name="INPUT">
     <xsl:attribute name="type"><xsl:value-of select
="$controltype"/></xsl:attribute>
     <xsl:attribute name="value"><xsl:value-of select="
@ansid"/></xsl:attribute>
     <xsl:attribute name="name"><xsl:value-of select
="$questid"/></xsl:attribute>
     <xsl:attribute name="onclick">enableQuestion
($questid,$questdepend,$ansdepend)</xsl:attribute>
</xsl:element>

at runtime i am including the attribute "onclick" and for onclick i am
calling a function named 'enableQuestion' with parameters which i want to
pass from the xml... i am doing it as above...i am keeping the xml values
in the variables and then writing them as the parameters of the function...

but this is not working fine the varibles values are not being replaced by
the value but the variable names are coming as it is like enableQuestion
($questid,$questdepend,$ansdepend) when i am transforming the xsl.

Can some body tell me how do i read the xml values as function
parameters...
Thanx,
Sweta