Re: Announce: Updated free SHOWTREE stylesheet resource
> Now that there are XSLT processors that give access to the namespace axis, > it is past time for an update to this diagnostic resource. > > SHOWTREE is a stylesheet that reveals an XSLT processor's node tree > interpretation of a source document. > > As delivered, the stylesheet does not report any namespace information ... > to do so the file contains the instructions of which lines to remove. When > used with these lines removed, namespace nodes are exposed. FWIW, it should be noted that I haven't tested my SHOWTREE-inspired Fancy XML Tree Viewer with anything but XT, so I'm sure it has the same problems. > Another change: the enumeration of child nodes no longer includes the > attached attribute nodes in the same count. This was done in earlier > versions to reveal the order of "*|@*" but ended up being confusing to some > who thought the attribute nodes were considered child nodes. I did the same kind of thing. Visually, I made attribute nodes look like children. I've considered rewriting the stylesheet to address this, but due to poor web browser implementations of nested tables, I'd rather try something plain text-based, like SHOWTREE. I'd really like to create the kind of ASCII art I've posted to the list. For example, <?xml version="1.0"?> <foo xmlns="http://yournamespace" xmlns:myns="http://mynamespace"> <myns:bar baz="maz">my dog has fleas</myns:bar> <myns:bar/> </foo> would become: root |__element 'foo' from ns 'http://yournamespace' | \__expanded-name 'foo' | \__namespace 'myns'='http://mynamespace' | \__namespace 'xml'='http://www.w3.org/XML/1998/namespace' | |__text '\n' | |__element 'bar' from ns 'http://mynamespace' | | \__expanded-name 'myns:bar' | | \__namespace 'myns'='http://mynamespace' | | \__namespace 'xml'='http://www.w3.org/XML/1998/namespace' | | \__attribute 'baz'='maz' | | | |__text 'my dog has fleas' | |__text '\n' | |__element 'bar' | \__expanded-name 'myns:bar' | \__namespace 'myns'='http://mynamespace' | \__namespace 'xml'='http://www.w3.org/XML/1998/namespace' | |__text '\n' I suspect, however, that the logic necessary to do this is beyond the scope of an XSL transformation. Feel free to prove me wrong, though! - Mike ___________________________________________________________ Mike J. Brown, software engineer, Webb Interactive Services XML/XSL stuff: http://www.skew.org/ http://www.webb.net/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format