SASE1984 Posted June 27, 2012 Share Posted June 27, 2012 Hi All, How to get the text() in between first child's preceding-sibling? I would like to check whether any texts between <Para><UnorderedList> and </UnorderedList></Para>. i.e 1: <Para><UnorderedList Mark="None"><ItemContent><Para>sample text</Para></ItemContent> <ItemContent><Para>sample text</Para></ItemContent></UnorderedList>sample text2</Para> i.e 2: <Para>sample text<UnorderedList Mark="None"><ItemContent><Para>sample text</Para></ItemContent><ItemContent><Para>sample text</Para></ItemContent></UnorderedList></Para> Note: first child my be any element name where i have given as a example. Regards,Selvakumar Link to comment Share on other sites More sharing options...
Martin Honnen Posted June 27, 2012 Share Posted June 27, 2012 I am not sure I understand what you want to achieve. If the 'para' element is the context node and you want to access the first child element then using the path '*[1]' suffices, then any preceding text node sibling is '*[1]/preceding-sibling::text()'. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now