XML Multiple Attributes with CSS?????

T

TechieGrl

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!
 
M

Martin Honnen

TechieGrl said:
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.
 
P

Peter Flynn

Martin said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top