camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: XML parse error
Date Fri, 07 Jan 2011 13:45:47 GMT
please use transformerFactoryClass option for xslt component like this
from("xxx")
 
.to("xslt:com/acme/mytransform.xsl?transformerFactoryClass=net.sf.saxon.TransformerFactoryImpl")
    ...

Willem

On 1/7/11 8:17 PM, Kovacs Zsolt wrote:
> Still there is a problem. If I remove xalan from servicemix/lib
> directory other older service assemblies (SA) are failing.
> java.lang.NullPointerException
>          at net.sf.saxon.event.ReceivingContentHandler.getNameCode(ReceivingContentHandler.java:391)
>          at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:314)
>          at org.apache.servicemix.soap.util.stax.StaxSource.parse(StaxSource.java:115)
> I don't know the cause of this exceptions.
>
> Seems that I need xalan as processor for other legacy SA.
>
> If I'm packaging saxon with my camel service unit (including in maven
> pom.xml as dependency), and xalan is
> located in lib directory then servicemix still is using xalan as processor.
>
> It's possible to tell servicemix that I want to use saxon as XSLT
> processor if it's packaged into SA and xalan
> (from lib directory) otherwise?
>
> Thanks,
> On Fri, Jan 7, 2011 at 12:16 PM, Kovacs Zsolt<zsolt.m.kovacs@gmail.com>  wrote:
>> OK, I removed xalan from servicemix/lib and copied saxon there (to
>> servicemix/lib), and it's working fine
>> so I can used XSLT 2.0 functions (current-dateTime() in my case).
>>
>> Thanks!!!
>>
>> On Fri, Jan 7, 2011 at 10:49 AM, Willem Jiang<willem.jiang@gmail.com>  wrote:
>>> Camel just create the transform template with below code.
>>>
>>> return (TransformerFactory) FactoryFinder.find(
>>>             /* The default property name according to the JAXP spec */
>>>             "javax.xml.transform.TransformerFactory",
>>>             /* The fallback implementation class name, XSLTC */
>>>
>>> "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl");
>>>
>>> And the service lib class can be find from the su.
>>>
>>> Can you try to remove the xalan-2.7.0.jar from the lib, or you need to
>>> regenerate a new servicemix-camel component[1] which includes the saxon.
>>>
>>> [1]http://camel.apache.org/how-to-use-extra-camel-componets-in-servicemix-camel.html
>>>
>>> On 1/7/11 4:08 PM, Kovacs Zsolt wrote:
>>>>
>>>> Hi,
>>>>    I'm using servicemix 3.3 with camel 2.2. I included in maven pom.xml
>>>> the saxon 9.1.0.8 dependencies. The
>>>>   camel service unit now contains the lib\saxon-9.1.0.8.jar.
>>>>
>>>> But I get the same error message during deployment.
>>>>
>>>>   But I have in servicemix/lib the xalan-2.7.0.jar which seems to be a
>>>> XSLT 1.0 processor. Could be happen that
>>>>   servicemix is using xalan instead of saxon currently included in
>>>> camel service unit???
>>>>
>>>> Thanks,
>>>>
>>>>
>>>> On Thu, Jan 6, 2011 at 9:25 PM, Mark Ford<mark@massfords.com>    wrote:
>>>>>
>>>>> Are you using XSLT 2.0? If so, you should verify that you have an XSLT
>>>>> 2.0 capable library in your classpath. Perhaps when you're using the
>>>>> endpoint within JBI there is a 2.0 capable API in the classpath.
>>>>>
>>>>> If you're using Maven, then add the following:
>>>>>
>>>>>       <dependency>
>>>>>         <groupId>net.sourceforge.saxon</groupId>
>>>>>         <artifactId>saxon</artifactId>
>>>>>         <version>9.1.0.8</version>
>>>>>       </dependency>
>>>>>       <dependency>
>>>>>         <groupId>net.sourceforge.saxon</groupId>
>>>>>         <artifactId>saxon</artifactId>
>>>>>         <version>9.1.0.8</version>
>>>>>         <classifier>dom</classifier>
>>>>>       </dependency>
>>>>>
>>>>> If not, then download a recent version of saxon and try it.
>>>>>
>>>>>
>>>>> On Thu, Jan 6, 2011 at 7:39 AM, Kovacs Zsolt<zsolt.m.kovacs@gmail.com>
>>>>>   wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>>   I have a camel endpoint .to("xslt:xslt/transformer.xsl") and in
the
>>>>>> transformer.xml file I try to use
>>>>>>   <xsl:variable name="now" select="current-dateTime()"/>
>>>>>>   but deployment failed  and get the "Error creating XSLT template.
>>>>>> This is most likely be caused by a XML parse error. Please verify
your
>>>>>> XSLT file configured."
>>>>>>   message.
>>>>>>
>>>>>>   I guess the problem is probably caused by the parser used by Camel
>>>>>> because when I using as jbi endpoint there are no issues.
>>>>>>   Can I change the Camel XML parser ?
>>>>>>
>>>>>> Thanks,
>>>>>> Zsolt
>>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> Willem
>>> ----------------------------------
>>> FuseSource
>>> Web: http://www.fusesource.com
>>> Blog:    http://willemjiang.blogspot.com (English)
>>>          http://jnn.javaeye.com (Chinese)
>>> Twitter: willemjiang
>>>
>>
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Mime
View raw message