## RE: [saxon] node whose ancestors are all first children of thier parents

 RE: [saxon] node whose ancestors are all first children of thier parents From: Clapham, Paul - 2001-12-14 16:28:12 ```There may be a super-duper XPath expression to do that, but I certainly can't come up with it. In the meantime, you can build up this node-set recursively by the following procedure: - Consider a node. - Add all of its children to the node-set. - Repeat recursively for the first child of the node, if it has one. Apply this procedure to the root node. Or here's another idea: you want to select all nodes for which returns a.b.c... where all except the last component are 1. PC2 -----Original Message----- From: Mark R. Diggory [mailto:mdiggory@...] Sent: December 14, 2001 07:54 To: Saxon-Help@... ""Sourceforge. Net Subject: [saxon] node whose ancestors are all first children of thier parents I'm trying to use axis' to select the nodes whose criteria meet the following: They must have All thier ancestors be the first child of the ancestors parent. Right now I have the following but not the test to determine if the node's in the axis I want: I've been trying things like: ancestor::parent::child/node()[1] but his doesn't seem to work: any tips? thanks, -Mark Diggory ```

 RE: [saxon] node whose ancestors are all first children of thier parents From: Clapham, Paul - 2001-12-14 16:28:12 ```There may be a super-duper XPath expression to do that, but I certainly can't come up with it. In the meantime, you can build up this node-set recursively by the following procedure: - Consider a node. - Add all of its children to the node-set. - Repeat recursively for the first child of the node, if it has one. Apply this procedure to the root node. Or here's another idea: you want to select all nodes for which returns a.b.c... where all except the last component are 1. PC2 -----Original Message----- From: Mark R. Diggory [mailto:mdiggory@...] Sent: December 14, 2001 07:54 To: Saxon-Help@... ""Sourceforge. Net Subject: [saxon] node whose ancestors are all first children of thier parents I'm trying to use axis' to select the nodes whose criteria meet the following: They must have All thier ancestors be the first child of the ancestors parent. Right now I have the following but not the test to determine if the node's in the axis I want: I've been trying things like: ancestor::parent::child/node()[1] but his doesn't seem to work: any tips? thanks, -Mark Diggory ```