•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the RSS, Web Services and SOAP section within the Web Development category of DaniWeb, a massive community of 391,803 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,433 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our RSS, Web Services and SOAP advertiser:
Views: 3712 | Replies: 3
![]() |
•
•
Join Date: Jun 2006
Location: India
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Hi Gody,
You can use XSLT to format the pages like the way you want
Refer to http://www.w3schools.com/xsl/default.asp and find the formatting.
Remember to include the reference to your XSLT file you created in the xml
The sample xslt file will be like this...........
<?xmlversion="1.0"encoding="iso-8859-1"?>
<xsl:stylesheetversion="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:templatematch="/">
<html>
<body>
<h2>My page</h2>
<tableborder="1">
<trbgcolor="#9acd32">
<th>Date</th>
<th>Purpose</th>
</tr>
<xsl:for-eachselect="SalesVisit/Details">
<tr>
<td>
<xsl:value-ofselect="Date"/>
</td>
<td>
<xsl:value-ofselect="Purpose"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
MY Raw xml file before formatting was like this...
<?xmlversion="1.0"encoding="UTF-8"?>
<?xml-stylesheettype="text/xsl" href="XSLTFile.xsl"?>
<SalesVisit>
<Details>
<Date>1/1/2006</Date>
<Purpose>Sales Visist 1</Purpose>
</Details>
<Details>
<Date>2/1/2006</Date>
<Purpose>Sales Visist 2</Purpose>
</Details>
<Details>
<Date>3/1/2006</Date>
<Purpose>Sales Visist 3</Purpose>
</Details>
<Details>
<Date>4/1/2006</Date>
<Purpose>Sales Visist 4</Purpose>
</Details>
</SalesVisit>
by Rajesh C Medackel, TVM, India
You can use XSLT to format the pages like the way you want
Refer to http://www.w3schools.com/xsl/default.asp and find the formatting.
Remember to include the reference to your XSLT file you created in the xml
The sample xslt file will be like this...........
<?xmlversion="1.0"encoding="iso-8859-1"?>
<xsl:stylesheetversion="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:templatematch="/">
<html>
<body>
<h2>My page</h2>
<tableborder="1">
<trbgcolor="#9acd32">
<th>Date</th>
<th>Purpose</th>
</tr>
<xsl:for-eachselect="SalesVisit/Details">
<tr>
<td>
<xsl:value-ofselect="Date"/>
</td>
<td>
<xsl:value-ofselect="Purpose"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
MY Raw xml file before formatting was like this...
<?xmlversion="1.0"encoding="UTF-8"?>
<?xml-stylesheettype="text/xsl" href="XSLTFile.xsl"?>
<SalesVisit>
<Details>
<Date>1/1/2006</Date>
<Purpose>Sales Visist 1</Purpose>
</Details>
<Details>
<Date>2/1/2006</Date>
<Purpose>Sales Visist 2</Purpose>
</Details>
<Details>
<Date>3/1/2006</Date>
<Purpose>Sales Visist 3</Purpose>
</Details>
<Details>
<Date>4/1/2006</Date>
<Purpose>Sales Visist 4</Purpose>
</Details>
</SalesVisit>
by Rajesh C Medackel, TVM, India
Last edited by inkrajesh : Jun 13th, 2006 at 2:54 am.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb RSS, Web Services and SOAP Marketplace
•
•
•
•
access api asp blogger blogging code combo crime css data database development div dom dreamweaver dropdownlist feed firefox forensics gdata google google checkout google checkout vat government hardware hitachi html html api linux module net news programming reader reuse rss security standards storage symantec tables video w3c web wikipedia wysiwyg xml xoap youtube
- [urgent] HTML form => XML file (JSP)
- Listview Data to XML or file (VB.NET)
- How to re-organized XML file and call XML file from my software (RSS, Web Services and SOAP)
- append to XML file (Visual Basic 4 / 5 / 6)
- Capturing data from txt file using JavaScript/HTML (JavaScript / DHTML / AJAX)
Other Threads in the RSS, Web Services and SOAP Forum
- Previous Thread: How to Parse XML file
- Next Thread: how xml is useful?


Linear Mode