Jump to content

How To Group Multiple Item Value In One Attribute

Recommended Posts

Hello,My input XML is look like as below.<AnswerSet> <Answer questionId="Type" IncludeInGroup="true">Standard</Answer> <Answer questionId="Options" type="list" selectedValue="1" IncludeInGroup="true">item1</Answer> <Answer questionId="Options" type="list" selectedValue="2" IncludeInGroup="true">item2</Answer> <Answer questionId="Options" type="list" selectedValue="3" IncludeInGroup="true">item3</Answer> <Answer questionId="name" IncludeInGroup="false">my name</Answer></AnswerSet>And need output like<nodes> <node Type="Standard" Options="item1|item2|item3"/></nodes>just check <Answer node have IncludeInGroup=True then create attribute in node with name is value of QuestionID and value of create attribute is value if that answer tag.Also if we have QuestionID multiple times then concat it's value with | sign. Please provide solution in XSLT 1.0 versionPlease help me out for this issueThanks,Sadiq

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...