p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

ms_xsl thread: New To XML/XSL, Can You Help?


Message #1 by "Alan Tucker" <alan_tucker@b...> on Sun, 27 Jan 2002 09:12:25
I am new to XML and XSL and need some help.

I have created a .htm file which has two radio buttons and a submit 
button. Depending on what button you select, depends on what record style 
you would see. Please see the code below.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>
<HEAD>
	<TITLE>XML Search Results Test1</TITLE>
</HEAD>

<BODY>
<FORM ACTION="search_results.xml" NAME="frmXML" ID="frmXML">
<TABLE WIDTH="600" BORDER="1">
<TR>
	<TD>Please select which site you would like to see examples of 
the search results</TD>
</TR>
<TR>
	<TD><INPUT TYPE="radio" NAME="WEBSITE" VALUE="SITE1" CHECKED>SITE 
1</TD>
</TR>
<TR>
	<TD><INPUT TYPE="radio" NAME="WEBSITE" VALUE="SITE2">SITE 2</TD>
</TR>
<TR>
	<TD><INPUT TYPE="submit" NAME="submit" VALUE="GO TO >>>"></TD>
</TR>
</TABLE>
</FORM>

</BODY>
</HTML>

Once submitted this would go to search_results.xml. My search_results.xml 
page is as follows.

<?xml version="1.0"?>

<SEARCH_RESULTS>
	<RESULT_TYPE="SITE1">
		<PAGE_TITLE>Page Title</PAGE_TITLE>
		<STARS_IMAGE>Star Image</STARS_IMAGE>
		<PAGE_DESCRIPTION>Page Title</PAGE_DESCRIPTION>
		<PAGE_URL>Page URL</PAGE_URL>
	</RESULT>
	<RESULT_TYPE="SITE2">
		<PAGE_TITLE>Page Title</PAGE_TITLE>
		<PAGE_DESCRIPTION>Page Title</PAGE_DESCRIPTION>
		<PAGE_URL>Page URL</PAGE_URL>
	</RESULT>
</SERACH_RESULTS>

Now if they have selected the radio with the value of "SITE1" then this 
would display the layout for <RESULT_TYPE="SITE1">.

I would be very great full if someone would write the file(s) to do 
this. :-)

Thanks for all your support.

Alan

  Return to Index