Re: [xsl] Converting for-each into one string

Subject: Re: [xsl] Converting for-each into one string
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 20 Aug 2008 17:42:01 -0400
Chris,

At 05:18 PM 8/20/2008, you wrote:
I want my function to return xs:string, but it uses a for-each and so
the compiler complains:

"A sequence of more than one item is not allowed as the result of
function..."

How do I do this?

P.S. Really getting sick of XSL today.

Mm. I think maybe you need to take smaller bites off the apple.


For example, in this case you might have got the function working without typing the return sequence, and then when it looked good, adding the type back and debugging.

By writing functions at all, you are pushing the edges where still only a few people know how to go. The ins and outs of such errors as you are seeing are likely to be evident to only a select few, not many at all who aren't on this list.

If that's no comfort, maybe it's a comfort that by reasoning through the problem and figuring it out for yourself, you are becoming one of those people. Worse: you are becoming an expert who might actually have a little sympathy for the struggles of a newbie. A rare bird.

So, congratulations on figuring out how to use that value-of wrapper. What you did was collapse a sequence of text nodes into a single string value, which is what you told your function definition you wanted.

Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

Current Thread