?
Solved

Create XML / XSLT page with two data sources

Posted on 2007-04-11
1
Medium Priority
?
230 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 1500 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

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

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

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.
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will learn how to dynamically set the form action using jQuery.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Suggested Courses

770 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