This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: get immediat preceeding node, if it is a comment


preceding-sibling::node()[1][self::comment()]

returns the immediately preceding node if it is a comment, and an empty
node-set otherwise.

Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com 

> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com 
> [mailto:owner-xsl-list@lists.mulberrytech.com] On Behalf Of 
> Paul Terray
> Sent: 04 October 2002 10:23
> To: xsl-list@lists.mulberrytech.com
> Subject: [xsl] get immediat preceeding node, if it is a comment
> 
> 
> Hello,
> 
> I have a little problem, which I am unable to find the 
> solution because I 
> must think to devious...
> 
> I have a XML with some comments on the nodes, just before, 
> that I want to get.
> 
> My problem is : there are not always there, so I cannot just use 
> "preceding-sibling::comment()[1]".
> 
> Therefore, 2 questions :
> - how to get the immediat preceeding node, when you don't 
> know what it will 
> be (element, comments, and for extension PIs, text())
> - how can I filter comments from it
> 
> Thanks in advance.
> 
> --
> Paul TERRAY - Ingénieur Systèmes Documentaires
> 4Dconcept
> Centre d'affaires - 22, rue Etienne de Jouy
> 78353 Jouy en Josas CEDEX
> Tel. 01 34 58 70 70 - Fax. 01 39 46 06 90
> email : terray@4dconcept.fr 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]