/Dominic Brügger/:
Where can I set the
system ID for the XML file used as input for the transformation?
There's a |Source.systemId| [1] property. You could set the SAX
|InputSource.systemId| as well as you never know when it might be
needed.
public void processXSLT(String inFile, String[] xslFiles, String outFile) {
[...]
InputStream inputStream = new BufferedInputStream(new
FileInputStream(inFile));
InputSource input = new InputSource(inputStream);
input.setSystemId(new File(inFile).toURI().toString());
[...]
for (int i = 0; i < xslFiles.length; i++) {
Source source = new StreamSource(xslFiles[i]);
Here's some possible inconsistency: Does the |xslFiles| array hold
URIs or file paths? I think you should be using instead:
String sourceURI = new File(xslFiles[i]).toURI().toString();
Source source = new StreamSource(sourceURI);
[...]
// Take the last filter as input of the transformation.
SAXSource transformSource = new
SAXSource(filters[filters.length - 1], input);
transformSource.setSystemId(sourceURI);
[...]
[1]
<http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/Source.html#setSystemId(java.lang.String)>
--
Stanimir
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]