Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML Multiple Attributes with CSS?????

Reply
Thread Tools

XML Multiple Attributes with CSS?????

 
 
TechieGrl
Guest
Posts: n/a
 
      04-15-2008
Hello.

It's been awhile since I've been in the XML world, but before I go
down a possibly unnecessary path, I wanted to ask about using CSS and
XML files. Is it possible to style multiple attributes inside of
elements using CSS?

For example

<NAME first="Joe" middle="Bob" last="Johnson">

Can I style the first middle and last attributes using CSS or am I
going to need to use XSL? Any other ideas someone might have would be
appreciated.

Thanks!
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      04-16-2008
TechieGrl wrote:

> It's been awhile since I've been in the XML world, but before I go
> down a possibly unnecessary path, I wanted to ask about using CSS and
> XML files. Is it possible to style multiple attributes inside of
> elements using CSS?
>
> For example
>
> <NAME first="Joe" middle="Bob" last="Johnson">
>
> Can I style the first middle and last attributes using CSS or am I
> going to need to use XSL? Any other ideas someone might have would be
> appreciated.


With CSS you style elements not attributes. You can write selectors
making use of attribute values but attribute values are not rendered and
can't be styled therefore with CSS. You will need to apply XSLT to
transform attribute values to element contents that can be styled.



--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
 
Peter Flynn
Guest
Posts: n/a
 
      04-16-2008
Martin Honnen wrote:
> TechieGrl wrote:
>
>> It's been awhile since I've been in the XML world, but before I go
>> down a possibly unnecessary path, I wanted to ask about using CSS and
>> XML files. Is it possible to style multiple attributes inside of
>> elements using CSS?
>>
>> For example
>>
>> <NAME first="Joe" middle="Bob" last="Johnson">
>>
>> Can I style the first middle and last attributes using CSS or am I
>> going to need to use XSL? Any other ideas someone might have would be
>> appreciated.

>
> With CSS you style elements not attributes. You can write selectors
> making use of attribute values but attribute values are not rendered and
> can't be styled therefore with CSS. You will need to apply XSLT to
> transform attribute values to element contents that can be styled.


CSS does actually provide a function for the exposure of attribute
values but it's widely ignored by browser writers.

///Peter
 
Reply With Quote
 
Martin Honnen
Guest
Posts: n/a
 
      04-16-2008
Peter Flynn wrote:

> CSS does actually provide a function for the exposure of attribute
> values but it's widely ignored by browser writers.


http://www.w3.org/TR/CSS21/generate....ropdef-content

I think support is coming in the soon to be released Firefox 3 and the
later to be released IE 8. At least I think that the Acid test covers that.

--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
attributes ala java annotations or .Net attributes? Kyle Schmitt Ruby 3 07-24-2007 07:48 PM
class attributes & data attributes james_027 Python 2 06-20-2007 03:12 PM
web.xml / XML schema issue, why do some XML schema attributes disappear asciz@starmail.com Java 3 02-20-2007 09:56 AM
WebControl.Attributes.Add and custom attributes P4trykx ASP .Net 2 01-31-2007 04:33 PM
Parse reserved attributes as normal attributes Max XML 1 09-22-2006 12:04 PM



Advertisments