[jQuery] XML parsing issue with facebox

[jQuery] XML parsing issue with facebox


Here is my issue. I am dynamically generating XML data that is to
appear in the facebox as a means of displaying additional information
about a product if so desired by the customer. My problem is this:
I have set up the various <xls:for each...> <choose> etc., etc., which
break down the xml data into divs and text tags that i want to be seen
by the viewer. All of these are working properly, generating new
content for each product (name price, image, etc.) within my for each
i have also included a hidden div to display using facebox. within
this div there are various pieces of xml data including features,
plan, etc.
the problem:
the data in the the div which facebox is supposed to display only ever
display information for the first list product. Why is this? my code
is below. I am new, so bare with me if you see certain snippets that
aren't as polished as they could be:
<?xml version="1.0" encoding="utf-8"?>
<!-- DWXMLSource="http://store.telusmobility.com/telusPhones.xml" -->
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#160;">
<!ENTITY copy "&#169;">
<!ENTITY reg "&#174;">
<!ENTITY trade "&#8482;">
<!ENTITY mdash "&#8212;">
<!ENTITY ldquo "&#8220;">
<!ENTITY rdquo "&#8221;">
<!ENTITY pound "&#163;">
<!ENTITY yen "&#165;">
<!ENTITY euro "&#8364;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform">
<xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//
DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/
xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/
<title>Untitled Document</title>
<link href="mainteluscss.css" rel="stylesheet" type="text/css" />
<script src="scripts/jquery-1.2.6.js"></script>
<script src="facebox/facebox.js"></script>
<link href="facebox/facebox.css" rel="stylesheet" type="text/css" /
<script type="text/javascript">
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox({
loading_image : 'loading.gif',
close_image : 'closelabel.gif'
})
})
</script>
<script type="text/javascript">
// When the document loads do everything inside here ...
$(document).ready(function(){
$("#content_2").addClass("hidden");
$("#content_3").addClass("hidden");
// When a link is clicked
$("#menu a.tab").click(function () {
// switch all tabs off
$(".active").removeClass("active");
// switch this tab on
$(this).addClass("active");
// slide all elements with the class 'content' up
$(".content").hide();
// Now figure out what the 'title' attribute value
is and find the
element with that id. Then slide that down.
var content_show = $(this).attr("title");
$("#"+content_show).show();
});
});
</script>
</head>
...........
the problem area is below (just my java in case that could be the
issue)
................
<xsl:for-each select="phones/phone">
<xsl:sort select="cross"/>
<xsl:choose>
<xsl:when test="@manufacturer='Apple'">
</xsl:when>
<xsl:when test="pricing/@price=0">
</xsl:when>
<xsl:when test="name='Pay &amp; Talk Samsung a645'">
</xsl:when>
<xsl:when test="name='Pay &amp; Talk LG 490
Fastap'">
</xsl:when>
<xsl:when test="name='Pay &amp; Talk LG 245'">
</xsl:when>
<xsl:when test="name='LG 200 (web only)'">
</xsl:when>
<xsl:when test="name='Pay &amp; Talk Starter Kit'">
</xsl:when>
<xsl:when test="name='LG 285'">
</xsl:when>
<xsl:when test="name='SPARK&trade;Music Box'">
</xsl:when>
<xsl:when test="name='Global Roaming Starter Kit'">
</xsl:when>
<xsl:when test="name='Motorola M800 Bag Phone'">
</xsl:when>
<xsl:when test="name='Pink BlackBerry&reg;
Pearl&trade; Gift Box'">
</xsl:when>
<xsl:when test="name='Sierra Wireless Aircard 595U
USB Modem (Rev A)'">
</xsl:when>
<xsl:when test="name='Sierra Wireless Aircard 595
&lt;br&gt;(Rev A)'">
</xsl:when>
<xsl:when test="name='ZTE MY39 Wireless EVDO PC
card'">
</xsl:when>
<xsl:when test="@thumbnail='http://
store.telusmobility.com/graphics/StoreBox/products/1476/
thumbnail__sierra_597e_handset_sm.gif'">
</xsl:when>
<xsl:when test="@thumbnail='http://
store.telusmobility.com/graphics/StoreBox/products/1339/
thumbnail__lg_8600_handset_sm.gif'">
</xsl:when>
<xsl:when test="@thumbnail='http://
store.telusmobility.com/graphics/StoreBox/products/1380/
thumbnail__w385pt.gif'">
</xsl:when>
<xsl:when test="name='SPARK&trade; Music Box'">
</xsl:when>
<xsl:when test="name='Hot Chocolate SPARK Music Box
LIMITED EDITION'">
</xsl:when>
<xsl:otherwise>
<div id="entry">
<div id="imageholder">
---------------------->facebox
content<-----------------------------------------------------------------
#info Text Link
<div id="info" style="display:none;">
<h1><xsl:value-of select="name"/></h1>
<xsl:attribute name="src"><xsl:value-
of select="@thumbnail"/></xsl:attribute></img>
</div>
----------------------->rest of xml parsing continues
below<------------------------------------
<div id="phonename">
<h1><xsl:value-of select="name"/></h1>
</div>
<div id="holderbkgd">
<div id="holder">
<div id="phoneimage">
<xsl:attribute name="src"><xsl:value-of
select="@thumbnail"/></xsl:attribute>
</img> </div>
<div id="phoneprice">
$<xsl:value-of select="pricing/@price"/>
</div>
</div>
</div>
</div>
.....more content below is omitted.........
Any help you can give me with this issue would be HUGELY (caps
necessary) appreciated.
Chad.
--
View this message in context: http://www.nabble.com/XML-parsing-issue-with-facebox-tp18071429s27240p18071429.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.