Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 8th, 2007, 12:36 PM
Registered User
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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>
 
Old June 15th, 2007, 11:57 AM
Registered User
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Any ideas?
 
Old June 15th, 2007, 12:10 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

No, no ideas.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT for parsing XHTML Form shahbhat XSLT 6 August 26th, 2008 06:22 PM
xslt to update only a portion of a page CesarSJU XSLT 4 April 29th, 2008 06:29 AM
Fanfold page printing using XSLT rajendra_mrprasad XSLT 0 May 9th, 2006 09:38 AM
How to Query XML Data from XSLT Form kwilliams XSLT 1 December 3rd, 2005 06:14 AM
HELP ME PLEASE!!! XML to XSLT FORM GEN elysio XSLT 1 November 15th, 2003 05:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.