473,769 Members | 2,430 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

xsl not transforming correctly

I am an XSL newbie and this is my first XSL example. It does not render
any rows in the table. It only shows the table header row with the
column lables; no data rows. Please guide me.

XML FILE
========
<?xml version="1.0" encoding="ISO88 59-1" ?>
<?xml-stylesheet type="text/xsl" href="booklist. xsl"?>
<BOOKLIST>
<BOOK>
<TITLE>Programm ing in the key of C#</TITLE>
<AUTHOR>Charl es Petzold</AUTHOR>
<PUBLISHER>Micr osoft Press</PUBLISHER>
</BOOK>

<BOOK>
<TITLE>Code: the hidden language of computer hardware and
software</TITLE>
<AUTHOR>Charl es Petzold</AUTHOR>
<PUBLISHER>Micr osoft Press</PUBLISHER>
</BOOK>

<BOOK>
<TITLE>Applie d Microsoft .NET Framework Programming</TITLE>
<AUTHOR>Jeffr ey Richter</AUTHOR>
<PUBLISHER>Micr osoft Press</PUBLISHER>
</BOOK>
<BOOK>
<TITLE>CDO and MAPI Programming in Visual Basic</TITLE>
<AUTHOR>Dave Grundgieger</AUTHOR>
<PUBLISHER>O're illy</PUBLISHER>
</BOOK>

<BOOK>
<TITLE>Moving from VB to VB.NET: concepts and strategies</TITLE>
<AUTHOR>Dan Appleman</AUTHOR>
<PUBLISHER>A-press</PUBLISHER>
</BOOK>
</BOOKLIST>


XSL FILE
=========
<?xml version="1.0" encoding="ISO88 59-1" ?>
<xsl:styleshe et xmlns:xsl="http ://w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML>
<BODY>
<TABLE border="1" background-color="blue">
<TH>
<TD>Title</TD>
<TD>Author</TD>
<TD>Publisher </TD>
</TH>

<xsl:for-each select="BOOKLIS T/BOOK">
<TR>
<TD><xsl:valu e-of select="TITLE"/></TD>
<TD><xsl:valu e-of select="AUTHOR"/></TD>
<TD><xsl:valu e-of select="PUBLISH ER"/></TD>
</TR>
</xsl:for-each>
</TABLE>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>

Aug 29 '06 #1
2 1182
"Water Cooler v2" <wt*****@yahoo. comwrote in message
news:11******** **************@ b28g2000cwb.goo glegroups.com.. .
>I am an XSL newbie and this is my first XSL example. It does not render
any rows in the table. It only shows the table header row with the
column lables; no data rows. Please guide me.

XML FILE
========
<?xml version="1.0" encoding="ISO88 59-1" ?>
<?xml-stylesheet type="text/xsl" href="booklist. xsl"?>
<BOOKLIST>
<BOOK>
<TITLE>Programm ing in the key of C#</TITLE>
<AUTHOR>Charl es Petzold</AUTHOR>
<PUBLISHER>Micr osoft Press</PUBLISHER>
</BOOK>

<BOOK>
<TITLE>Code: the hidden language of computer hardware and
software</TITLE>
<AUTHOR>Charl es Petzold</AUTHOR>
<PUBLISHER>Micr osoft Press</PUBLISHER>
</BOOK>

<BOOK>
<TITLE>Applie d Microsoft .NET Framework Programming</TITLE>
<AUTHOR>Jeffr ey Richter</AUTHOR>
<PUBLISHER>Micr osoft Press</PUBLISHER>
</BOOK>
<BOOK>
<TITLE>CDO and MAPI Programming in Visual Basic</TITLE>
<AUTHOR>Dave Grundgieger</AUTHOR>
<PUBLISHER>O're illy</PUBLISHER>
</BOOK>

<BOOK>
<TITLE>Moving from VB to VB.NET: concepts and strategies</TITLE>
<AUTHOR>Dan Appleman</AUTHOR>
<PUBLISHER>A-press</PUBLISHER>
</BOOK>
</BOOKLIST>


XSL FILE
=========
<?xml version="1.0" encoding="ISO88 59-1" ?>
<xsl:styleshe et xmlns:xsl="http ://w3.org/TR/WD-xsl">
<xsl:template match="/">
<HTML>
<BODY>
<TABLE border="1" background-color="blue">
<TH>
<TD>Title</TD>
<TD>Author</TD>
<TD>Publisher </TD>
</TH>

<xsl:for-each select="BOOKLIS T/BOOK">
<TR>
<TD><xsl:valu e-of select="TITLE"/></TD>
<TD><xsl:valu e-of select="AUTHOR"/></TD>
<TD><xsl:valu e-of select="PUBLISH ER"/></TD>
</TR>
</xsl:for-each>
</TABLE>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
Dear Cooler

You are trying to use an outdated and obsolete pre-cursor to XSLT as shown
in the namespace "http://w3.org/TR/WD-xsl", (the WD stands for working
draft, I believe). This is only supported by early versions of MSXML and you
will find little or no documentation and support for it.
Change to the newer namespace of http://www.w3.org/1999/XSL/Transform.
You will find many examples of creating tables in HTML from raw XML online
or you can buy one of Michael Kay's excellent tomes.
I believe the example you have should work if you change the namespace as
outlined above, if you are still struggling let us know.

--

Joe Fawcett (MVP - XML)

http://joe.fawcett.name
Aug 29 '06 #2
Water Cooler v2 wrote:
I am an XSL newbie
Newbie? I'm increasingly beginning to think you're an out-an-out
Troll.

Learn to web search. Get some decent references that are less than 5
years old. Stop asking the most blindingly stupid questions, on any
topic, that it's just about possible to think up.

Aug 29 '06 #3

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

Similar topics

5
1782
by: Daniel Crespo | last post by:
Is there a built-in method for transforming (1,None,"Hello!") to 1,None,"Hello!"? Thanks
4
1934
by: Showjumper | last post by:
I am using the NITF DTD for my xml files and i need to use 2 xsl files to do the transform: one for the <body.head> and the second for the <body.content>. I've got this so far for transforming using 1 xsl file: Dim doc As New XmlDocument doc.LoadXml(xmlText) Dim xslDoc As New XslTransform xslDoc.Load(xslpath) Dim sw As New StringWriter xslDoc.Transform(doc, Nothing, sw, Nothing)
3
4878
by: Sergio Otoya | last post by:
Hi all, I need to transform an xml document, using xsl to a HTML output. I can do this successfully using the XslTransform class as below: Dim oTrans As New XslTransform oTrans.Load(sXSLPath) oTrans.Transform(sXMLPath, "c:\trans.htm")
4
2028
by: Cathie | last post by:
Hi All, I am trying to get my style sheet to work. It works fine in IE but I can't get it to work in .net. Below is the function I use for transforming, where advancedOptionsFile is the path to the file containing an XML document required by the transformation, and xmlSimplified is the XML document to trasform. ---------------------------------------------------------------------------- -------------------------------
4
2216
by: John Bowman | last post by:
Hi, I'm not certain this is the best place to post this, but here it goes. I'm trying to get spaces to work correctly when using the WebBrowser control. Basically, I've got a valid XML document and valid XSL file that I transform into an HTML file using .NET's XmlTransform object. This is all fine except for 1 thing. The XSL has a string of " " codes inside that looks something like:
0
9423
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,...
1
9998
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
9865
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...
0
8876
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
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
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3967
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
3567
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.