Determine if following sibling contains node with same value

JIMBOB

New Member
I'm sure this should be very simple - but I'm having trouble with context!Example XML:\[code\]<test><HtlSeg> <SegNum>1</SegNum> <StartDt>20130624</StartDt> <NumNights>2</NumNights> <Conf>28618</Conf></HtlSeg><CommentInfo> <CommentNum>1</CommentNum> <SegMatch>28618</SegMatch> <Comment>THIS IS A TEST</Comment></CommentInfo><CommentInfo> <CommentNum>2</CommentNum> <SegMatch>28618</SegMatch> <Comment>HOTEL BOOKED</Comment></CommentInfo><CommentInfo> <CommentNum>3</CommentNum> <SegMatch>28618</SegMatch> <Comment>NON REFUNDABLE</Comment></CommentInfo><CommentInfo> <CommentNum>4</CommentNum> <SegMatch>1459</SegMatch> <Comment>CAR BOOKING</Comment></CommentInfo><CommentInfo> <CommentNum>5</CommentNum> <SegMatch>1528</SegMatch> <Comment>AIR BOOKING</Comment></CommentInfo><CommentInfo> <CommentNum>6</CommentNum> <SegMatch>1528</SegMatch> <Comment>NON REFUNDABLE</Comment></CommentInfo><CommentInfo> <CommentNum>7</CommentNum> <SegMatch>1528</SegMatch> <Comment>NON SMOKING</Comment></CommentInfo>\[/code\]In an XSLT my context node is the \[code\]<HtlSeg>\[/code\].I am tryin to access the \[code\]<CommentInfo>\[/code\] nodes where the \[code\]<SegMatch>\[/code\] node equals the \[code\]<Conf>\[/code\] node of the \[code\]<HotelSeg>\[/code\].The xpath I've tried is \[code\]following-sibling::CommentInfo[SegMatch=Conf]/Comment\[/code\]However doesn't return anything. I think I've lost context from the \[code\]<HotelSeg>\[/code\] when using the `Conf' in the xpath - but Im sure this must be possible in a simple Xpath without having to declare variables??CheersDarren
 
Back
Top