Re: FW: [xsl] xpath expression needed

Subject: Re: FW: [xsl] xpath expression needed
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 02 Oct 2001 16:24:59 -0400
At 03:25 PM 10/2/01, you wrote:
I want to match all nodes whose following-sibling::level1 has the same value
for @type.  So in this case, only the first 'level1' node would be matched.

How about:

level1[@type = following-sibling::level1/@type]

Would that work?

Yes, except for the small but very important detail that this will give you every level1 that have *any* following-sibling::level1 with a matching @type.


To check just the directly following sibling level1, amend to:

level1[@type = following-sibling::level1[1]/@type]

The rule for node-set equality is in the XPath spec, 3.4. That's what you have inside the predicate (comparing the node-set consisting of @type to the node-set consisting of following-sibling::level1/@type).

Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


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



Current Thread