Maybe you can get what you want with: "//*[name()!="contents"]"
But this will probably return all nodes as single documents. But maybe ist possible with the returned nodes to reconstruct the hierachy. And you have the advantage of not receiving the "contents" nodes and so not to waste your memory. Sorry, but I didn't try it by myself, but maybe it gets you on a way. -----Urspr�ngliche Nachricht----- Von: Kanarinka [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 7. M�rz 2002 16:43 An: [email protected] Cc: [EMAIL PROTECTED] Betreff: RE: XPath newbie question (another one) Hello All, I am also a newbie to xindice and xpath. I am wondering if it is possible to use Xpath to select a node without selecting its contents or all of its children. We are working on a project that will have elements that have sizable chunks of text data as their contents. In certain parts of the application we need to be able to represent the entire system's hierarchy, but we don't want to pull all of the contents of the nodes into memory. Here's an example: <lecture> <header> <id>2</id> <module_id>8</module_id> <title> Lecture 1: An introduction to nothing</title> </header> <contents> Blablahblahblahablahablahablahblah...really long contents here </contents> <topic> <header> <id>5</id> <module_id>3</module_id> <title> Topic 1: An introduction to nothing</title> </header> <contents> Blablahblahblahablahablahablahblah...reallyreally long contents here </contents> </topic> </lecture> In this case, the information that we need to represent the lecture and topic nodes visually in our hierarchy lives in the <header> element, however in order to preserve the hierarchical representation of the <header> element we would like to select something like the following: <lecture> <header> <id>2</id> <module_id>8</module_id> <title> Lecture 1: An introduction to nothing</title> </header> <topic> <header> <id>5</id> <module_id>3</module_id> <title> Topic 1: An introduction to nothing</title> </header> </topic> </lecture> Is this possible with Xpath or can you folks think of a better way to do this? I apologize if this is very ignorant. Thanks for any help you can offer! catie
