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

Re: resolving relative path without base

Subject: Re: resolving relative path without base
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Tue, 29 May 2007 16:54:08 +0100
Re:  resolving relative path without base
On 5/29/07, Kai Hackemesser <kaha@xxxxxx> wrote:
Thanks, I tried that and it looks good.

But now I have a problem with relative links. My task is as follows: I
have to create a xsl depending on some xml input. The resulting xsl file
will import another xsl (depending on input from first xml file).

This is my code so far:

// loading preprocess XSL
StreamSource src = new
StreamSource(getClass().getResourceAsStream("/lrPreTransformHtml.xsl"));
// loading xml
StreamSource xml = new StreamSource(new
ByteArrayInputStream(out.toByteArray()));
StreamResult result = new StreamResult(outRes);
// create Transformer from factory and transform.
getTransformer(src).transform(xml,result);
// transform again and display
htmlPane.setText(transform(out.toByteArray(),outRes.toByteArray()));

The problem currently appearing is that the xsl file imported into the
preprocess-created xsl stream also imports a xsl file - and since I now
have only a ByteStream as Source, I lost the relativeness to that
imported file. Is there another way than giving an absolute address in
that import? Like setting a base url in FOP?

Call setSystemId() on the StreamSource used to read the stylesheet, eg:


src.setSystemId(path to xslt);

cheers
andrew

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.