[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Help to construct a loop

Subject: Re: Help to construct a loop
From: henry human <henry_human@xxxxxxxx>
Date: Sat, 29 Dec 2007 23:22:34 +0100 (CET)
Re:  Help to construct a loop
Actually this is a bpel (business process execution
language) process which I am working on.
Bpel itself is xml based and allows using xsl
functions. For e. in the bpel specification 2.0 there
is possible to build loops with for-each, while etc.

In my case my bpel process becomes this string from a
web service and I will to handle this string within
the bpel process f.i. in a while loop.
As I mentioned in the sample the string which the bpel
process becomes from the web service has a colon which
I think enables to inspect the string based on the
token and build the substrings. 

Unfortunately there is no a specific list or forum for
the bpel language specified issues. 



  <while name="lookForSubstrings">
  
<!this is what I dont know, how to build the
condition in xsl for a loop -->
            <condition> substring-before($myString,
':') </condition>
            
            
            <sequence name="sequence2">
                <if name="extractSubstrings">
                    
                    <assign name="SendOutputToClient"
>              
                                            
...........
                    </assign>  
                    <else>
                        <assign name="displayElse">   
          
                    ...........


I hope it makes the problem clearer!
henry


--- Abel Braaksma <abel.online@xxxxxxxxx> schrieb:

> Hi Henry,
> 
> Without seeing your source and how your $myString is
> formed, this is 
> rather hard to answer. Nor have you told us what
> XSLT version you have. 
> In XSLT 1.0, dissecting a string is done using a
> recursive template 
> ("saving" to a variable is not possible in XSLT). In
> XSLT 2.0, 
> dissecting a string is much easier, i.e. by using
> tokenize(), replace() 
> or xsl:analyze-string. Some XSLT 1.0 processors
> however allow the  use 
> of the EXSLT extensions, see http://exslt.org for
> how to use them.
> 
> Note that XSLT is a declarative language which makes
> "traditional" 
> approaches (while loop, assigning to a variable) not
> possible. If the 
> string you've put into $myString comes from nodes
> (elements, attributes 
> etc), it is probably easier to construct the output
> you want during the 
> process, instead of after the $myString construction
> (in fact, 
> constructing how the output should look like is all
> you do with XSLT, in 
> general).
> 
> Cheers,
> -- Abel Braaksma
> 
> 
> henry human wrote:
> > Hi  
> > I will to build a loop (for-each or while, etc)
> >   I have a long string saved in a variable
> myString:
> >     myString= foo ffd : ppp ttt foo : 3mmm foo
> >
> >   In this sample there are three substrings
> separated
> > by a colon token
> >   How could it be done, looking over the myString
> in a
> > loop and f. i.
> >  save the substring in a variable named buf1 
> until
> > all three substrings
> >  has been read  ?
> >   I will be very glad for any hint
> >   Regards
> >   Henry
> >
> >
> >       Heute schon einen Blick in die Zukunft von
> E-Mails wagen? Versuchen Sie4s mit dem neuen Yahoo!
> Mail. www.yahoo.de/mail
> 
> 



      Heute schon einen Blick in die Zukunft von E-Mails wagen? www.yahoo.de/mail

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.