[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Listing all element/attributes/attribute values

Subject: Listing all element/attributes/attribute values
From: James Cummings <cummings.james@xxxxxxxxx>
Date: Thu, 7 Jul 2005 13:58:36 +0100
bold xml values
Hi there,

Since someone has probably already done this and I don't want to
reinvent the wheel, I thought I'd ask here.

What I want to do is with any well-formed XML document list all the
elements, attributes and attribute-values in a sorted list.

So given something like:

<div class="foo"><p xml:id="abc123" style="font-weight: bold"
class="big">foo</p>
<span class="foo"><a
href="http://www.example.com/">foo</a></span><span
class="bar">bar</span> <p class="small">small</p></div>

I might get output like:

a (1)
      - href
           = http://www.example.com/
div (1)
      - class
           = foo
p (2)
     - class
          = big
          = small
     - style
           = font-weight: bold
     - xml:id
           = abc123
span (2)
     - class
          = foo
          = bar

(Or I suppose an adhoc interim xml format that I could easily convert
to that would be better.)


Is this even easier in xslt2?

Many thanks for any suggestions,

-James
--
James Cummings, Cummings dot James at GMail dot com

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.