473,509 Members | 3,543 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

xml to xsl transformation ..dont change in xml

2 New Member
when i open the xml file a table is created.in that the first row,second columns is blank...instead i want to get a empty cell border..can you clear my doubt...

cd_catalog_choose.xsl

Expand|Select|Wrap|Line Numbers
  1. <?xml version='1.0'?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  3. <xsl:template match="/">
  4. <html>
  5.   <body>
  6.  <h2>My Collection</h2>
  7.     <table border="2" bgcolor="yellow" cellpadding="10">
  8.       <tr>
  9.         <th>Title</th>
  10.  <th>Artist</th> 
  11.  </tr>
  12.        <xsl:for-each select="CATALOG/CD">
  13.  <tr>
  14.  <td align="center" ><xsl:value-of select="TITLE" /></td>
  15.  <td align="left"><xsl:value-of select="ARTIST"/></td> 
  16.  </tr>
  17.  </xsl:for-each>
  18.     </table>
  19.   </body>
  20.   </html>
  21. </xsl:template>
  22. </xsl:stylesheet>
cd_catalog.xml

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="ISO8859-1" ?>
  2. <?xml-stylesheet type="text/xsl" href="cd_catalog_choose.xsl"?>
  3. <CATALOG>
  4.   <CD>
  5.     <TITLE>jagadeesh</TITLE> 
  6.     <ARTIST></ARTIST>
  7.     <COUNTRY></COUNTRY>
  8.     <COMPANY>Columbia</COMPANY>
  9.     <PRICE>10.90</PRICE>
  10.     <YEAR>1985</YEAR>
  11.   </CD>
  12.   <CD>
  13.     <TITLE>Hide your heart</TITLE>
  14.     <ARTIST>yes</ARTIST>
  15.     <COUNTRY>UK</COUNTRY>
  16.     <COMPANY>CBS Records</COMPANY>
  17.     <PRICE>9.90</PRICE> 
  18.     <YEAR>1988</YEAR>
  19.   </CD>
  20.   </CATALOG>
Dec 31 '07 #1
1 947
jkmyoung
2,057 Recognized Expert Top Contributor
It's because the artist is blank.

1. Change the source xml so that ARTIST value is not blank.

2. Also, change your stylesheet node to
Expand|Select|Wrap|Line Numbers
  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
Another possible way is to insert a &nbsp; into your xslt, but you will have to declare the non-breaking space entity.
Jan 3 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2681
by: Sergio del Amo | last post by:
Hi, I use the xslt functions provided by php. I am running in my computer the package xampp(www.apachefriends.org) which includes php/apache/mysql .. In this package the php includes the sablotron...
3
7896
by: pradeep gummi | last post by:
I have an XML FILE that is to be converted to Plain Text using an XSL file. Since I just want plain text, I do not want to set any root element during transformation.And if I do not any root...
7
3234
by: CK | last post by:
Hello, I have the 60 MB XML string and I am coding a program in Visual Basic to run a XSL transformation on it. Currently, I'm using the Microsoft standard MSXML 2.0 to create a DOM document, load...
2
1289
by: Alex | last post by:
We am facing a problem with transforming docbook xml to html. I am running PHP4 on apache and i first tried to use sablotron which took 40+ seconds to convert a 50kb xml file. When using xsltproc...
6
4532
by: Jain, Pranay Kumar | last post by:
Hi All, We have created a simple application that takes a dataset and generates the data in Excel schema format. It uses an xslt file to do the transformation for excel 2002 and so on. We are...
1
1919
by: Andrew Connell | last post by:
I have an XML document and an XSLT transformation sheet. My first issue is that my XML file won't load into the XPathDocument object. However, when I use an obsolete transformation method where I...
1
1723
by: Edwin Loubser | last post by:
Hi, My problem is that I dont want to output the transformed xml to a file! I convert a Dataset to xml and then apply the transformation using xsl. Dim xmlDoc As XmlDataDocument = New...
13
1722
by: Naeem | last post by:
What are the ways data can be transported/moved among these Products. SQL Server, Access and Excel. The main ways are: Replication Service, BackUp and Restore, Data Link Server,Import/Export...
6
1715
by: dave | last post by:
I really have 2 questions regarding the following xml snippet. The xml is a directory representation. <?xml version="1.0" standalone="yes"?> <FileSystem> <Row> <ID>1</ID> <Name>Root</Name>...
2
1194
by: zoom007 | last post by:
I'm new to xml. I have created a stylesheet to convert an XML document to another XML document. I included this statement < xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> in...
0
7237
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
7347
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
7073
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
4732
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
3218
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
3207
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1571
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 ...
1
779
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
443
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...

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.