XSLT doubt

Posted on 2013-06-27
Last Modified: 2013-06-28
Hi All,

I have to build XML from another XML file using XSLT 2.0.

I try to build wherever <include seriesId=""> element called, i should build XML based on seriesId.

I have attached here my input xml and expect output, please help to build xml.
Question by:xedge88
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
  • 2
LVL 60

Accepted Solution

Geert Bormans earned 500 total points
ID: 39283645
Try this

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl=""
    <xsl:key name="fragment" match="fragment" use="series"/>
    <xsl:template match="root">
            <xsl:copy-of select="@*"/>
            <xsl:apply-templates select="Code"/>
    <xsl:template match="node()">
            <xsl:copy-of select="@*"/>
            <xsl:apply-templates select="node()"/>
    <xsl:template match="include | DMS-Include">
        <xsl:apply-templates select="key('fragment', @seriesId)/content/node()"/>

Open in new window


Author Comment

ID: 39283667
Hi Gertone,

Thanks for quick and correct reply!

Thanks and regards,
LVL 60

Expert Comment

by:Geert Bormans
ID: 39283722

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Date on a table 16 36
How to insert clean border ? 6 35
CSS for Popup in ASP.NET 4 19
Where are custom labels in Word 2016 stored? 2 17
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. …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In a previous video Micro Tutorial here at Experts Exchange (, I explained how to get a free, one-month trial of Office …

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