Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

CSS & .xml

  • 02-04-2006 2:38pm
    #1
    Closed Accounts Posts: 16,396 ✭✭✭✭


    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,396 ✭✭✭✭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,396 ✭✭✭✭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