Re: [xsl] Joining sibling elements

Subject: Re: [xsl] Joining sibling elements
From: Marcin Miłkowski <milek_pl@xxxxx>
Date: Thu, 11 Aug 2005 12:59:36 +0200
Mukul Gandhi wrote:
Hi Marcin,
   I think, in this case we have to follow some hard coding approach.
IMHO, I think there is a point when automation of XSLT Stylesheet
writing is not feasible.

You might be right. That's why I wondered from the start if that's feasible. Note that what I want to achieve is clearly and easily computable in many functional languages (I'm searching forward for a given pattern and applying a kind of compression to the output). Of course, given that XSLT is Turing Machine Equivalent, there must be a way to do this but it could be quite cumbersome.


Yet I can see some other way to do this. I use a template on a <a> level. I call a template which processes the node: If there are two sibling <b> elements with same children, I join d/text() contents adding a space, if not, I output the joined node processed so far (until the position of the following-node) and I call the same template recursively for the rest of the node.

This could work, I think, and should not even be very slow with this recursive processing. But turning this vague idea into code will take me some time :)

Best regards, and thanks again -
	Marcin

Current Thread