Skip to Content
author's profile photo Former Member
Former Member

document

hi,

i am using a document action block inside a while loop and trying to update some rows of values in document..my question is whether the document entries will be still available in the furthur iteration of the while loop or it will be refreshed for each new iteration.....

thanks

karthick

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 06:32 PM

    You should have the Document Action Block Outside of the while loop. each Iteration of the While loop will initialize the Document.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 20, 2007 at 04:03 AM

    Karthik

    Better use the <b>Repeater</b> Action Block instead of <b>While Loop</b> Action Block since Repeater action takes the XML Results and loop the results row by row if and only if XPath Target of Repeater is set to the row of XML results. Inside this Repeater, use <b>Row</b> action to append rows one by one to the XML Document.

    Of course, <b>It is recommended that XML Document Action block should be always put outside and before Repeater Action</b>, otherwise, u can not update(append) the rows to the XML document while looping (Repeater).

    But <b>While Loop</b> Action is used to perform a specified set of actions until a condition is met, or the max iterations count has been reached. All the actions that directly descend from the While Loop action will be executed for each iteration. You must set the Break property to true, or 1, to stop the loop.

    Regards

    Som

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 20, 2007 at 12:50 PM

    Karthick,

    You can easily use xpath in assignment links to update row values in an xml document. It will effectively work like absolute positioning, so assigning a link to your document object with ...Results{/Rowsets/Rowset/Row[1]/ColumnName} will update the ColumnName value for only the first row (Note: you will have to manually edit the Target XPath to add the [1] after you select the path to the ColumnName in the link editor window).

    Reference the help docs for dynamic links as this will allow you to incorporate aspects to your xpath like [#Repeater_0.CurrentItem#] instead of a hard coded number like [1].

    Regards,

    Jeremy

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.