[xsl] Re: The Solution (Was: Re: extracting sequences)

Subject: [xsl] Re: The Solution (Was: Re: extracting sequences)
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Fri, 20 Feb 2004 06:49:14 +0100
"Saverio Perugini" <sperugin@xxxxxxxxxxxxxxxx> wrote in message
> Many thanks Dimitre.

> Wow.  It is nasty-looking.
Because of the "crosslink" invention and the different ways the arc-ID is
specified for a "link" and for a "crosslink".

> I am curious how you might
> modify your one pass solution to produce the
> same output when the input data does not contain the
> leaf nodes.

No need to modify the solution: just decide which are the last nodes in the
paths you need, then set the necessary parameters and call the getPaths
template. What is essential that the graph is acyclic as I have omitted any
check for possible looping.

> That is, if the input data is as follows:
> <RDF xmlns:r="http://www.w3.org/TR/RDF/";
> xmlns:d="http://purl.org/dc/elements/1.0/";>
>   <Node r:id="Top">
>     <id>1</id>
>     <d:Title>Top</d:Title>
>     <link r:resource="Top/a"></link>
>     <link r:resource="Top/b"></link>
>     <link r:resource="Top/c"></link>
>   </Node>
>   <Node r:id="Top/a">
>     <id>2</id>
>     <d:Title>a</d:Title>
>     <link r:resource="Top/a/d"></link>
>     <link r:resource="Top/a/e"></link>
>   </Node>
>   <Node r:id="Top/b">
>     <id>3</id>
>     <d:Title>b</d:Title>
>     <link r:resource="Top/b/g"></link>
>     <crosslink r:resource="f:Top/a/e"/>
>   </Node>
>   <Node r:id="Top/c">
>     <id>4</id>
>     <d:Title>c</d:Title>
>     <crosslink r:resource="h:Top/b/g"/>
>   </Node>
> </RDF>

This is not a complete graph (at least not a complete DAG) -- leaf nodes are
completely missing.


Dimitre Novatchev
FXSL developer,

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread