473,769 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XSL stylesheet: why do data appear outside table?

Hiya,
I have this stylesheet (based on an example @
http://rdcpro.com/xmldev/filterandsort)which I'm trying to modify so
that it will work for my own XML and I get some data but it doesn't
appear within the table as intended. Does anyone know why this is?
This is my XSL followed by my XML. I hope someone can help me! love,
Sharon

<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="ur n:schemas-microsoft-com:xslt"
xmlns:dates="ur n:rdcpro-com:dates"

<xsl:output method="xml" encoding="UTF-8"/>
<xsl:param name="username" select="general/data/rows/row"/>
<xsl:param name="city" select="$userna me/fvalues/fcity"/>
<xsl:param name="debiteurn r" select="$userna me/fvalues/fdebno"/>
<xsl:param name="direction ">ascending </xsl:param>
<xsl:param name="sortBy">f username</xsl:param>
<xsl:variable name="tableData ">
<xsl:apply-templates
select="$userna me/fvalues[fcity=$city][fdebno=$debiteu rnr]"
mode="tableData " />
</xsl:variable>
<xsl:template match="general/data">
<div align="left">
<div class="content" align="right" style="padding-bottom:4px;">
Sort Direction:
<xsl:value-of select="$direct ion"/>
<br/>
Sort Column:
<xsl:value-of select="$sortBy "/>
</div>
<table border="1" class="results" align="center" cellpadding="5"
cellspacing="0" >
<tr>
<th>
<a class="clickanc hor" onclick="render Data('fclient') ;">
<xsl:value-of select="cols/fclient/@caption"/>
</a>
</th>
<th>
<a class="clickanc hor" onclick="render Data('fid');">
<xsl:value-of select="cols/fid/@caption"/>
</a>
</th>
<th>
<a class="clickanc hor" onclick="render Data('fusername ');">
<xsl:value-of select="cols/fusername/@caption"/>
</a>
</th>
<th>
<a class="clickanc hor" onclick="render Data('fname');" >
<xsl:value-of select="cols/fname/@caption"/>
</a>
</th>
<th>
<a class="clickanc hor" onclick="render Data('fcity');" >
<xsl:value-of select="cols/fcity/@caption"/>
</a>
</th>
<th>
<a class="clickanc hor" onclick="render Data('fdebno'); ">
<xsl:value-of select="cols/fdebno/@caption"/>
</a>
</th>
</tr>
<xsl:apply-templates select="msxsl:n ode-set($tableData) ">
<xsl:sort select="*[name()=$sortBy]" order="{$direct ion}"/>
</xsl:apply-templates>
</table>
</div>
</xsl:template>
<xsl:template match="rows/row/fvalues">
<tr>
<xsl:for-each select="*">
<xsl:if test="/general/data/cols/*[name()=name(cur rent())]/@visible='True' ">
<td>
<xsl:value-of select="."/>
</td>
</xsl:if>
</xsl:for-each>
</tr>
</xsl:template>
<xsl:template match="fvalues" mode="tableData ">
<xsl:copy>
<xsl:for-each select="*">
<xsl:if test="/general/data/cols/*[name()=name(cur rent())]/@visible='True' ">
<xsl:copy-of select="."/>
</xsl:if>
</xsl:for-each>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>

<?xml version="1.0" encoding="utf-8" ?>
<general>
<data>
<header></header>
<global>
<orderby />
<created />
</global>
<cols>
<fclient caption="Client " color="" width="70" type="number"
visible="True" />
<fid caption="Sleute lveld" color="" width="40" type="number"
visible="True" />
<fusername caption="Userna me" color="" width="60" type="number"
visible="True" />
<fname caption="Naam" color="" width="120" type="text"
visible="True" />
<fcity caption="Woonpl aats" color="" width="100" type="text"
visible="True" />
<factive caption="Active " color="" width="60" type="text"
visible="False" />
<fdebno caption="debite urnr" color="" width="80" type="number"
visible="True" />
<fpassword caption="passwo rd" color="" width="10" type="text"
visible="False" />
</cols>
<rows>
<row>
<id value="32" />
<fvalues>
<fclient>0</fclient>
<fid>103</fid>
<fusername>Piet je</fusername>
<fname>Pieter s Autotransport B.V.</fname>
<fcity>Hoogevee n</fcity>
<factive>True </factive>
<fdebno>1</fdebno>
<flanguage>NL </flanguage>
<fpassword>Flup </fpassword>
</fvalues>
</row>
<row>
<id value="43" />
<fvalues>
<fclient>0</fclient>
<fid>43</fid>
<fusername>will ie</fusername>
<fname>willie bruining</fname>
<fcity>blijha m</fcity>
<factive>True </factive>
<fdebno>8</fdebno>
<flanguage>NL </flanguage>
<fpassword>Kwik </fpassword>
</fvalues>
</row>
<row>
<id value="21" />
<fvalues>
<fclient>0</fclient>
<fid>83</fid>
<fusername>Bert je</fusername>
<fname>Bertje Autotransport B.V.</fname>
<fcity>Meppel </fcity>
<factive>True </factive>
<fdebno>1</fdebno>
<flanguage>NL </flanguage>
<fpassword>Kwek </fpassword>
</fvalues>
</row>
<row>
<id value="64" />
<fvalues>
<fclient>0</fclient>
<fid>73</fid>
<fusername>Bill ie</fusername>
<fname>Billie bruining</fname>
<fcity>billieha m</fcity>
<factive>True </factive>
<fdebno>8</fdebno>
<flanguage>NL </flanguage>
<fpassword>Kwak </fpassword>
</fvalues>
</row>
</rows>
</data>
<footer></footer>
</general>
Jul 20 '05 #1
0 1549

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

Similar topics

3
3103
by: Sarah Haskins | last post by:
I have a few questions about this problem I'm having involving XML, DTD, and XSL. I'm working with this DTD which defines a stylesheet, as such... <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="abc-xsl.xsl"?> <!ELEMENT ABCMessage (Tag1, Tag2, Tag3, Tag4, Tag5, Tag6, Tag7, Tag8*)> <!ATTLIST ABCMessage
2
2823
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/authoring-faq Posting-Frequency: twice a week (Mondays and Thursdays) Last-modified: August 28, 2002 Version: 1.15 URL: http://css.nu/faq/ciwas-aFAQ.html Maintainer: Jan Roland Eriksson <rex@css.nu> ciwas stylesheet authoring FAQ v1.15 ______________________________________________________________________
0
1960
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/authoring-faq Posting-Frequency: twice a week (Mondays and Thursdays) Last-modified: April 10, 2003 Version: 1.16 URL: http://css.nu/faq/ciwas-aFAQ.html Maintainer: Jan Roland Eriksson <rex@css.nu> ciwas stylesheet authoring FAQ v1.16 ______________________________________________________________________
2
3519
by: Richard L Rosenheim | last post by:
I loaded a XSLT stylesheet into a XMLDocument to retrieve some of the data. I received an exception when the SelectNodes method was invoked. The message was "System.Xml.XPath.XPathException - Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function." Q324899 I queried MSDN for Namespace Manager and found this article: "Manage namespaces Using the XmlNamespace Manager"...
1
6703
by: Dan | last post by:
Could someone please help me with auto importing a series of data files into an Access table. I tried to follow code given below in a previous messagebut i'm getting error messages. Here's my database stats: Path: C:\Database (contains the database and all the text files to be imported) Text files to import: (SampleData4.txt and SampleData3.txt as testing examples)
2
1292
by: ivan.svaljek | last post by:
I have a main page(aspx) with a usercontrol(ascx). Page has <LINK href="Styles.css" type="text/css" rel="StyleSheet"> Control has <LINK href="NovostiStyle.css" type="text/css" rel="stylesheet"> The table style defined in usercontrol's css somehow gets applied to table elements in main page.
0
14422
by: Grip | last post by:
Hi, I have gone throught the group and Microsoft's online help and have seen many suggestions but I am still seeking clarity: 1. I have an excel spreadsheet. Column A contains text that may be greater than 255 characters. 2. I have an access database. I link (not import) to the contents of the excel spreadsheet. In the design view in access, Column A has the data type "memo".
0
1011
by: Beemer Biker | last post by:
I am getting different behavior with the same style depending on where I define the style. The works fine and when I move the mouse the tooltip tracks the mouse when it rolls over the fields in my data grid: .... <style type="text/css"> #dhtmltooltip{ position: absolute;
3
3964
by: Emma Middlebrook | last post by:
Hi there, I've been trying to implement a repeater control in an ASP.NET 2 page but I can't seem to get the layout exactly how I want and I'm not sure if it's something that I am doing wrong or maybe the repeater control doesn't have the capabilities...? The page needs to display a custom number of sections that appear the same but have different data..
0
9589
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
10211
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
9994
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
9863
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
7408
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
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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.