RE: [xsl] Complex recursion in XSLT 1.0

Subject: RE: [xsl] Complex recursion in XSLT 1.0
From: "Marroc" <marrocdanderfluff@xxxxxxxxxxx>
Date: Mon, 18 Feb 2008 12:30:16 -0000
Thanks Florent.

> Could you write a sample of input (i.e. with 2 simple XHTML files) and the
output you would like?

Yes, sorry for the pseudo-code but the transform that nearly worked was 430
lines long.

So, here are two input files for three topics arranged in a tree with 'Copy
of One' below 'One' and no other subtopics:

"toc.htm" - initial
|- One
|- Two

<html>
	<head>
		<title>Contents</title>
	</head>
	<body>
		<h1 class="heading1">Contents</h1>
			<a href="toc15973.htm" target="TOC">
				<img border="0" src="plus.gif"
alt="Expand"/>
			</a>
			<img border="0" src="cbook.gif" vspace="1"
alt=""/>&nbsp;
				<a href="1598.htm">One</a><br/>
			<img border="0" src="topic.gif" vspace="1"
alt=""/>&nbsp;
				<a href="1599.htm">Two</a><br/>
	</body>
</html>

"toc15973.htm" - expanded
|- One
|  |- Copy of One
|- Two

<html>
	<head>
		<title>Contents</title>
	</head>
	<body>
		<h1 class="heading1">Contents</h1>
			<a href="toc.htm" target="TOC">
				<img border="0" src="minus.gif"
alt="Collapse"/>
			</a>
			<img border="0" src="obook.gif" vspace="1"
alt=""/>&nbsp;
				<a
href="1598.htm">One</a><br/>&nbsp;&nbsp;&nbsp;
				<img border="0" src="topic.gif" vspace="1"
alt=""/>&nbsp;
					<a href="1601.htm">Copy of
One</a><br/>
			<img border="0" src="topic.gif" vspace="1"
alt=""/>&nbsp;
				<a href="1599.htm">Two</a><br/>
	</body>
</html>

And the desired result file 'map.map':

<?xml version="1.0" encoding="utf-8"?>
<map:mappings xmlns:map="local">
	<map:relationship topic="1598.htm" toc="toc.htm"/>
	<map:relationship topic="1599.htm" toc="toc.htm"/>
	<map:relationship topic="1601.htm" toc="toc15973.htm"/>
</map:mappings>

Rich

-----Original Message-----
From: Florent Georges [mailto:lists@xxxxxxxxxxxx] 
Sent: 18 February 2008 10:41
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Complex recursion in XSLT 1.0

Marroc wrote:

  Hi

> Basically, I've tried every approach I can think of but each time I 
> find that XSLT 1.0 lacks any kind of 'memory'
> of what it has done. I can't find a way of passing parameters back up 
> the tree to effectively say 'done this one' or stop processing these 
> sub-nodes now.

  I guess that's me, but I have some difficulties both to figure out exactly
what you want from your prose and to read the pseudo-XSLT code.  Could you
write a sample of input (i.e. with 2 simple XHTML files) and the output you
would like?

  Regards,

--drkm























 
____________________________________________________________________________
_
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
http://mail.yahoo.fr

Current Thread