[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Testing for a following sibling node type that occ

Subject: Re: Testing for a following sibling node type that occurs a t a varied position
From: Brian Chrisman <brian.chrisman@xxxxxx>
Date: Tue, 29 Jun 2004 16:18:06 -0700
sibling node ideas
Wright, Steve wrote:

Hi Michael,
Thanks for your suggestion. I tried implementing it, but since I am actually
operating from w/in a for-each loop of the 'B' node, I need to test for the
following 'A' node from the last 'B' node in each sequence somehow, and I
didn't have any luck using the preceding-sibling function.


Any other ideas?





root/A/preceding-sibling::B[1]/following-sibling::A[1]

This will output duplicates A's if there are multiple A's after a particular B...
Are there multiple A's after a particular B? There aren't in the sample doc.


Brian

Thanks again,
Steve

-----Original Message-----
From: Michael Kay [mailto:mhk@xxxxxxxxx] Sent: Tuesday, June 29, 2004 3:54 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: Testing for a following sibling node type that occurs at
a varied position


Starting with <root> as the context node, you can select the marked B nodes
using

A/preceding-sibling::B[1]

Michael Kay



-----Original Message-----
From: Wright, Steve [mailto:Steve.Wright@xxxxxx] Sent: 29 June 2004 23:40
To: XSL-List@lists. mulberrytech. com (XSL-List@xxxxxxxxxxxxxxxxxxxxxx)
Subject: Testing for a following sibling node type that occurs at a varied position


I wasn't sure on how else to phrase the subject, but here is what I need
help in figuring out:




I need to detect when a specific sibling node follows the context node in
the document order, the catch is that it is not always located the same
number of positions after the context node, if it were, something like this
would work:


--------------------------------------------------------------

following-sibling::node()[1][self::A]

--------------------------------------------------------------



Here is an XML example to illustrate my situation:

--------------------------------------------

<root>

<A>text</A>

<B>text</B>

<B>text</B>

<B>text</B> (indicate this node based on following sibling 'A')

<C>text</C>

<C>text</C>

<C>text</C>

<A>text</A>

<B>text</B>

<B>text</B>

<B>text</B>

<B>text</B> (indicate this node based on following sibling 'A')

<D>text</D>

<D>text</D>

<A>text</A>

<B>text</B>

<B>text</B> (indicate this node based on following sibling 'A')

<C>text</C>

<A>text</A>

<B>text</B>

<B>text</B>

<B>text</B>

<B>text</B> (indicate this node based on following sibling 'A')

<C>text</C>

<D>text</D>

<D>text</D>

<D>text</D>

<C>text</C>

<A>text</A>

</root>

--------------------------------------------



I want to implement a feature that corresponds w/ the last 'B' node that
occurs before the next 'A' node.




Thanks in advance for any help.



Steve









**************************************************************
**************
This email may contain confidential material.
If you were not an intended recipient, please notify the sender and delete all copies.
We may monitor email to and from our network.


**************************************************************
**************



--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
--+--






--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
--+--


****************************************************************************
This email may contain confidential material.
If you were not an intended recipient, please notify the sender and delete all copies.
We may monitor email to and from our network.


****************************************************************************



--+------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
--+--




Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.