XML table display using CSS

Discussion in 'HTML' started by Pradeep, Nov 28, 2007.

  1. Pradeep

    Pradeep Guest

    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, Nov 28, 2007
    #1
    1. Advertising

  2. Pradeep

    Guest

    On Nov 27, 10:04 pm, 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?
    >
    > 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
     
    , Nov 28, 2007
    #2
    1. Advertising

  3. Pradeep

    rf Guest

    "Pradeep" <> wrote in message
    news:...
    > 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, Nov 28, 2007
    #3
  4. David Dorward, Nov 28, 2007
    #4
  5. Pradeep

    rf Guest

    rf, Nov 28, 2007
    #5
  6. Pradeep

    cwdjrxyz Guest

    On Nov 28, 3:28 am, "rf" <> wrote:
    > "David Dorward" <> wrote in message
    >
    > news:...
    >
    > > On Nov 28, 6:08 am, "rf" <> 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, Nov 28, 2007
    #6
  7. 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, Nov 29, 2007
    #7
  8. Pradeep

    Jasbird Guest

    On Tue, 27 Nov 2007 20:22:04 -0800 (PST), wrote:

    >On Nov 27, 10:04 pm, 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?
    >>
    >> 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, Dec 1, 2007
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jam Pa
    Replies:
    3
    Views:
    468
    Spartanicus
    Apr 28, 2005
  2. Pradeep

    XML display table using cc

    Pradeep, Nov 28, 2007, in forum: XML
    Replies:
    6
    Views:
    599
    Johannes Koch
    Nov 28, 2007
  3. sed_y
    Replies:
    0
    Views:
    1,030
    sed_y
    Feb 15, 2012
  4. SeanInSeattle
    Replies:
    5
    Views:
    147
    SeanInSeattle
    Dec 13, 2007
  5. κÖлª
    Replies:
    2
    Views:
    133
    Thomas 'PointedEars' Lahn
    Jan 3, 2008
Loading...

Share This Page