XML table display using CSS

P

Pradeep

When using CSS to display an XML file as a table, is there a way to
show the element names at the tops of the columns as headers?

For Example :
I have a XML file
<ITEMLIST>
<ITEM>
<NAME> Item1 </ITEM>
<PRICE> 500 </PRICE>
<QTY> 10 </QTY>
</ITEM>
<ITEM>
<NAME> Item2 </ITEM>
<PRICE> 600 </PRICE>
<QTY> 20 </QTY>
</ITEM>
<ITEM>
<NAME> Item3 </ITEM>
<PRICE> 700 </PRICE>
<QTY> 25 </QTY>
</ITEM>
<ITEM>
<NAME> Item4 </ITEM>
<PRICE> 900 </PRICE>
<QTY> 90 </QTY>
</ITEM>
</ITEMLIST>

and the output which I want is
 
R

raphit42

When using CSS to display an XML file as a table, is there a way to
show the element names at the tops of the columns as headers?

For Example :
I have a XML file
<ITEMLIST>
<ITEM>
<NAME> Item1 </ITEM>
<PRICE> 500 </PRICE>
<QTY> 10 </QTY>
</ITEM>
<ITEM>
<NAME> Item2 </ITEM>
<PRICE> 600 </PRICE>
<QTY> 20 </QTY>
</ITEM>
<ITEM>
<NAME> Item3 </ITEM>
<PRICE> 700 </PRICE>
<QTY> 25 </QTY>
</ITEM>
<ITEM>
<NAME> Item4 </ITEM>
<PRICE> 900 </PRICE>
<QTY> 90 </QTY>
</ITEM>
</ITEMLIST>

and the output which I want is

yea, i want to know that too.

www.2learnknowledge.com
 
R

rf

Pradeep said:
When using CSS to display an XML file as a table, is there a way to
show the element names at the tops of the columns as headers?

Exactly how do you use CSS to display an XML file as a table?
 
C

cwdjrxyz

How remarkable :)

IE6, IE7: (56KB)

http://barefile.com.au/xml.jpg

Guess it's not viable on the web :-(

IE has handled a sort of XML a long time, but this is different from
the official W3C methods. If you could extend to IE, then most recent
browsers could handle the XML. However if you wanted support for some
older browsers, you would still have a problem. One might try using
Microsoft conditional comments. If the browser is Microsoft, the
content of a conditional comment would be processed, and it would
contain an IE method for processing XML. If the browser is not
Microsoft, then a path for all other browsers is used. I really do not
have the time and interest in this to examine in detail if the
conditional comment approach would work.
 
T

Toby A Inkster

Pradeep said:
When using CSS to display an XML file as a table, is there a way to show
the element names at the tops of the columns as headers?

Yes. Ditch CSS and use XSLT instead.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 4 days, 17:11.]
[Now Playing: Razorlight - Leave Me Alone]

Sharing Music with Apple iTunes
http://tobyinkster.co.uk/blog/2007/11/28/itunes-sharing/
 
J

Jasbird

yea, i want to know that too.

www.2learnknowledge.com

Why why are you spamming this forum with your url:
www.2learnknowledge.com. It is not a good idea to spam a forum like this
which is full of people who know how the internet works because each
time you do so, someone may point out and your website
www.2learnknowledge.com is being spammed around usernet.

If you want to continue getting away with sending spam and pimping your
site you should keep your spam from www.2learnknowledge.com as far away
from web developers as possible with.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top