XML table display using CSS

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

------------------------
| | PRICE | QTY |
------------------------
Item1 | 500 | 10 |
------------------------
Item1 | 600 | 20 |
------------------------
Item1 | 700 | 25 |
------------------------
Item1 | 900 | 90 |
------------------------
pradeep [ Mi, 28 November 2007 05:04 ] [ ID #1881198 ]

Re: XML table display using CSS

On Nov 27, 10:04 pm, Pradeep <juneja.prad... [at] gmail.com> wrote:
> 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
>
> ------------------------
> | | PRICE | QTY |
> ------------------------
> Item1 | 500 | 10 |
> ------------------------
> Item1 | 600 | 20 |
> ------------------------
> Item1 | 700 | 25 |
> ------------------------
> Item1 | 900 | 90 |
> ------------------------

yea, i want to know that too.

www.2learnknowledge.com
raphit42 [ Mi, 28 November 2007 05:22 ] [ ID #1881200 ]

Re: XML table display using CSS

"Pradeep" <juneja.pradeep [at] gmail.com> wrote in message
news:97df42db-eda1-4aa1-bb56-2cc824018bd0 [at] b40g2000prf.google groups.com...
> 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?

--
Richard.
rf [ Mi, 28 November 2007 07:08 ] [ ID #1881206 ]

Re: XML table display using CSS

On Nov 28, 6:08 am, "rf" <r... [at] invalid.com> wrote:

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

http://dorward.me.uk/tmp/xml-as-table/data.xml (probably not IE
compatible, successfully tested on Firefox)

--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/
--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/
dorward [ Mi, 28 November 2007 10:16 ] [ ID #1881230 ]

Re: XML table display using CSS

"David Dorward" <dorward [at] gmail.com> wrote in message
news:411b1203-015f-46a5-a4b8-1bcabcc084f3 [at] w28g2000hsf.google groups.com...
> On Nov 28, 6:08 am, "rf" <r... [at] invalid.com> wrote:
>
>> Exactly how do you use CSS to display an XML file as a table?
>
> http://dorward.me.uk/tmp/xml-as-table/data.xml (probably not IE
> compatible, successfully tested on Firefox)

How remarkable :-)

IE6, IE7: (56KB)

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

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

--
Richard.
rf [ Mi, 28 November 2007 10:28 ] [ ID #1881231 ]

Re: XML table display using CSS

On Nov 28, 3:28 am, "rf" <r... [at] invalid.com> wrote:
> "David Dorward" <dorw... [at] gmail.com> wrote in message
>
> news:411b1203-015f-46a5-a4b8-1bcabcc084f3 [at] w28g2000hsf.google groups.com...
>
> > On Nov 28, 6:08 am, "rf" <r... [at] invalid.com> wrote:
>
> >> Exactly how do you use CSS to display an XML file as a table?
>
> >http://dorward.me.uk/tmp/xml-as-table/data.xml(probably not IE
> > compatible, successfully tested on Firefox)
>
> 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.
cwdjrxyz [ Mi, 28 November 2007 17:55 ] [ ID #1881256 ]

Re: XML table display using CSS

Pradeep wrote:

> 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/
Toby A Inkster [ Do, 29 November 2007 11:21 ] [ ID #1882297 ]

Re: XML table display using CSS

On Tue, 27 Nov 2007 20:22:04 -0800 (PST), raphit42 [at] gmail.com wrote:

>On Nov 27, 10:04 pm, Pradeep <juneja.prad... [at] gmail.com> wrote:
>> 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
>>
>> ------------------------
>> | | PRICE | QTY |
>> ------------------------
>> Item1 | 500 | 10 |
>> ------------------------
>> Item1 | 600 | 20 |
>> ------------------------
>> Item1 | 700 | 25 |
>> ------------------------
>> Item1 | 900 | 90 |
>> ------------------------
>
>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.
Jasbird [ Sa, 01 Dezember 2007 20:55 ] [ ID #1883817 ]
Miscellaneous » alt.html » XML table display using CSS

Vorheriges Thema: aligning multiple lists
Nächstes Thema: target _blank and opening a new window in Firefox