Solved

Create XML / XSLT page with two data sources

Posted on 2007-04-11
1
218 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
[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
1 Comment
 
LVL 12

Accepted Solution

by:
jkmyoung earned 500 total points
ID: 18890140
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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
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 …
The viewer will learn how to count occurrences of each item in an array.
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)

730 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