in reply to Can you style XMLwith CSS to display tag attributes?

It's possible since CSS2, although in the long run you'd probably be happier with XSLT or a manual transform, e.g. XML::Twig.

* { display: block; } type:before { content: "Type: " } CPUID:before { content: "CPUID: " } /* etc */ intrinsic:before { content: "intrinsic name=" attr(name) ", rettype=" attr(rettype) }

Replies are listed 'Best First'.
Re^2: Can you style XMLwith CSS to display tag attributes? [Solved]
by BrowserUk (Patriarch) on Jun 11, 2015 at 02:02 UTC

    That works perfectly for my purpose. Thank you.

    although in the long run you'd probably be happier with XSLT or a manual transform, e.g. XML::Twig.

    Not so much. The source (from the Intel website) seems to change pretty regularly -- the current version was update 26th May, 2015 -- so I'd rather just have a local style sheet that will allow me to read it once I download it, rather than have to go through a bunch of manipulations each time it changes.

    I'm not trying to make it pretty; just readable; and only for me.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
      That can all bhe automated: one Perl script to download the file at regular intervals; transform it through XSLT and save it on your hard-disk as HTML: ready for you to double-click it and read it in your browser.

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      My blog: Imperial Deltronics

        What I've got works fine and doesn't require any further effort.

        A bonus is I don't have to go anywhere near XSLT :)


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
        In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked