Altova Mailing List Archives

Re: [xsl] extracting sequences

From: Dimitre Novatchev <dnovatchev@--------->
Date: 2/18/2004 10:20:00 PM
> Hello,
> The following RDF models a hierarchical website of 7 nodes with a max
> depth of 2. 

I don't see any graph described in your xml document. 

> 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
> leaf.
> 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?  

It is not xslt that will create the transformation, but an XSLT

> 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.

Seems quite straightforward to me -- especially if you explain the problem

Could you draw the graph and explain how its vertices and arcs are
specified in your xml document? What is the meaning of a "crosslink"?


Dimitre Novatchev
FXSL developer, -- the home of FXSL

>  Top-down
> processing is generally convenient when things are nested, but they are
> not in this case.
> <RDF xmlns:r=""
> xmlns:d=""> 
> <Node r:id="Root"> 
>    <num> 1</num>
>    <d:Title> Root</d:Title>
>    <link r:resource="Root/a"> </link>
>    <link r:resource="Root/b"> </link>
>    <link r:resource="Root/c"> </link>
> </Node> 
> <Node r:id="Root/a"> 
> <num> 2</num>
> <d:Title> a</d:Title>
> <link r:resource="Root/a/d"> </link>
> <link r:resource="Root/a/e"> </link>
> </Node> 
> <Node r:id="Root/b"> 
> <num> 3</num>
> <d:Title> b</d:Title>
> <link r:resource="Root/b/g"> </link>
> <crosslink r:resource="f:Root/a/e"> </symbolic>
> </Node> 
> <Node r:id="Root/c"> 
> <num> 4</num>
> <d:Title> c</d:Title>
> <crosslink r:resource="h:Root/b/g"> </link>
> </Node> 
> <Node r:id="Root/a/d"> 
> <num> 5</num>
> <d:Title> d</d:Title>
> </Node> 
> <Node r:id="Root/a/e"> 
> <num> 6</num>
> <d:Title> e</d:Title>
> </Node> 
> <Node r:id="Root/b/g"> 
> <num> 7</num>
> <d:Title> g</d:Title>
> </Node> 
> </RDF> 

Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.

 XSL-List info and archive:


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.