473,586 Members | 2,495 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_choo se.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 949
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
2692
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 extension responsible for the xslt functions. The problem i have is that the obtained transformation is not the waited one. I try to proccess the...
3
7908
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 element during transformation, it return s "java.lang.IllegalStateException: Root element not set" exception. If I add any element for the enclosed...
7
3241
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 the XML, and then run the XSL transformation on it using the MSXML2.IXSLProcessor interface. The problem is that it kills my system because of...
2
1297
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 it went down to 10-15. The machine we have is only 400 mhz but we'd need 2-3 mhz to get anywhere near real time if we use same method as we are now....
6
4538
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 using the dotnet.xml resource and not the MSXML 4. The application is golden and works fine with realtively Medium size of data(around 25MB). We...
1
1921
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 specify the XML input file and output file, I get the same error. The error is: An unhandled exception of type 'System.Xml.XmlException' occurred...
1
1729
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 XmlDataDocument(ds) Dim xslTran As XslTransform = New XslTransform Dim writer As XmlTextWriter = New XmlTextWriter("C:\Test.xml",...
13
1734
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 Utility, BCP Utility, Using Database APIs(DAO, ADO etc). Is there any other way to transform data from each of three products to eachof three products...
6
1727
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> <Directory>Root</Directory> <Dir>true</Dir>
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 my stylesheet. when I view the transformation in a browser, what I see doesn't look anything XML, i dont see any of the tags I specified, just...
0
7841
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...
0
8339
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7965
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...
0
6617
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...
1
5712
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...
0
3838
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...
1
2345
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
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1184
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...

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.