This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: how do I pass two xml document into a xsl in java
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] how do I pass two xml document into a xsl in java
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Wed, 19 Sep 2001 22:28:13 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> 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@iclway.co.uk]
> Sent: Tuesday, September 18, 2001 5:13 PM
> To: xsl-list@lists.mulberrytech.com
> Subject: RE: [xsl] 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@lists.mulberrytech.com
> > [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of
> > john.li@ps.ge.com
> > Sent: 18 September 2001 22:00
> > To: xsl-list@lists.mulberrytech.com
> > Subject: [xsl] 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