⚲
Project
Profile
Help
Tour this page
Frequent Planio Questions
Learning Resources
Sign in
Register
Switch Planio account
Open in Planio App
Share current page
Search
:
Projects
All Projects
Help
Tour this page
Frequent Planio Questions
Learning Resources
Sign in
Register
Switch Planio account
Open in Planio App
Share current page
Saxon
Overview
Roadmap
Issues
Calendar
Blog
Documents
Forums
Files
Repository
Download (1.1 KB)
RE: java.lang.NullPointerException while streaming
ยป TEST.java
Gerben Abbink
, 2014-04-25 14:56
import
java.io.*
;
import
javax.xml.transform.stream.*
;
import
net.sf.saxon.*
;
import
net.sf.saxon.expr.parser.*
;
import
net.sf.saxon.lib.*
;
import
net.sf.saxon.s9api.*
;
public
class
TEST
{
public
static
void
main
(
String
[]
args
){
try
{
Configuration
configuration
=
new
com
.
saxonica
.
config
.
EnterpriseConfiguration
();
// exception if not commented
// no exception if commented.
configuration
.
setConfigurationProperty
(
FeatureKeys
.
OPTIMIZATION_LEVEL
,
String
.
valueOf
(
Optimizer
.
NO_OPTIMIZATION
));
Processor
processor
=
new
Processor
(
configuration
);
XsltCompiler
compiler
=
processor
.
newXsltCompiler
();
XsltExecutable
executable
=
compiler
.
compile
(
new
StreamSource
(
"file:///E:/XML%20Examples/XSLT%20Streaming/Example1.xsl"
));
XsltTransformer
transformer
=
executable
.
load
();
transformer
.
setDestination
(
new
Serializer
(
new
StringWriter
()));
transformer
.
setSource
(
new
StreamSource
(
"file:///E:/XML%20Examples/XSLT%20Streaming/Example1.xml"
));
transformer
.
transform
();
System
.
out
.
println
(
"OK"
);
}
catch
(
Exception
e
){
System
.
out
.
println
(
"Exception"
);
}
}
}
(1-1/1)
Loading...