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. Advertisements

  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. Advertisements

  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. Advertisements

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. Jordan Willms
    Replies:
    2
    Views:
    967
    Richard Tobin
    Nov 9, 2004
  2. kellner
    Replies:
    0
    Views:
    991
    kellner
    Jul 23, 2006
  3. Max
    Replies:
    1
    Views:
    651
    Joe Kesselman
    Sep 22, 2006
  4. P4trykx
    Replies:
    2
    Views:
    2,125
    bruce barker
    Jan 31, 2007
  5. Replies:
    3
    Views:
    4,652
  6. james_027

    class attributes & data attributes

    james_027, Jun 20, 2007, in forum: Python
    Replies:
    2
    Views:
    633
    Bruno Desthuilliers
    Jun 20, 2007
  7. Web Developer

    Use XML attributes to specify another XML name or namespace...

    Web Developer, Feb 17, 2005, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    1,154
    Web Developer
    Feb 17, 2005
  8. Erik Wasser
    Replies:
    5
    Views:
    864
    Peter J. Holzer
    Mar 5, 2006
Loading...