cancel
Showing results for 
Search instead for 
Did you mean: 

xpath: use /Rowsets/Rowset/Row[position()<3] as filter

Former Member
0 Kudos

Hi folks,

I want to move the first 3 Row elements of some Output XML to a new XML having structure /Rowsets/Rowset

So far, i was using an repeater but I was wondering if it can be done using xpath without looping? I tried the following approach - but without success. I only get the first Row node:

The Link Type is "Append to XML". I changed some options and xpaths, but had no success.

Is that possible at all or do I need to loop over that set defined by position()<3 anyway?

Thanks for your help!

Accepted Solutions (1)

Accepted Solutions (1)

swaroop_anasane
Active Contributor
0 Kudos

Hi Marco,

You will have to iterate through it even after you use position() as after this as welll you get an rowset, and assigment would apply on the most recent one(i guess the recent one).

Using Rowset/Row[1] to get the first row ànd same for 2nd and 3rd, you can avoid repeater.

Anyways you would be doing the same.

Hope it helps.

Best Regards,

Swaroop

Former Member
0 Kudos

Hi Swaroop, thansk for the answer!

Seems like there is no way to avoid repeater 😞

former_member185280
Active Contributor
0 Kudos

You could try using an xslt with the XSL transformation action. You typically can get better performance that way.

Regards,

Christian

Former Member
0 Kudos

Hi Christian, sounds interesting.

I did not come accross that topic so far, just reading throught it.

One question regarding performance...I am just facing some issue with mii15 sp2. Seems like the JOIN QUERY is still buggy...as well as the JOIN MDO...so I have to go for the XML GENERIC SORTFILTER / XML JOINER.

Is there a chance to get better performance using xlst to sort/filter XML files? or can i even use it for joining data?

Thanks for a brief feedback!

former_member185280
Active Contributor
0 Kudos

You can certainly use xslt for that kind of stuff and probably get better performance vs building your logic using repeaters etc. Some of the actions use xsl under the covers anyway so it really depends. I think for what your are trying to do the database level will always perform the best. If you are running into trouble meeting your requirements using MDO you may want to consider implementing a traditional db.

Former Member
0 Kudos

Thanks Christian. That's really a pretty interesting topic. Although actions may use xslt, something tells me that using all those repeaters may cause some overhead.

I think MDO will be okay for me but somehow I have those bugs and as long as we did not fix them, I need some workaround.

Answers (0)