I want to in my XML (WSDL) file remove s:element between tag:
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://ws.cdyne.com/WeatherWS/">
<s:element name="GetWeatherInformation">
<s:complexType/>
</s:element>
<s:element name="GetWeatherInformationResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetWeatherInformationResult" type="tns:ArrayOfWeatherDescription"/>
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfWeatherDescription">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="WeatherDescription" type="tns:WeatherDescription"/>
</s:sequence>
</s:complexType>
<s:complexType name="WeatherDescription">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="WeatherID" type="s:short"/>
<s:element minOccurs="0" maxOccurs="1" name="Description" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="PictureURL" type="s:string"/>
</s:sequence>
</s:complexType>
<s:element name="GetCityForecastByZIP">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ZIP" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
Now I want to remove <s:element name="GetCityForecastByZIP">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ZIP" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
When I use this structure in my .xslt file <xsl:template match="s:element[@name = 'GetCityForecastByZIP']" /> after running I have error in my console , How can I remove it?
I saw this error in my Mule-Console
Exception in thread "main" org.mule.module.launcher.DeploymentInitException: TransformerConfigurationException: Failed to compile stylesheet. 1 error detected.
at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:220)
at org.mule.module.launcher.application.ApplicationWrapper.init(ApplicationWrapper.java:64)
at org.mule.module.launcher.DefaultMuleDeployer.deploy(DefaultMuleDeployer.java:46)
at org.mule.tooling.server.application.ApplicationDeployer.run(ApplicationDeployer.java:56)
at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:88)
Caused by: org.mule.api.config.ConfigurationException: Error creating bean with name '_muleNotificationManager': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceName': Invocation of init method failed; nested exception is org.mule.api.lifecycle.InitialisationException: Failed to compile stylesheet. 1 error detected. (org.mule.api.lifecycle.InitialisationException) (org.mule.api.config.ConfigurationException)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:52)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at org.mule.context.DefaultMuleContextFactory.createMuleContext(DefaultMuleContextFactory.java:80)
at org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:208)
... 4 more
Caused by: org.mule.api.config.ConfigurationException: Error creating bean with name '_muleNotificationManager': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceName': Invocation of init method failed; nested exception is org.mule.api.lifecycle.InitialisationException: Failed to compile stylesheet. 1 error detected. (org.mule.api.lifecycle.InitialisationException)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:52)
at org.mule.config.builders.AbstractResourceConfigurationBuilder.configure(AbstractResourceConfigurationBuilder.java:78)
at org.mule.config.builders.AutoConfigurationBuilder.autoConfigure(AutoConfigurationBuilder.java:101)
at org.mule.config.builders.AutoConfigurationBuilder.doConfigure(AutoConfigurationBuilder.java:57)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46)
... 7 more
Caused by: org.mule.api.lifecycle.InitialisationException: Error creating bean with name '_muleNotificationManager': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceName': Invocation of init method failed; nested exception is org.mule.api.lifecycle.InitialisationException: Failed to compile stylesheet. 1 error detected.
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:117)
at org.mule.config.spring.SpringXmlConfigurationBuilder.createSpringRegistry(SpringXmlConfigurationBuilder.java:116)
at org.mule.config.spring.SpringXmlConfigurationBuilder.doConfigure(SpringXmlConfigurationBuilder.java:73)
at org.mule.config.builders.AbstractConfigurationBuilder.configure(AbstractConfigurationBuilder.java:46)
... 11 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_muleNotificationManager': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceName': Invocation of init method failed; nested exception is org.mule.api.lifecycle.InitialisationException: Failed to compile stylesheet. 1 error detected.
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1442)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:581)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:89)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:109)
... 14 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceName': Invocation of init method failed; nested exception is org.mule.api.lifecycle.InitialisationException: Failed to compile stylesheet. 1 error detected.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:408)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:319)
at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:1154)
at org.mule.config.spring.ServerNotificationManagerConfigurator.getMergedListeners(ServerNotificationManagerConfigurator.java:83)
at org.mule.config.spring.ServerNotificationManagerConfigurator.getObject(ServerNotificationManagerConfigurator.java:65)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
... 23 more
Caused by: org.mule.api.lifecycle.InitialisationException: Failed to compile stylesheet. 1 error detected.
at org.mule.module.xml.transformer.XsltTransformer.initialise(XsltTransformer.java:142)
at org.mule.processor.chain.AbstractMessageProcessorChain.initialise(AbstractMessageProcessorChain.java:79)
at org.mule.processor.chain.AbstractMessageProcessorChain.initialise(AbstractMessageProcessorChain.java:79)
at org.mule.construct.AbstractFlowConstruct.initialiseIfInitialisable(AbstractFlowConstruct.java:309)
at org.mule.construct.AbstractPipeline.doInitialise(AbstractPipeline.java:161)
at org.mule.construct.AbstractFlowConstruct$1.onTransition(AbstractFlowConstruct.java:111)
at org.mule.construct.AbstractFlowConstruct$1.onTransition(AbstractFlowConstruct.java:105)
at org.mule.lifecycle.AbstractLifecycleManager.invokePhase(AbstractLifecycleManager.java:141)
at org.mule.construct.FlowConstructLifecycleManager.fireInitialisePhase(FlowConstructLifecycleManager.java:81)
at org.mule.construct.AbstractFlowConstruct.initialise(AbstractFlowConstruct.java:104)
at org.mule.config.spring.factories.AbstractFlowConstructFactoryBean.initialise(AbstractFlowConstructFactoryBean.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1581)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1522)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 35 more
Caused by: javax.xml.transform.TransformerConfigurationException: Failed to compile stylesheet. 1 error detected.
at net.sf.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:153)
at net.sf.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:137)
at net.sf.saxon.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:88)
at org.mule.module.xml.transformer.XsltTransformer$PooledXsltTransformerFactory.makeObject(XsltTransformer.java:363)
at org.apache.commons.pool.impl.GenericObjectPool.addObject(GenericObjectPool.java:1615)
at org.mule.module.xml.transformer.XsltTransformer.initialise(XsltTransformer.java:138)
... 52 more
This is my .xslt file :
<?xml version='1.0' ?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes" />
<xsl:template match="@*|node()">
<xsl:copy copy-namespaces="yes">
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="wsdl:operation[@name = 'GetCityWeatherByZIP']" />
<xsl:template match="wsdl:message[@name = 'GetCityWeatherByZIPSoapIn']" />
<xsl:template match="wsdl:message[@name = 'GetCityWeatherByZIPSoapOut']" />
<xsl:template match="wsdl:message[@name = 'GetCityWeatherByZIPHttpGetIn']" />
<xsl:template match="wsdl:message[@name = 'GetCityWeatherByZIPHttpGetOut']" />
<xsl:template match="wsdl:message[@name = 'GetCityWeatherByZIPHttpPostIn']" />
<xsl:template match="wsdl:message[@name = 'GetCityWeatherByZIPHttpPostOut']" />
<xsl:template match="s:element[@name = 'GetCityWeatherByZIP']" />
</xsl:stylesheet>
JLRishe has made a good guess as to what is wrong with your stylesheet, but it should not have been necessary to guess. You’ve shown us the stack trace, which reveals that the XSLT processor reported compile time errors, but you haven’t shown us those errors, which probably means you aren’t seeing them. By default they will go to the standard error output, and if you’re compiling from a Java application, you need to make sure that you direct the diagnostics to somewhere where you can see them. Fixing the current coding error in the stylesheet, without fixing the problem of running the compiler in such a way that you see diagnostics in future, isn’t going to get you much further.
You could of course try to develop your stylesheets in an IDE that would detect such errors before you deploy the code. But even then, you should invest in creating a robust logging framework where you are able to find error messages.