Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - string to char conversion >Thread Next - Re: string to char conversion Re: string to char conversionTo: NULL Date: 3/3/2006 9:33:00 PM Recursion is one of the most fundamental properties of functional languages, XSLT including. Try to find available examples of recursive processing in XSLT. In your solution you'll also need the XPath substring() function. The way to think of the problem is as follows: 1. Stop condition -- when the string is empty. 2. Process the first character of the string (use substring()) 3. Solve the same problem on the remaining string. You can get the remaining string again with substring(). Apart from this, FXSL has a convenient str-foldl() function/template. It implements any char by char string processing. Cheers, Dimitre Novatchev. "Boris" <shaithan@g...> wrote in message news:1141379884.717937.113180@u...... > Hello folks, > > I`m just racking my barin while trying to solve a simple problem: > I need to converse a string ( which is an attribute`s value to the > child elements of this element) > > This is my starting position: > > <LOOP value="OINK" /> > > .. should be converted to : > > <LOOP [value="OINK"] > [...] = can remain if necessary, doesn`t care > <char value="O"/> > <char value="I"/> > <char value="N"/> > <char value="K"/> > </LOOP> > > Sorry probably this is a pretty lousy problem, but I still try to solve > such problems like in > common programming languages, f.e. with a loop, but I had to find out > it is not possible to increment variables, also a recursive called > template didn`t work... > > Thanks a bomb for any help, > Boris > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
