xsl-list
[Top] [All Lists]

Re: [xsl] Re: Unique node and delimiter concatenation

2007-03-29 17:16:27
In a XML,if the following sibling of my test node value is "N" and that condition comma would not be introduced . I need to introduce comma between all unique values and based on the sibling of the my test node .
Can not always look for the next subsequent following sibling
it is based on the list of unique node values and following sibling indicator I need to introduce comma if last but one I need to introduce "and" alsoo and terminated by period.

On Mar 29, 2007, at 3:33 PM, Abel Braaksma wrote:

Senthilkumaravelan K wrote:

Second value may or may not be there.
How I could select and introuce "," based on the second sibling value.

depending on whether you mean preceding or following sibling, this is the syntax for following sibling:

<xsl:if test="following-sibling::your-test-node[2] = 'your-test- value' ">
   <xsl:text>,</xsl:text>
</xsl:if>

it does not matter if that value is not there (it will evaluate to false if it is not there). If you just want to test for existence of that node:

<xsl:if test="following-sibling::your-test-node[2]">

which will be false if the value is not there.

-- Abel

--~------------------------------------------------------------------
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(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
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(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>