Click to See Complete Forum and Search --> : Need help with css/xml


zen10
01-13-2009, 11:25 AM
Hi folks

i need some help with xml and css, i want to disply some information using a css with a xml file.


I have the following codes
<club name="Club" reference="021" class="here" occupants="6">
.
.
.
</club>
in a xml file and i want to use a css file to disply the information. So far i have linked the css with the xml but unable to display the information using the club attribute. Can someone please share some light and help me out.... How can i display the value in "name", "class" and "occipants" ?

Thanks in advance

Charles
01-13-2009, 01:39 PM
With CSS you can't display attribute values.

jkmyoung
01-13-2009, 03:40 PM
Attribute values are seen as just that: attributes of another entity, not text. If you want to display these values you need to either change the way that the xml is generated, or convert the xml afterwards.

rpgfan3233
01-13-2009, 10:38 PM
Yep, everybody's right. You can, however, process the XML using something like PHP, Python, or something else and then do things to it that way. Of course, that's really just a more involved (and time-consuming in terms of your coding) way to "convert the xml afterwards", something that jkmyoung pointed out as one way to solve your problem. An easy way would be to use XSLT as an intermediate step, matching all attributes and outputting them with their values as XML elements and text. I can't say how fast it would be though if you use it solely through a browser rather than using an intermediate language like PHP or something. :p