You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by de...@gmail.com on 2009/03/27 17:02:55 UTC
Synapse 1.2 XSLTMediator cannot work with Saxon in non-DOM mode
Hi guys,
We are trying to use Synapse 1.2 using Saxon 8.9 transformer provider
(instead of Xalan) but we getting an exception when using the XSLTMediator
in stax mode.
We tried to run the Synapse 1.2 core tests setting
javax.xml.transform.TransformerFactory to
"net.sf.saxon.TransformerFactoryImpl" to see whether they will work, but the
XSLTMediatorTest fails with the same exception:
Running org.apache.synapse.mediators.transform.XSLTMediatorTest
- Fatal error occured in the XSLT transformation :
net.sf.saxon.trans.DynamicError: The SAX2 parser does not support setting
the 'namespaces' feature to true
- Error performing XSLT transformation using : xslt-key
net.sf.saxon.trans.DynamicError: The SAX2 parser does not support setting
the 'namespaces' feature to true
at net.sf.saxon.event.Sender.configureParser(Sender.java:357)
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:241)
at net.sf.saxon.event.Sender.send(Sender.java:142)
at net.sf.saxon.event.Sender.send(Sender.java:43)
at net.sf.saxon.Controller.transform(Controller.java:1504)
at
org.apache.synapse.mediators.transform.XSLTMediator.performXSLT(XSLTMediator.java:319)
at
org.apache.synapse.mediators.transform.XSLTMediator.mediate(XSLTMediator.java:177)
at
org.apache.synapse.mediators.transform.XSLTMediatorTest.testTransformXSLTCustomSource(XSLTMediatorTest.java:88)
It seems that by default these tests are run using the Xalan transformer and
the problem does not appear, but if adding the system property in the Maven
surefire plugin configuration you should be able to reproduce it:
<systemProperties>
<property>
<name>javax.xml.transform.TransformerFactory</name>
<value>net.sf.saxon.TransformerFactoryImpl</value>
</property>
</systemProperties>
The problem seems to be that when configuring the parser (which in stax mode
seems to be an instance of
org.springframework.xml.stream.StaxStreamXmlReader), Saxon is trying to set
the following features:
- http://xml.org/sax/features/namespaces
- http://xml.org/sax/features/namespace-prefixes
Unfortunately Spring's StaxStreamXmlReader always throws a
SAXNotRecognizedException in its setFeature method:
See the javadocs:
http://static.springframework.org/spring-ws/sites/1.5/apidocs/org/springframework/xml/stream/AbstractStaxXmlReader.html#setFeature(java.lang.String,%20boolean)
Regards,
Detelin
Re: Synapse 1.2 XSLTMediator cannot work with Saxon in non-DOM mode
Posted by de...@gmail.com.
Hi Andreas,
Thanks, I tried the trunk and it works fine with Saxon, the new
SourceBuilder functionality looks great, I'm glad to see that you removed
the Spring dependency from the core module, it was causing inconsistency
with Axis2 since they use Spring 2.5.1.
Regards,
Detelin
On Fri, Mar 27, 2009 at 6:12 PM, Andreas Veithen
<an...@gmail.com>wrote:
> Detelin,
>
> The XSLT integration has been completely reworked after the 1.2
> release. If you look at the unit tests in trunk, you will see that we
> now fully support Xalan and Saxon.
>
> Andreas
>
> On Fri, Mar 27, 2009 at 17:02, <de...@gmail.com> wrote:
> > Hi guys,
> > We are trying to use Synapse 1.2 using Saxon 8.9 transformer provider
> > (instead of Xalan) but we getting an exception when using the
> XSLTMediator
> > in stax mode.
> >
> > We tried to run the Synapse 1.2 core tests setting
> > javax.xml.transform.TransformerFactory to
> > "net.sf.saxon.TransformerFactoryImpl" to see whether they will work, but
> the
> > XSLTMediatorTest fails with the same exception:
> >
> > Running org.apache.synapse.mediators.transform.XSLTMediatorTest
> > - Fatal error occured in the XSLT transformation :
> > net.sf.saxon.trans.DynamicError: The SAX2 parser does not support setting
> > the 'namespaces' feature to true
> > - Error performing XSLT transformation using : xslt-key
> > net.sf.saxon.trans.DynamicError: The SAX2 parser does not support setting
> > the 'namespaces' feature to true
> > at net.sf.saxon.event.Sender.configureParser(Sender.java:357)
> > at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:241)
> > at net.sf.saxon.event.Sender.send(Sender.java:142)
> > at net.sf.saxon.event.Sender.send(Sender.java:43)
> > at net.sf.saxon.Controller.transform(Controller.java:1504)
> > at
> >
> org.apache.synapse.mediators.transform.XSLTMediator.performXSLT(XSLTMediator.java:319)
> > at
> >
> org.apache.synapse.mediators.transform.XSLTMediator.mediate(XSLTMediator.java:177)
> > at
> >
> org.apache.synapse.mediators.transform.XSLTMediatorTest.testTransformXSLTCustomSource(XSLTMediatorTest.java:88)
> >
> > It seems that by default these tests are run using the Xalan transformer
> and
> > the problem does not appear, but if adding the system property in the
> Maven
> > surefire plugin configuration you should be able to reproduce it:
> >
> > <systemProperties>
> > <property>
> > <name>javax.xml.transform.TransformerFactory</name>
> > <value>net.sf.saxon.TransformerFactoryImpl</value>
> > </property>
> > </systemProperties>
> >
> > The problem seems to be that when configuring the parser (which in stax
> mode
> > seems to be an instance of
> > org.springframework.xml.stream.StaxStreamXmlReader), Saxon is trying to
> set
> > the following features:
> >
> > - http://xml.org/sax/features/namespaces
> > - http://xml.org/sax/features/namespace-prefixes
> >
> > Unfortunately Spring's StaxStreamXmlReader always throws a
> > SAXNotRecognizedException in its setFeature method:
> >
> > See the javadocs:
> >
> http://static.springframework.org/spring-ws/sites/1.5/apidocs/org/springframework/xml/stream/AbstractStaxXmlReader.html#setFeature(java.lang.String,%20boolean)<http://static.springframework.org/spring-ws/sites/1.5/apidocs/org/springframework/xml/stream/AbstractStaxXmlReader.html#setFeature%28java.lang.String,%20boolean%29>
> >
> > Regards,
> > Detelin
> >
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>
Re: Synapse 1.2 XSLTMediator cannot work with Saxon in non-DOM mode
Posted by Andreas Veithen <an...@gmail.com>.
Detelin,
The XSLT integration has been completely reworked after the 1.2
release. If you look at the unit tests in trunk, you will see that we
now fully support Xalan and Saxon.
Andreas
On Fri, Mar 27, 2009 at 17:02, <de...@gmail.com> wrote:
> Hi guys,
> We are trying to use Synapse 1.2 using Saxon 8.9 transformer provider
> (instead of Xalan) but we getting an exception when using the XSLTMediator
> in stax mode.
>
> We tried to run the Synapse 1.2 core tests setting
> javax.xml.transform.TransformerFactory to
> "net.sf.saxon.TransformerFactoryImpl" to see whether they will work, but the
> XSLTMediatorTest fails with the same exception:
>
> Running org.apache.synapse.mediators.transform.XSLTMediatorTest
> - Fatal error occured in the XSLT transformation :
> net.sf.saxon.trans.DynamicError: The SAX2 parser does not support setting
> the 'namespaces' feature to true
> - Error performing XSLT transformation using : xslt-key
> net.sf.saxon.trans.DynamicError: The SAX2 parser does not support setting
> the 'namespaces' feature to true
> at net.sf.saxon.event.Sender.configureParser(Sender.java:357)
> at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:241)
> at net.sf.saxon.event.Sender.send(Sender.java:142)
> at net.sf.saxon.event.Sender.send(Sender.java:43)
> at net.sf.saxon.Controller.transform(Controller.java:1504)
> at
> org.apache.synapse.mediators.transform.XSLTMediator.performXSLT(XSLTMediator.java:319)
> at
> org.apache.synapse.mediators.transform.XSLTMediator.mediate(XSLTMediator.java:177)
> at
> org.apache.synapse.mediators.transform.XSLTMediatorTest.testTransformXSLTCustomSource(XSLTMediatorTest.java:88)
>
> It seems that by default these tests are run using the Xalan transformer and
> the problem does not appear, but if adding the system property in the Maven
> surefire plugin configuration you should be able to reproduce it:
>
> <systemProperties>
> <property>
> <name>javax.xml.transform.TransformerFactory</name>
> <value>net.sf.saxon.TransformerFactoryImpl</value>
> </property>
> </systemProperties>
>
> The problem seems to be that when configuring the parser (which in stax mode
> seems to be an instance of
> org.springframework.xml.stream.StaxStreamXmlReader), Saxon is trying to set
> the following features:
>
> - http://xml.org/sax/features/namespaces
> - http://xml.org/sax/features/namespace-prefixes
>
> Unfortunately Spring's StaxStreamXmlReader always throws a
> SAXNotRecognizedException in its setFeature method:
>
> See the javadocs:
> http://static.springframework.org/spring-ws/sites/1.5/apidocs/org/springframework/xml/stream/AbstractStaxXmlReader.html#setFeature(java.lang.String,%20boolean)
>
> Regards,
> Detelin
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org