Form on XSLT Page
I'm having a problem that's a little difficult to describe. I'm trying to create a type of wizard for a support website, where someone would be taken through specific questions in order to create a new support request. The questions change depending on which product is selected. I have an html form on an XSLT page, which consists of drop down menus which are populated from an XML data file. For the form action, I created an ASP web service, which stores the options selected in session variables for later use, then redirects to the next page depending on which option is selected. The problem is that I cannot get more than 2 pages deep in the process. For some reason, no matter which XML page I try to load, that one works, but then the following one does not. It looks for some reason like the path to the form action on the XSLT page is being changed the 2nd time through. It should be action="process.asmx/{$id}", where id is a variable that calls the appropriate function in the web service. When I try to submit the form from the 2nd page, it gives an error that it can't find the function in the web service, and the URL has all the variables (post request), but it's pointing to .../process.asmx/id/process.asmx/id
so it's adding an additional "process.asmx" to the path. To be clear, everything works fine for the 1st page, or if I load one of the other pages by itself, then follow the steps from there. All parameters are passed, and the right function is called by from the XSL variable. I'm using Visual Studio 2005 for this, with the web service code in c#.
Thanks!
XML file (there are several, but all structured the same way):
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="format.xsl"?>
<supportQuestions level="2" id="L2">
<step name="questionArea">
<text>What is the area of your question?</text>
<choice>
<text>Problem</text>
<value>1</value>
</choice>
<choice>
<text>Functionality</text>
<value>2</value>
</choice>
<choice>
<text>Product Question</text>
<value>3</value>
</choice>
<choice>
<text>Comment</text>
<value>4</value>
</choice>
</step>
</supportQuestions>
XSLT File (I cut out the irrelevant CSS code)
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [<!ENTITY nbsp "#160;">]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="supportQuestions">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<form name="selection" method="post" action="process.asmx/{@id}">
<xsl:for-each select="step">
<b>
<xsl:value-of select="text"/>
</b>
<xsl:variable name="group" select="group"/>
<xsl:variable name="name" select="@name"/>
<br/>
<select id ="list" name="{$name}">
<xsl:for-each select ="choice">
<option value="{value}">
<xsl:value-of select="text"/>
</option>
</xsl:for-each>
</select>
<br/>
<br/>
</xsl:for-each>
<br/>
<input id="Submit1" style="width: 50px" type="submit" value="Next >"/>
</form>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
|