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

Re: [saxon - Help] SystemID always empty String

Subject: Re: [saxon - Help] SystemID always empty String
From: Johannes Neubauer <johannes.neubauer@xxxxxxxxxxxxxxxxx>
Date: Tue, 19 Feb 2008 16:20:11 +0100
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-----

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