473,788 Members | 2,759 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem switching to my homepage

I was doing a test website where on one page somebody could select a
Genre from a drop-down list and it would display every sub-listing
under that specific Genre. If the user selected All it would display
everything. Now I have tried to implement it into my real homepage and
I am having a little problem. Now not only do I pass the Genre to my
XSLT but I pass the Hardware selection to the XSLT file. I get this
error.

"Expected token 'EOF' found ':'.
lc:Entertainmen t/lc-->:<--$Hardware

Here is my drop-down list
<select name="select1" onchange='CallX ML(this.form.se lect1, "PS2");'>
<option selected>Please Select a Genre</option>
<option value="All">All </option>
<option value="Fighting ">Fighting</option>
<option value="FPS">Fir st Person Shooter</option>
<option value="Platform er">Platforme r</option>
<option value="Sports"> Sports</option>
<option value="TPA">Thi rd Person Action</option>
</select>

Here is my Javascript file.
function CallXML(dropdow n, hardware)
{
var myIndex = dropdown.select edIndex;
var SelValue = dropdown.option s[myIndex].value;
var xsltTree = new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .4.0");
xsltTree.async = false;
xsltTree.load(" Entertainment.x slt")

var srcTree = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
srcTree.async = false;
srcTree.load("E ntertainment.xm l");

var xsltThread = new ActiveXObject(" Msxml2.XSLTempl ate.4.0");
xsltThread.styl esheet = xsltTree;
var xsltProc = xsltThread.crea teProcessor();
xsltProc.input = srcTree;
xsltProc.addPar ameter("Hardwar e", hardware);
xsltProc.addPar ameter("Genre", SelValue);
xsltProc.transf orm();
GameTable.inner HTML = xsltProc.output ;
}

Here is my XSLT file
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:lc="http://mark/Homepage">
<xsl:output method="html"/>
<xsl:param name="Hardware"/>
<xsl:param name="Genre"/>

<xsl:template match="/">
<xsl:choose>
<xsl:when test="$Genre = 'All'">
<xsl:call-template name="All" />
</xsl:when>
<xsl:otherwis e>
<xsl:call-template name="NotAll" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template name="All">
<table border="0">
<xsl:for-each select="lc:Ente rtainment/lc:$Hardware">
<tr>
<th colspan="2" bgcolor="Green" ><xsl:value-of
select="lc:Titl e"/></th>
</tr>
<tr>
<td>
<xsl:element name="IMG">
<xsl:attribut e name="SRC">
<xsl:value-of select="lc:Pict ure"/>
</xsl:attribute>
</xsl:element>
</td>
<td>
<xsl:value-of select="lc:Desc ription"/>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>

<xsl:template name="NotAll">
<table border="0">
<xsl:for-each select="lc:Ente rtainment/lc:$Hardware[lc:Genre =
$Genre]">
<tr>
<th colspan="2" bgcolor="Green" ><xsl:value-of
select="lc:Titl e"/></th>
</tr>
<tr>
<td>
<xsl:element name="IMG">
<xsl:attribut e name="SRC">
<xsl:value-of select="lc:Pict ure"/>
</xsl:attribute>
</xsl:element>
</td>
<td>
<xsl:value-of select="lc:Desc ription"/>
</td>
</tr>
</xsl:for-each>
</table>
</xsl:template>

</xsl:stylesheet>

Here is a portion of my XML file
<Entertainmen t xmlns="http://mark/Homepage/">
<PS2>
<Genre>Fighting </Genre>
<Picture>images \ps2\MortalKomb at.gif</Picture>
<Rating>5</Rating>
<Title>Mortal Kombat Deadly Alliance</Title>
<userCount>0</userCount>
<userRating>0 </userRating>
</PS2>
<PS2>
<Genre>Fighting </Genre>
<Picture>images \ps2\NoGif.gif</Picture>
<Rating>4</Rating>
<Title>Virtua Fighter 4: Evolution</Title>
<userCount>0</userCount>
<userRating>0 </userRating>
</PS2>
Jul 20 '05 #1
0 1747

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2045
by: Don Crossman | last post by:
Can someone tell me how to get this line to work? document.write (" <input type='button' value='Make this your home page' onclick='this.style.behavior="url(#default#homepage)"; this.setHomePage("http://www.somewhere.com");' />"); Seems no matter what I try, it either throws an error (expected ')'), or just does nothing. It would seem that escaping is not the answer in this case (it didn't work).
7
4793
by: Merlin | last post by:
Hi there, I have a serious problem with opening a new window with the help of JavaScript. The problem only occures with Firefox. Once you click on the item which fires up the open function, the new window opens up, but in the background the original window loads the homepage. I cant find a way to fix this so the site remains in the old window. Please have a look, if you click on the picture with the car you will see the problem.
4
1774
by: barabba72 | last post by:
Hi all, I cannot understand why, I simply create a new web site using Windows 2000, IIS 5. I use say c:\test as a home page, in this folder there is a file homepage.asp. I assign a dedicated ip address to this web site. If I try to browse to this web site I just get a "You are not
5
3146
by: Christian Stapfer | last post by:
After switching from Python 2.3 to 2.4 (Enought), PIL throws an exception that did not occur formerly (under Python 2.3) when executing ImageFont.truetype(font, size) where font = "C:/Windows/Fonts/comic.TTF". Here is the traceback that results:
2
2562
by: JS | last post by:
Hi all, Im having some troubles with layers on a site im developing. I have two layers one has an image of an artists palette on it and each blob of paint is a link to a page on the site. That uses an image map and hrefs. The second layer is where the page will appear. So when a user clicks a link on the palette image, a new 'window' will appear over the palette to show the content. The image of the palette will be slightly faded out to...
8
2348
by: DJA | last post by:
Hello, I site I designed has links that don't seem to work in mac IE 5.2. In my site I'm using CSS to imitate image buttons by using the background image property along with a little extra markup to make it work. When you mouse over the button the hover state is activated and the 'over' graphic is displayed, and the link url is displayed in the bottom left corner of the screen. When clicked, though, nothing happens and you are not...
0
880
by: Nitinkcv | last post by:
Hi, i have a common page called homepage.aspx. homepage is called from the start.aspx which has a list of names say soccer, football, baseball etc.. The body of the homepage.aspx should should be dynamic in the sense that when soocer is clicked the body of the homepage.aspx should render the contents of a page called soccer.html. similarly if footaball is clicked the the body should render the contents of a page football.html and so on. ...
2
2341
by: az538 | last post by:
Hello All, I am having a problem with my menu and submenu system. It works like a champ in IE6 and Firefox but IE7 renders the submenus in incorrect positions on the page. Also, the menu system is not working properly. Any help would be greatly appreciated. Here is the code: oM=new makeCM("oM"); oM.resizeCheck=1; oM.rows=1; oM.onlineRoot=""; oM.pxBetween =0; oM.fillImg="../../images/cm_fill.gif"; oM.fromTop=126; oM.fromLeft=195;...
25
2442
by: Jonno | last post by:
Hi I am having a problem with session vars being propagated between pages on this site: http://www.meettheancestors.com/sessiontest/index.php If you enter any user id and password and click Log In (no actual validation is performed), and then move around the other pages and/or keep refreshing the pages it will eventually display something that is incorrect i.e. saying your logged in when you aren't or vice versa. The exact same code...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10118
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2897
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.