Solved

Create XML / XSLT page with two data sources

Posted on 2007-04-11
1
226 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

705 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