[xquery-talk] Element list to comma seperated list

Ghislain Fourny g at 28.io
Wed Sep 25 01:18:44 PDT 2013


Hi Josh,

Apologies about the redundant answer, my e-mail client somehow did not show me you had already answered. :-)

Kind regards,
Ghislain


On Sep 24, 2013, at 7:58 PM, Josh Spiegel <josh.spiegel at oracle.com> wrote:

> 
> fn:string-join is a standard function:
> http://www.w3.org/TR/xpath-functions/#func-string-join
> 
> So you shouldn't need functionx functions.  Something like this should work:
> 
>   <tns:Contact>
>      <tns:PositionList>{
>        fn:string-join($customer/tns:General/Positions/corecomponents:Position, ",")
>      }</tns:PositionList>
>   </tns:Contact>
> 
> Josh
> 
> On Sep 24, 2013, at 10:36 AM, sudheshna iyer <sudheshnaiyer at yahoo.com> wrote:
> 
>> Hello All, 
>> 
>> How do I convert the element list into comma separated list in xquery. I don't have functionx functions. So I can't use string-join. 
>> 
>> eg: 
>> <tns:Customer>
>> 	<tns:General>
>> 		<Positions>
>> 			<corecomponents:Position>pos1</corecomponents:Position>
>> 			<corecomponents:Position>pos2</corecomponents:Position>
>> 		</Positions>
>> 	</tns:General>
>> </tns:Customer>
>> 
>> Output:
>> 
>> <tns:Contact>
>> 	<tns:PositionList>pos1,pos2</tns:PositionList>
>> </tns:Customer>
>> 
>> _______________________________________________
>> talk at x-query.com
>> http://x-query.com/mailman/listinfo/talk
> 
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk




More information about the talk mailing list