473,396 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:dates="urn:rdcpro-com:dates"

<xsl:output method="xml" encoding="UTF-8"/>
<xsl:param name="username" select="general/data/rows/row"/>
<xsl:param name="city" select="$username/fvalues/fcity"/>
<xsl:param name="debiteurnr" select="$username/fvalues/fdebno"/>
<xsl:param name="direction">ascending</xsl:param>
<xsl:param name="sortBy">fusername</xsl:param>
<xsl:variable name="tableData">
<xsl:apply-templates
select="$username/fvalues[fcity=$city][fdebno=$debiteurnr]"
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="$direction"/>
<br/>
Sort Column:
<xsl:value-of select="$sortBy"/>
</div>
<table border="1" class="results" align="center" cellpadding="5"
cellspacing="0">
<tr>
<th>
<a class="clickanchor" onclick="renderData('fclient');">
<xsl:value-of select="cols/fclient/@caption"/>
</a>
</th>
<th>
<a class="clickanchor" onclick="renderData('fid');">
<xsl:value-of select="cols/fid/@caption"/>
</a>
</th>
<th>
<a class="clickanchor" onclick="renderData('fusername');">
<xsl:value-of select="cols/fusername/@caption"/>
</a>
</th>
<th>
<a class="clickanchor" onclick="renderData('fname');">
<xsl:value-of select="cols/fname/@caption"/>
</a>
</th>
<th>
<a class="clickanchor" onclick="renderData('fcity');">
<xsl:value-of select="cols/fcity/@caption"/>
</a>
</th>
<th>
<a class="clickanchor" onclick="renderData('fdebno');">
<xsl:value-of select="cols/fdebno/@caption"/>
</a>
</th>
</tr>
<xsl:apply-templates select="msxsl:node-set($tableData)">
<xsl:sort select="*[name()=$sortBy]" order="{$direction}"/>
</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(current())]/@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(current())]/@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="Sleutelveld" color="" width="40" type="number"
visible="True" />
<fusername caption="Username" color="" width="60" type="number"
visible="True" />
<fname caption="Naam" color="" width="120" type="text"
visible="True" />
<fcity caption="Woonplaats" color="" width="100" type="text"
visible="True" />
<factive caption="Active" color="" width="60" type="text"
visible="False" />
<fdebno caption="debiteurnr" color="" width="80" type="number"
visible="True" />
<fpassword caption="password" color="" width="10" type="text"
visible="False" />
</cols>
<rows>
<row>
<id value="32" />
<fvalues>
<fclient>0</fclient>
<fid>103</fid>
<fusername>Pietje</fusername>
<fname>Pieters Autotransport B.V.</fname>
<fcity>Hoogeveen</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>willie</fusername>
<fname>willie bruining</fname>
<fcity>blijham</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>Bertje</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>Billie</fusername>
<fname>Billie bruining</fname>
<fcity>billieham</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 1528

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

Similar topics

3
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"?>...
2
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...
0
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:...
2
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 -...
1
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...
2
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"...
0
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...
0
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...
3
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.