Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

CSS & .xml

  • 02-04-2006 02:38PM
    #1
    Closed Accounts Posts: 16,392 ✭✭✭✭


    Hey,

    I'm doing some small xml stuff atm and I'm trying to create a simple css file to output the data.

    But I'm having trouble accessing some of the attributes in the xml file and I'm not sure if I can or if it's just a case of not using the right syntax.


    xml looks like so:
    <dvd year="" runtime="" rating="">
        <title></title>
        <film>
            <genrelist>    
                <genre name=""/>
            </genrelist>
            <creators>
                <director>
                    <firstname></firstname>
                    <surname></surname>
                </director>
            </creators>
            <cast>
                <castmember role="">
                    <firstname></firstname>
                    <surname></surname>
            </cast>
        </film>
    </dvd>
    

    All I can output with the css is the title, director name and the actor name.

    What I'd like to output is all the dvd details [year, rating, castmember role etc]

    css looks like thus
    dvd
    {
    width: 100%;
    }
    title
    {
    display:block;
    color:red;
    font-size: 20pt;
    }
    creators
    {
    display:block;
    color:blue;
    font-size: 15pt;
    margin-left: 5pt;
    }
    castmember
    {
    display: block;
    color: purple;
    margin-left: 10pt;
    font-size: 10pt;
    }
    

    Any examples on the web don't seem to have embedded attributes and I can't figure wtf is up.

    I've tried adding castmember role and director to the css file but it doesn't seem to make a difference.

    Any help is much appreciated.


Comments

  • Closed Accounts Posts: 4,655 ✭✭✭Ph3n0m


    how are you outputting the xml? you parsing via php or doing something else?


  • Closed Accounts Posts: 16,392 ✭✭✭✭kaimera


    Just with the css. No php or anything else.

    Like I said, it's nothing complex, just playing around really.


  • Closed Accounts Posts: 4,655 ✭✭✭Ph3n0m


    ah yes - well unfortunately I have never dealt with an xml document so mixed like that - you have a combination of elements and attributes there


  • Closed Accounts Posts: 16,392 ✭✭✭✭kaimera


    Instead of using a css file to output the data, using an xsl stylesheet instead has been recommended.

    I'm trying to pick up xslt now.


Advertisement