Solved

XSLT CODE to transform one form of XML to another

Posted on 2014-11-07
9
228 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
  • 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSumClump challenge 9 98
Adoquery sql  left join does not work 25 80
modify h2 4 79
File download script VBSCRIPT fail on download PPT files 2 31
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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…

943 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

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now