473,473 Members | 2,021 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

where is the problem?

Hi!

I do not understand why it generates only tables with colors according to
css, and do not display any text or image.
plik catalog.xsl
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" />
<xsl:template match="/">
<html>
<head>
<title>catalog.xsl</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table align="center" class="episodb">
<tr>
<td>
<img>
<xsl:attribute name="src">
img/ <xsl:value-of select="/root/titleimg" />
</xsl:attribute>
</img>
</td>
</tr>
</table>
<br />
<xsl:for-each select="/root/brief/wers">
<table align="center" width="800" class="episodb">
<tr>
<td>
<xsl:value-of select="." />
</td>
</tr>
</table>
<br /> <br />
</xsl:for-each>
<table align="center" class="episodb">
<tr>
<td>
<img width="400">
<xsl:attribute name="src">
img/<xsl:value-of select="/root/foto/@name" />.gif
</xsl:attribute>
</img>
</td>
</tr>
</table>
<br /><br />
<table align="center" class="episodb">
<tr>
<td>
<xsl:value-of select="/root/foto" />
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

plik xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="catalog.xsl"?>
<root xmlns="http://www.w3schools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3schools.com catalog.xsd">

<titleimg>title.jpg</titleimg>
<brief>
<wers>
Two University of Colorado film students named Matt Stone and
Trey Parker made a short cartoon called "Jesus vs Frosty" (also known as The
ORIGINAL Spirit of Christmas) in which some kids make a snowman that comes
to life and starts killing everyone. Eventually Jesus comes along and chops
off Frosty's head by throwing his halo at him.
</wers><wers>
Executives from the American Fox Network somehow caught sight of
this cartoon and commissioned Matt and Trey to make another short to be sent
out to celebrities as a Christmas card, this was the called "The Spirit of
Christmas" The film was an instant hit. Everyone wanted to see it. Rumor has
it that George Clooney made 300 copies of the video to give to his friends.
</wers><wers>
Eventually the video made it to the Internet where everyone got
to see it. It was then inevitable that the cartoon would be made into a TV
Series, and Comedy Central who had previously shown King of the Hill
commissioned Matt and Trey to produce a series. The rest is history....
</wers>
</brief>
<foto name="busstop">Somethink about main haracters (from the left in
foto)</foto>
</root>
Jul 20 '05 #1
3 1080
Tempore 02:43:05, die Saturday 05 March 2005 AD, hinc in foro {comp.text.xml} scripsit duzy <pi*****@o2.pl>:
I do not understand why it generates only tables with colors according to
css, and do not display any text or image.

Hi,

All elements in your source XML document have a namsepace other than the default one. So in order to access these elements properly, you have to define the namespace also in your XSL. You're free to choose a prefix.

example:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ws="http://www.w3schools.com">
<xsl:output method="html" />
<xsl:template match="/">
<html>
<head>
<title>catalog.xsl</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table align="center" class="episodb">
<tr>
<td>
<img>
<xsl:attribute name="src">
img/ <xsl:value-of select="/ws:root/ws:titleimg" />
</xsl:attribute>
</img>
</td>
</tr>
</table>
<br />
<xsl:for-each select="/ws:root/ws:brief/ws:wers">
<table align="center" width="800" class="episodb">
<tr>
<td>
<xsl:value-of select="." />
</td>
</tr>
</table>
<br /> <br />
</xsl:for-each>
<table align="center" class="episodb">
<tr>
<td>
<img width="400">
<xsl:attribute name="src">
img/<xsl:value-of select="/ws:root/ws:foto/@name" />.gif
</xsl:attribute>
</img>
</td>
</tr>
</table>
<br /><br />
<table align="center" class="episodb">
<tr>
<td>
<xsl:value-of select="/ws:root/ws:foto" />
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

btw, why are you using tables to display a flow of paragraphs? That's absurd...
regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-v...i?userid=38041)
"Η αλήθεια και το λάδι πάντα βγαίνουν από πάνω"
Jul 20 '05 #2

Joris Gillis wrote:
btw, why are you using tables to display a flow of paragraphs? That's

absurd...

It's only way I know to have another color of background under the
paragraphs (in tables), and another between paragraphs.

Thanks. You helped me a lot.
Jul 20 '05 #3
Tempore 13:15:19, die Saturday 05 March 2005 AD, hinc in foro {comp.text.xml} scripsit duzy <pi*****@o2.pl>:
It's only way I know to have another color of background under the
paragraphs (in tables), and another between paragraphs.

Css is your friend;-)

regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-v...i?userid=38041)
"Η αλήθεια και το λάδι πάντα βγαίνουν από πάνω"
Jul 20 '05 #4

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

Similar topics

2
by: BoB Teijema | last post by:
Hi all, One of our companies is having problems with a query on a linked server. They have two servers, serverA and serverB. On serverA they have set up a linked server to serverB. Query:...
10
by: Ray Stevens | last post by:
I am attempting to test a VeriSign account and the setup instructions stated that the certs file needed to go into the Windows\System32 folder. I am getting an error from the code-behind assebly...
2
by: jaYPee | last post by:
I have no problem setting the selectcommand in sqldataadapter to fetch record from sqlserver w/ where clause in parent table. however, my problem is on how can i fetch the child table which is...
9
by: Emin | last post by:
Dear Experts, I have a fairly simple query in which adding a where clause slows things down by at least a factor of 100. The following is the slow version of the query ...
41
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
1
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...
0
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,...
0
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...
0
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...
0
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 ...
0
muto222
php
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.