|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: [saxon - Help] SystemID always empty String
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Unfortenately that does not work for me because I must have the systemId for compilation errors. I've marked the line in your code where I need the systemId, when a compilation error occurs. I need that because I like to output the systemId of the stylesheet where the error occured in my ErrorListener. This is helpful especially, when I have a stylesheet implementing a lot of other stylesheets, importing further stylesheets, ... ! Andrew Welch schrieb:
| File xslt = new File(new URI("file:/c:/test.xsl"));
|
| SAXTransformerFactory saxFactory =
| (SAXTransformerFactory)TransformerFactory.newInstance();
|
| TemplatesHandler compiler = saxFactory.newTemplatesHandler();
| Transformer firstTransformer = saxFactory.newTransformer();
| Result firstResult = new SAXResult(compiler);
| firstResult.setSystemId(xslt.toURI().toString());
| firstTransformer.transform(new StreamSource(xslt), firstResult);
|
| System.out.println(compiler.getSystemId());
|
| Templates compiledStylesheet = compiler.getTemplates();
Here, an error might occur (whilst compiling the stylesheet), which I
like to handle in my Errorlistener with an output like: "In " +
systemId" an error occured... (followed by StandardErrorListener output).
|
| TransformerHandler secondHandler =
| saxFactory.newTransformerHandler(compiledStylesheet);
| secondHandler.setSystemId(xslt.toURI().toString());
|
| System.out.println(secondHandler.getSystemId());
|-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHuvOrGaEJacf6i/cRAg6ZAKCqdRp3XiTrzCbjgt3Uz5PzjrtOuQCaAtnH ChZbsHeGzinbXh/wkPnBelo= =VBou -----END PGP SIGNATURE-----
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

![Re: [saxon - Help] SystemID always empty String](/images/get_stylus.gif)




