[xsl] limiting preceding axis by ancestor

Subject: [xsl] limiting preceding axis by ancestor
From: "Fox, Michael" <michael.fox@xxxxxxxx>
Date: Tue, 7 May 2002 14:29:16 -0500
I have a document where there are many instances of <foo>.   Each <foo> may
have many <bar> children.   <bar> is itself recursive to several levels.   

<foo>
	<bar>
	<bar>
<foo>
	<bar>
		<bar>
			<bar>

I want to test to see if any preceding <bar> has the same value as the
current <bar> but limit the test to those <bar> elements are children of the
immediate <foo> ancestor.   In other words, I want to exclude any <bar>
children of the ancestor::foo's preceding-sibling:foo

Now I can construct a series of expressions that achieve this goal using the
parent and preceding-sibling axes but these get rather long as the number of
possibilities increases with every level of recursion for <bar>.

Should it not be possible to express preceding::bar and qualify it by
ancestor::foo/child::*?   If this is so, I cannot seem to get the syntax of
the expression properly formed.

Any ideas would be appreciated.

Michael

Michael J. Fox
Assistant Director for Library and Archives
Minnesota Historical Society
345 Kellogg Blvd West
St. Paul, MN 55102-1906
tel:  651.296.2150
fax: 651.296.9961
michael.fox@xxxxxxxx


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


Current Thread