I am trying to emulate StringBuilder behavior in an XSL. Is there a way to do this. It seems pretty hard given the fact that XSLT is a functional programming language
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can get the accumulting concats quite simply with just a little bit of recursion if you’re looking at a node-set (so long as you can construct the xpath to find the node-set), doing this so you can add arbitrary bits and pieces in and out of the flow it starts getting messy.
Try this for starters (does join as well):
All manner of extensions to that may be required: perhaps you want to trim, perhaps you want to tunnel through hierarchies as well. I’m not sure a bulletproof general solution exists.