[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Referencing XML fragments in a XSLT parameter?

Subject: Referencing XML fragments in a XSLT parameter?
From: stephan@xxxxxxxxxx
Date: Mon, 29 Jan 2007 21:26:55 +0800
 Referencing XML fragments in a XSLT parameter?
I have an application that produces 2 DOM documents in (Java) memory, that 
need to be processed in an XSLT transformation. I used the first as input 
source for the transformation and was wondering how to get the second into 
the picture. It is rather small with 20-30 nodes only. Since it is 
generated in code it doesn't have an URL, so document() will not work (?). 
I could pass the dom into a param, but how to reference it?

The first input looks like:

  <bookselection>
        <category>Sience Fiction</category>
        <book>
            <title>Solaris</title>
            <author>Lem</author>
        </book>
        <book>
            <title>Sheep look up</title>
            <author>Brunner</author>
        </book>
    </bookselection>

The second one looks like

 <categories>
        <category>Sience Fiction</category>
        <category>Cooking</category>
        <category>Horror</category>
    </categories>

What I need to achive is:
<books>
        <categories>
            <category selected="true">Sience Fiction</category>
            <category>Cooking</category>
            <category>Horror</category>
        </categories>
        <book>
            <title>Solaris</title>
            <author>Lem</author>
        </book>
        <book>
            <title>Sheep look up</title>
            <author>Brunner</author>
        </book>
    </books>

XSLT 2.0 would be OK. Help is greatly appreciated.
:-) stw

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.