Solved

XSLT CODE to transform one form of XML to another

Posted on 2014-11-07
9
235 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 33

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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 

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

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
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…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

726 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