Solved

Create XML / XSLT page with two data sources

Posted on 2007-04-11
1
199 Views
Last Modified: 2013-11-18
i have created a XSLT page with data from a simple XML file.

Now, in that XSLT page i want to merge data from 2 XML files, first one contains data for navigation menu, second XML file contains data for teh report section, how can i merge both data sources in the same XSLT file?, (obviusly i can do it in asp or asp.net in teh server side, i want do it at client side).

The xml could be like:

///data for navigation menu (links.xml)
<links>
  <link>link 1</link>
  <link>link 2</link>
  <link>link 3</link>
</links>



//report,.xml
<books>
  <book>
     <title>title 1</title>
     <numPages>129</numPages>
   </book>
  <book>
     <title>title 2</title>
     <numPages>700</numPages>
   </book>
  <book>
     <title>title 3</title>
     <numPages>2122</numPages>
   </book>
</books>

0
Comment
Question by:jlbo_davinchi
1 Comment
 
LVL 12

Accepted Solution

by:
jkmyoung earned 500 total points
Comment Utility
http://www.w3schools.com/xsl/func_document.asp
Use the function document to import the second document.

eg, if you applied the stylesheet to the links.xml,
you could have in the stylesheet somewhere:

<xsl:apply-templates select="document('report.xml')"/>
to get the data from the report xml.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

728 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

11 Experts available now in Live!

Get 1:1 Help Now