From rpbourret at rpbourret.com Thu Nov 9 10:40:23 2017 From: rpbourret at rpbourret.com (Ronald Bourret) Date: Thu, 9 Nov 2017 10:40:23 -0800 Subject: [xquery-talk] Return nodes and text between nodes In-Reply-To: <012501d35988$690e1030$3b2a3090$@envisn.com> References: <012501d35988$690e1030$3b2a3090$@envisn.com> Message-ID: <5cd79dc0-724e-5670-66ba-da898cdf13a5@rpbourret.com> From the XPath specification: - child::* selects all element children of the context node - child::text() selects all text node children of the context node - child::node() selects all the children of the context node, whatever their node type Since "child" is the default axis, you can omit it. Thus, $expr/* will only return element children, as you have seen. If you want all children, use $expr/node(). If you only want text children, use $expr/text(). -- Ron On 11/9/2017 10:27 AM, Gary Larsen wrote: > Hi, > > Trying to process both node and text children in a for loop.? For some > reason this escapes me. > > let $expr := > REFOBJ1TEXT1REFOBJ2 > > for $x in $expr/* return $x > > This returns: > > REFOBJ1 > REFOBJ2 > > How do I access TEXT1 in a loop? > > Thanks, > > Gary > > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk >