XML Multiple Attributes with CSS?????

Discussion in 'XML' started by TechieGrl, Apr 15, 2008.

  1. TechieGrl

    TechieGrl Guest

    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!
     
    TechieGrl, Apr 15, 2008
    #1
    1. Advertising

  2. 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/
     
    Martin Honnen, Apr 16, 2008
    #2
    1. Advertising

  3. TechieGrl

    Peter Flynn Guest

    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
     
    Peter Flynn, Apr 16, 2008
    #3
  4. Martin Honnen, Apr 16, 2008
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Max
    Replies:
    1
    Views:
    516
    Joe Kesselman
    Sep 22, 2006
  2. P4trykx
    Replies:
    2
    Views:
    1,891
    bruce barker
    Jan 31, 2007
  3. Replies:
    3
    Views:
    3,184
  4. james_027

    class attributes & data attributes

    james_027, Jun 20, 2007, in forum: Python
    Replies:
    2
    Views:
    412
    Bruno Desthuilliers
    Jun 20, 2007
  5. Kyle Schmitt
    Replies:
    3
    Views:
    228
    Kyle Schmitt
    Jul 24, 2007
Loading...

Share This Page