User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Jun 2005
Location: INDIA
Posts: 8
Reputation: Gody is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Gody's Avatar
Gody Gody is offline Offline
Newbie Poster

Help Displayind data in XML file using HTML

  #1  
May 8th, 2006
Hi everybody,

I have a XML file having data stored in tags as

<Username>User name here</Username>
<Password>Password here</Username>

(There will be data of around 100 users)

I need to display this data in a HTML file in a tabular format.
Kindly help me.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2006
Posts: 3
Reputation: g8trGTO is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
g8trGTO g8trGTO is offline Offline
Newbie Poster

Re: Displayind data in XML file using HTML

  #2  
Jun 6th, 2006
Try creating an XSLT (XML style) file and most browsers will properly render the XM. There are lots of tutorials on the web on this. Hope that helps.
Reply With Quote  
Join Date: May 2006
Posts: 6
Reputation: bwhiti is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
bwhiti bwhiti is offline Offline
Newbie Poster

Re: Displayind data in XML file using HTML

  #3  
Jun 9th, 2006
If you know javascript you could use Ajax. This will give you the ability of updating just those fields with out having to call the whole page if you wish.
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 2
Reputation: inkrajesh is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
inkrajesh inkrajesh is offline Offline
Newbie Poster

Re: Displayind data in XML file using HTML

  #4  
Jun 13th, 2006
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
Last edited by inkrajesh : Jun 13th, 2006 at 2:54 am.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb RSS, Web Services and SOAP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the RSS, Web Services and SOAP Forum

All times are GMT -4. The time now is 5:29 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC