?
Solved

XSLT CODE to transform one form of XML to another

Posted on 2014-11-07
9
Medium Priority
?
241 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 35

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
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 

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 1500 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

Industry Leaders: 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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Introduction to Processes
Suggested Courses

752 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