Re: [xsl] Generic stylesheet to flatten XML hierarchy

Subject: Re: [xsl] Generic stylesheet to flatten XML hierarchy
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 03 Dec 2009 14:56:21 -0500
At 2009-12-03 10:50 -0800, Sara Mitchell wrote:
I've been wandering through the archives and other searches and so far have not found exactly what I am hoping to find. I need to write an XSLT stylesheet that accepts an unknown XML document and flattens the hierarchy to a two-dimensional row/columns structure.

I know the basics, especially when you know the input structure, but this has to be completely generic. The input document may have any level of repeating node sets, including none. I believe we can ignore (at least for the moment) mixed content. I'm getting stuck on the logic to handle the issue of any level of repeating nodes.

Does anyone know of an example of anything approaching this?

I published one at the request of a fellow UBL committee member:

... you may find the "push" technique used there will guide you.

Another example is the SHOWTREE stylesheet:

I hope these help.

. . . . . . . . . Ken

Vote for your XML training:
Crane Softwrights Ltd.
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:
Video overview:
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Male Cancer Awareness Nov'07
Legal business disclaimers:

Current Thread