RE: [xsl] Walking a complex object graph

Subject: RE: [xsl] Walking a complex object graph
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Fri, 16 Jul 2004 18:25:26 +0100
You need to explain the problem in more concrete terms.

Graph traversal becomes much easier in XSLT 2.0, which allows you to write
recursive functions that return existing nodes, rather than copies, and
which makes it much easier to compare node identity.

Some algorithms also benefit from function memoisation, which is provided in
Saxon (though only working with some restrictions in 8.0).

Michael Kay

> -----Original Message-----
> From: walter.crockett@xxxxxxxxxxxxxxxxxxxxx 
> [mailto:walter.crockett@xxxxxxxxxxxxxxxxxxxxx] 
> Sent: 16 July 2004 18:01
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Walking a complex object graph
> 
> We're trying to create a "virtual XML" navigator object that permits
> one to write an XSLT script that "walks" a complex object graph and
> extracts object names, attributes, etc.
> 
> The purpose is to allow the initial selection of a subset of objects
> and properties into a simple XML document, which can then be processed
> in a separate step into the target format (HTML, XML, etc.)
> 
> The issue we're running into, at least in the XSLT implementation
> provided in .NET, is that the XSLT processor appears to perform a
> deep traversal of the graph, which in our case can take a long time
> or produce an infinite loop (i.e. where there is a cycle of
> references between objects).
> 
> Note: we've looked at the ObjectXPathNavigator example on MSDN, and
> while this is similar to what we're trying to accomplish, it seems
> like the problem here lies in the XSLT processer, not in the 
> navigation
> object itself.
> 
> We've been looking into ways to modify the XSLT processor so its
> graph traversal behavior is "smarter". Are there any XSLT
> implementations that are amenable to this kind of tweaking or 
> modification?
> 
> Alternatively, is there a better strategy for using XSLT to perform
> the initial selection of data from an arbitrarily connected 
> object graph?

Current Thread