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

RE: how do I pass two xml document into a xsl in java

Subject: RE: how do I pass two xml document into a xsl in java
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Wed, 19 Sep 2001 22:28:13 +0100
mike 18 pass
> Thanks, I understand it and think it will work
> only downside is it requires hard coding the global variable 
> in xsl file which I don't really want to.

You can always do:
<xsl:variable name="doc2" select="document($docname)"/>
<xsl:param name="docname"/>

So that the URL is passed as a stylesheet parameter, as a string.

Mike Kay
> 
> John
> 
> -----Original Message-----
> From: Michael Kay [mailto:mhkay@xxxxxxxxxxxx]
> Sent: Tuesday, September 18, 2001 5:13 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  how do I pass two xml document into a xsl in java
> 
> 
> With most processors you can pass a document as the value of 
> a stylesheet
> parameter, though I don't think this is defined in JAXP.
> 
> What you can do, though, is to make your calling application 
> implement the
> URIResolver interface; nominate this class as your 
> URIResolver; in your
> stylesheet have a global variable
> 
> <xsl:variable name="doc2" select="document('my:doc2')"/>
> 
> and in your resolve() method, return the relevant Source object if the
> requested URI is "my:doc2", (and return null otherwise).
> 
> Mike Kay
> 
> > -----Original Message-----
> > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of
> > john.li@xxxxxxxxx
> > Sent: 18 September 2001 22:00
> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > Subject:  how do I pass two xml document into a xsl in java
> >
> >
> > Hi, xsl and java gurus,
> >
> > I use javax.xml.transform.Transformer.transform method to
> > transform one xml
> > file, now my xsl file needs to transform two xml files.  The
> > problem is the
> > transform method takes only one Source object only. I don't
> > want to have to
> > save the java xml document to files and have the xsl file to
> > read from the
> > files because it will slow down the app.
> >
> > Any solution to how I can specify two xml documents and
> > transform them in
> > xsl? and how would xsl refer to these two different sources?
> >
> > Thanks
> > John
> >
> >  XSL-List info and archive:  
> http://www.mulberrytech.com/xsl/xsl-list
> >
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.