|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] selecting the nearest preceding sibling
Hello , My XML file is below XML file ------------ <rootelem> <tag> --- node 1 <a>1</a> <b>2</b> <c>3</c> <d>4</d> </tag> <tag> --- node 2 <b>5</b> <c>6</c> <d>7</d> </tag> <tag> --- node 3 <a>8</a> <b>9</b> <c>10</c> <d>11</d> </tag> <tag> --- node 4 <b>12</b> <c>13</c> <d>14</d> </tag> <tag> --- node 5 <b>15</b> <c>16</c> <d>17</d> </tag> </rootelem> ---------------------- I want to write **a XPATH expression which will select the nearest preceding sibling , which contains a particular element ( <a> in this example) ** . I do not want preceding sibling which do not contain the <a> tag (also the tag <a> should be nearest to the context node) for e.g. if the context node is node 5 , the XPATH expression which will select node 3(because it contains element <a>) or for e.g. if the context node is node 2 , the XPATH expression will select node 1(because it contains element <a>) I am trying with preceding-sibling::tag ?? Can somebody suggest a solution? Regards, Mukul __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com 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








