|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: get the first of the following with Attribute equ
Cedric,
One solution to your problem is to relate each 'paragraphe' element to the 'title' element to which it "belongs" using a key: <xsl:key name="paras-by-title" match="element[@type='paragraphe']" use="generate-id(preceding-sibling::element[@type='title][1])"/> Then instead of selecting "following::element[@type='paragraphe']" in your for-each, generate your output for your title, and then select the paragraphs that belong to it using the key function: select="key('paras-by-title', generate-id())" which returns only paragraph elements that follow the title without any intervening title elements (which would come in on the following or following-sibling axes). This method is described in the XSL FAQ under the heading "Flat file transformation": http://www.dpawson.co.uk/xsl/sect2/flatfile.html I hope that helps! Wendell At 10:57 AM 2/4/2003, you wrote: Hi, I have the following XML: [snip] I want to have only the *first *following with the attribute Type = title ====================================================================== 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








