Solved

XSLT CODE to transform one form of XML to another

Posted on 2014-11-07
9
237 Views
Last Modified: 2014-11-19
<?xml version="1.0" encoding="utf-8"?>
<Candidates>
<Candidate>
<FirstName><![CDATA[Nadeem]]></FirstName>
<LastName><![CDATA[Baseer]]></LastName>
<Resume> Resume Content</Resume>
<CoverLetter>Cover Letter Content</CoverLetter>
</Candidate>
</Candidates>
</xml>

Open in new window


From the XML above  I need to create another XML file with fields Resume and CoverLetter into one single field using XSLT. I need the correct transform Code in XSLT.
0
Comment
Question by:lux sat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
9 Comments
 

Author Comment

by:lux sat
ID: 40429872
I need help with

From the Code above.. I need to create another XML file with
1. 'Resume' and 'CoverLetter' into one field 'blocktext'
2. InterviewTypeResponses (all sub nodes into one field called Comments)

Thanks,
0
 
LVL 34

Expert Comment

by:ste5an
ID: 40450275
hmm, no XML, no snippet, no interview type responses...

please post a concise and complete example. Use the toolbar to embed it into code tags.

EE Message Toolbar
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 40450501
What would the resulting transformed XML look like?
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:lux sat
ID: 40450513
The resulting transform should look like this...


<?xml version="1.0" encoding="utf-8"?>
<Candidates>
<Candidate>
<FirstName><![CDATA[Nadeem]]></FirstName>
<LastName><![CDATA[Baseer]]></LastName>

<blocktext>

Resume Content

Cover Letter Content </blocktext>
</Candidate>
</Candidates>
</xml>
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 40450530
Are you saying that you want to insert HTML <blocktext> with <Resume> and <CoverLetter> inner content, but not include those elements in the output?
0
 

Author Comment

by:lux sat
ID: 40450538
Not the html but just the content from <resume> and <coverletter> into one field named as >blocktext>
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 40450552
That sounds like you need to use the text() function to get the inner text for an element:

Example:

<xsl:template match="Resume">
      <xsl:value-of select="text()"
 </xsl:template>
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Six Sigma Control Plans

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question