RE: [xsl] URL parameters in xsl

Subject: RE: [xsl] URL parameters in xsl
From: "Martin Lampen" <mlampe@xxxxxxxxxxx>
Date: Thu, 22 May 2003 04:43:11 -0500
Hi Jeni,

When I use Americo's code, I get the following error..

'The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML document. 

/default.asp, line 14 '

The xsl stylesheet is as follows...

<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match="/">
<xsl:param name="uid"/>



<html>
<head>
<title>BT Six Sigma Training</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="css/scripts.css" type="text/css" />
<style type="text/css">
@import "css/menu.css";
</style>
<script src="scripts/utils.js" type="text/javascript"></script>
<script src="scripts/AnimTree.js" type="text/javascript"></script>
<script src="scripts/treeparams.js" type="text/javascript"></script>
<script src="scripts/buttons.js" type="text/javascript"></script>
<script src="scripts/CSJSRequestObject.js" type="text/javascript"></script>
	<script src="scripts/getuid.js" type="text/javascript"></script>
</head>
<body onLoad="MM_preloadImages('images/home_o.gif','images/resourses_o.gif','images/glossary_o.gif','images/help_o.gif','images/return_o.gif','images/previous_o.gif','images/replay_o.gif','images/next_o.gif');">
<div> 

<table width="761" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><img src="images/branding.gif" width="761" height="64" alt="*" /></td>
    </tr>
  </table>
  <table width="761" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><img src="images/top_r1_c1.gif" width="5" height="5" alt="*" /></td>
      <td><img src="images/top_r1_c2.gif" width="154" height="5" alt="*" /></td>
      <td><img src="images/top_r1_c2.gif" width="148" height="5" alt="*" /></td>
      <td><img src="images/top_r1_c2.gif" width="149" height="5" alt="*" /></td>
      <td><img src="images/top_r1_c2.gif" width="149" height="5" alt="*" /></td>
      <td><img src="images/top_r1_c2.gif" width="151" height="5" alt="*" /></td>
      <td><img src="images/top_r1_c3.gif" width="5" height="5" alt="*" /><img src="images/spacer.gif" width="5" height="1" alt="*" /></td>
    </tr>
    <tr bgcolor="#D6D7DB">
      <td><img src="images/top_r2_c1.gif" width="5" height="20" alt="*" /></td>
      <td bgcolor="#D6D7DB"></td>
      
    <td><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image47','','images/home_o.gif',1)"><img src="images/home.gif" alt="Home" name="Image47" width="148" height="20" border="0" id="Image47" /></a></td>
      <td><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image48','','images/resourses_o.gif',1)"><img src="images/resourses.gif" alt="Home" name="Image48" width="148" height="20" border="0" id="Image48" /></a></td>
      <td><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image49','','images/glossary_o.gif',1)"><img src="images/glossary.gif" alt="Home" name="Image49" width="148" height="20" border="0" id="Image49" /></a></td>
      <td><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image50','','images/help_o.gif',1)"><img src="images/help.gif" alt="Home" name="Image50" width="148" height="20" border="0" id="Image50" /></a></td>
      <td><img src="images/top_r2_c3.gif" width="5" height="20" alt="*" /></td>
    </tr>
    <tr>
      <td><img src="images/top_r3_c1.gif" width="5" height="4" alt="*" /></td>
      <td><img src="images/top_r3_c2.gif" width="154" height="4" alt="*" /></td>
      <td><img src="images/top_r3_c2.gif" width="148" height="4" alt="*" /></td>
      <td><img src="images/top_r3_c2.gif" width="149" height="4" alt="*" /></td>
      <td><img src="images/top_r3_c2.gif" width="149" height="4" alt="*" /></td>
      <td><img src="images/top_r3_c2.gif" width="151" height="4" alt="*" /></td>
      <td><img src="images/top_r3_c3.gif" width="5" height="4" alt="*" /></td>
    </tr>
  </table>
  <table width="761" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td><table width="160" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td><img src="images/nav_r1_c1.gif" width="5" height="5" alt="*" /></td>
            <td><img src="images/nav_r1_c2.gif" width="150" height="5" alt="*" /></td>
            <td><img src="images/nav_r1_c3.gif" width="5" height="5" alt="*" /></td>
          </tr>
          <tr> 
            <td rowspan="2"><img src="images/nav_r2_c1.gif" width="5" height="397" alt="*" /></td>
            <td bgcolor="#d6d7db" height="300"><!-- Menutree start -->
	          <div id="nav"><xsl:for-each select="TRAINING/MODULE"> 
                <table width="150" border="0" cellspacing="0" cellpadding="0" bgcolor="#d6d7db">
                  <tr> 
                    <td height="21" width="150" background="images/blank.gif">	
                      <div class="button"><xsl:attribute name="id"><xsl:value-of select="NAME"/></xsl:attribute> 
                        <a href="#" class="buttonlabel" onclick='toggleMenu(this)'> 
                        <img src='images/side_nav_blue.gif' border="0"/><span onClick="this.style.color='C73434'" onMouseOut="this.style.color='00405F'"
><xsl:value-of 
select="NAME" /></span></a> </div></td>
                  </tr>
                  <tr> 
                    <td bgcolor="cccccc"><div class="menu" ><xsl:for-each select="CHAPTER"> 
                        <xsl:attribute name="id"><xsl:value-of select="PARENTNAME"/>Menu</xsl:attribute> 
                        <div class="menuNode"><a ><xsl:attribute name="href">default.asp?id=<xsl:value-of select="ID"/>%26parent=<xsl:value-of select="PARENTNAME"/>%26size=<xsl:value-of select="SIZE"/>%26description=<xsl:value-of select="DESCRIPTION"/></xsl:attribute><xsl:value-of 
select="NAME" /></a> </div>
                        </xsl:for-each> </div></td>
                  </tr>
                </table>
                </xsl:for-each> </div>
</td> 
            <td rowspan="2"><img src="images/nav_r2_c3.gif" width="5" height="397" alt="*" /></td>
          </tr>
		  		  <tr>
		<td bgcolor="#d6d7db" valign="bottom"><img src="images/celerant_logo.gif" alt="Celerent" />
		</td>
	</tr>
          <tr> 
            <td><img src="images/nav_r3_c1.gif" width="5" height="5" alt="*" /></td>
            <td><img src="images/nav_r3_c2.gif" width="150" height="5" alt="*" /></td>
            <td><img src="images/nav_r3_c3.gif" width="5" height="5" alt="*" /></td>
          </tr>
        </table>
	</td>
      <td>
	  	<table width="601" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td><img src="images/main_r1_c1.gif" width="4" height="5" alt="*" /></td>
            <td colspan="5"><img src="images/main_r1_c2.gif" width="592" height="5" alt="*" /></td>
            <td><img src="images/main_r1_c3.gif" width="5" height="5" alt="*" /></td>
          </tr>
          <tr> 
            <td><img src="images/main_r2_c1.gif" width="4" height="373" alt="*" /></td>
    <td colspan="5" valign="top"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"; width="588" height="370">
		<param name="movie" value="flash/what_is_6s.swf" />
        <param name="quality" value="high" />
        <embed src="flash/what_is_6s.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"; type="application/x-shockwave-flash" width="588" height="370"></embed></object></td>
            <td><img src="images/main_r2_c3.gif" width="5" height="373" alt="*" /></td>
          </tr>
          <tr> 
            <td><img src="images/main_r3_c1.gif" width="4" height="5" alt="*" /></td>
            <td colspan="5"><img src="images/main_r3_c2.gif" width="592" height="5" alt="*" /></td>
            <td><img src="images/main_r3_c3.gif" width="5" height="5" alt="*" /></td>
          </tr>
          <tr bgcolor="#D6D7DB"> 
            <td><img src="images/main_r4_c1.gif" width="4" height="19" alt="*" /></td>
            <td width="330" class="globaltext"><img src="images/spacer.gif" width="5" height="1" alt="*" />4 of 12 - the title is shown here</td>
			<td width="94" align="right"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image51','','images/return_o.gif',1)"><img src="images/return.gif" alt="Return to" name="Image51" border="0" id="Image51" /></a></td>
			<td width="63" align="right"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image52','','images/previous_o.gif',1)"><img src="images/previous.gif" alt="Previous" name="Image52" border="0" id="Image52" /></a></td>
			<td width="80" align="right"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image53','','images/replay_o.gif',1)"><img src="images/replay.gif" alt="Replay" name="Image53" border="0" id="Image53" /></a></td>
			<td width="60" align="right"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image54','','images/next_o.gif',1)"><img src="images/next.gif" alt="Next" name="Image54" border="0" id="Image54" /></a></td>
            <td><img src="images/main_r4_c3.gif" width="5" height="19" alt="*" /></td>
          </tr>
          <tr> 
            <td><img src="images/main_r5_c1.gif" width="4" height="5" alt="*" /></td>
            <td colspan="5"><img src="images/main_r5_c2.gif" width="592" height="5" alt="*" /></td>
            <td><img src="images/main_r5_c3.gif" width="5" height="5" alt="*" /></td>
          </tr>
        </table></td>
    </tr>
  </table>
</div>
</body>
</html>
  </xsl:template>
  </xsl:stylesheet>

and the xml document...

<?xml version="1.0" encoding="ISO8859-1" ?>
<TRAINING>
	<UID><script language="javascript">
			document.write(uid);
		</script></UID>
	<MODULE>
		<NAME>Introduction</NAME>
		<SIZE>5</SIZE>
		<ID>5</ID>
			<CHAPTER>
				<NUMBER>1</NUMBER>
				<SIZE>5</SIZE>
				<NAME>hello</NAME>
				<PARENTNAME>Introduction</PARENTNAME>
				<NUMBER>1</NUMBER>
				<DESCRIPTION>first slide</DESCRIPTION>
				<ID>1</ID>
				<RESOURCE>dsdsds.swf</RESOURCE>
			</CHAPTER>
			<CHAPTER>
				<NUMBER>2</NUMBER>
				<SIZE>5</SIZE>
				<NAME>jonny</NAME>
				<PARENTNAME>Introduction</PARENTNAME>
				<NUMBER>2</NUMBER>
				<DESCRIPTION>first slide</DESCRIPTION>
				<ID>2</ID>
				<RESOURCE>dsdsds.swf</RESOURCE>
			</CHAPTER>
			<CHAPTER>
				<NUMBER>3</NUMBER>
				<SIZE>5</SIZE>
				<NAME>hi !</NAME>
				<PARENTNAME>Introduction</PARENTNAME>
				<NUMBER>1</NUMBER>
				<DESCRIPTION>first slide</DESCRIPTION>
				<ID>3</ID>
				<RESOURCE>dsdsds.swf</RESOURCE>
			</CHAPTER>
	</MODULE>
		<MODULE>
		<NAME>Define</NAME>
		<ID>2</ID>
		<SIZE>90</SIZE>
			<CHAPTER>
				<NUMBER>1</NUMBER>
				<SIZE>5</SIZE>
				<NAME>chapter 1</NAME>
				<PARENTNAME>Define</PARENTNAME>
				<NUMBER>1</NUMBER>
				<DESCRIPTION>first slide</DESCRIPTION>
				<ID>4</ID>
				<RESOURCE>dsdsds.swf</RESOURCE>
			</CHAPTER>
	</MODULE>
	<MODULE>
		<NAME>Measure</NAME>
		<ID>3</ID>
		<SIZE>5</SIZE>
			<CHAPTER>
				<NUMBER>1</NUMBER>
				<SIZE>5</SIZE>
				<NAME>chapter 1</NAME>
				<PARENTNAME>Measure</PARENTNAME>
				<NUMBER>1</NUMBER>
				<DESCRIPTION>first slide</DESCRIPTION>
				<ID>5</ID>
				<RESOURCE>dsdsds.swf</RESOURCE>
			</CHAPTER>
	</MODULE>
		<MODULE>
		<NAME>Analyse</NAME>
		<ID>4</ID>
		<SIZE>5</SIZE>
			<CHAPTER>
				<NUMBER>1</NUMBER>
				<SIZE>5</SIZE>
				<NAME>chapter 1</NAME>
				<PARENTNAME>Analyse</PARENTNAME>
				<NUMBER>1</NUMBER>
				<DESCRIPTION>first slide</DESCRIPTION>
				<ID>6</ID>
				<RESOURCE>dsdsds.swf</RESOURCE>
			</CHAPTER>
	</MODULE>
		<MODULE>
		<NAME>Improve</NAME>
		<ID>9</ID>
		<SIZE>5</SIZE>
			<CHAPTER>
				<NUMBER>1</NUMBER>
				<SIZE>5</SIZE>
				<NAME>chapter 1</NAME>
				<PARENTNAME>Improve</PARENTNAME>
				<NUMBER>1</NUMBER>
				<DESCRIPTION>first slide</DESCRIPTION>
				<ID>7</ID>
				<RESOURCE>dsdsds.swf</RESOURCE>
			</CHAPTER>
	</MODULE>
		<MODULE>
		<NAME>Control</NAME>
		<ID>3</ID>
		<SIZE>5</SIZE>
			<CHAPTER>
				<NUMBER>1</NUMBER>
				<SIZE>5</SIZE>
				<NAME>chapter 1</NAME>
				<PARENTNAME>Control</PARENTNAME>
				<NUMBER>1</NUMBER>
				<DESCRIPTION>first slide</DESCRIPTION>
				<ID>8</ID>
				<RESOURCE>dsdsds.swf</RESOURCE>
			</CHAPTER>
	</MODULE>
		<PAGES>
				<SLIDE>
				<ID>1</ID>
				<SLIDEPARENT>Intro</SLIDEPARENT>
				<SLIDEASSET>1.swf</SLIDEASSET>
				<SLIDENUMBER>1</SLIDENUMBER>
				<CHAPTERSIZE>20</CHAPTERSIZE>
				<NEXT>1</NEXT>
				<PREVIOUS>1</PREVIOUS>
				</SLIDE>
		</PAGES>
	</TRAINING>

<?xml version="1.0"?>







-----Original Message-----
From: Jeni Tennison [mailto:jeni@xxxxxxxxxxxxxxxx]
Sent: 22 May 2003 10:37
To: Martin Lampen
Cc: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] URL parameters in xsl


Hi Martin,

> I've tried all your suggestions from a couple of days ago and
> nothing works. I'm really losing sleep over it.

The code that you show in your ASP page won't work because you're
using the wrong kind of DOM objects (MSXML2 rather than MSXML3) and
you're not passing in the uid as a parameter into the stylesheet so
there's no way that the stylesheet can know about it.

The code that Americo sent you should work. If it doesn't, please can
you show us:

  1. the ASP page that you are using (which should be Americo's code)
  2. the XSLT stylesheet that you are using
  3. the XML document that you are processing
  4. the output that you want
  4. the error that you're getting (if you're getting an error) or the
     output that you're getting if you're getting some output but it's
     not the output that you want

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread