Viewing

1. How can I view an XML file

1.

How can I view an XML file

G. Ken Holman and Mike Brown

SHOWTREE stylesheet update

I've been asked about an updated version of SHOWTREE. This is an XSLT stylesheet that reports the source node tree interpretation of a source file as created by the XSLT engine running the stylesheet.

Its at http://www.cranesoftwrights.com/resources/showtree/index.htm

For a given XML file, say:

<?xml version="1.0"?>
<!--sample input-->
<greeting>
<first skip="f">Hello world!</first>
<second skip="t"/>
</greeting>

... the SHOWTREE stylesheet reports an enumeration of the nodes as follows:

1  Comment (): {sample input}
2  Element 'greeting' ():
2.1  Text (greeting): {
}
2.2  Element 'first' (greeting):
2.2.1  Attribute 'skip' (greeting,first): {f}
2.2.2  Text (greeting,first): {Hello world!}
2.3  Text (greeting): {
}
2.4  Element 'second' (greeting):
2.4.1  Attribute 'skip' (greeting,second): {t}
2.5  Text (greeting): {
}

The latest version is now available in the free Resource Library section of our web site. By popular demand, archaic versions supporting out-of-date working drafts of the recommendation are still made available.

Please let me know if you have any questions (and "no, the XML declaration isn't a processing instruction (even though it looks like one) so that is why it doesn't show up in the report").

Mike Brown <mike@skew.org> has a similar stylesheet.

I updated my demo stylesheets at www.skew.org to conform to the XSLT and XPath Recommendations.

Fancy XML Tree Viewer Latest version: 3.4 (08 Nov 1999)

Fancy XML Tree Viewer shows the node structure of an XML document in the form of colorful HTML tables and bulleted lists. There are different ways of representing what's in an XML document. This particular model is what is used by XSLT and is prescribed by Section 5 of the XPath proposed recommendation. Netscape users please note that the released versions of Navigator usually can't view the output HTML (Navigator's rendering engine has trouble with deeply nested lists and structures).