[xsl] extracting sequences

Subject: [xsl] extracting sequences
From: Saverio Perugini <sperugin@xxxxxxxxxxxxxxxx>
Date: Wed, 18 Feb 2004 20:59:29 -0500 (EST)

The following RDF models a hierarchical website of 7 nodes with a max
depth of 2.  I would like to transform it into a text file containing
each path through the site, one per line, where a path is a space
delimited sequence of hyperlink labels from the root of the site to a

Therefore, for the following RDF data, I'd like to produce:

a d
a e
b f
b g
c h

Can xslt realize this transformation?  The problem is challenging
because 1) the RDF data models a DAG (directed acyclic graph), due to
the presence of crosslinks, rather than just a tree, and 2) there is no
way to associate any node with its parents and therefore the processing
must proceed in a top-down, rather than bottom-up, fashion.  Top-down
processing is generally convenient when things are nested, but they are
not in this case.

<RDF xmlns:r="http://www.w3.org/TR/RDF/";

<Node r:id="Root">
   <link r:resource="Root/a"></link>
   <link r:resource="Root/b"></link>
   <link r:resource="Root/c"></link>

<Node r:id="Root/a">
<link r:resource="Root/a/d"></link>
<link r:resource="Root/a/e"></link>

<Node r:id="Root/b">
<link r:resource="Root/b/g"></link>
<crosslink r:resource="f:Root/a/e"></symbolic>

<Node r:id="Root/c">
<crosslink r:resource="h:Root/b/g"></link>

<Node r:id="Root/a/d">

<Node r:id="Root/a/e">

<Node r:id="Root/b/g">


I am currently learning RDF. I realize that this question and problem
may be better suited for an RDF list and RDF parser/manipulator,
respectively. If that is the case, I apologize in advance.

Thank You and Best Regards,

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

Current Thread