Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在mule的.xslt中隐藏xml(WSDL)文件的某些部分的条件_Xml_Xslt_Xsd_Wsdl_Mule - Fatal编程技术网

在mule的.xslt中隐藏xml(WSDL)文件的某些部分的条件

在mule的.xslt中隐藏xml(WSDL)文件的某些部分的条件,xml,xslt,xsd,wsdl,mule,Xml,Xslt,Xsd,Wsdl,Mule,这是我的.xslt文件: <?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/"

这是我的.xslt文件:

    <?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/"
                                xmlns:s="http://www.w3.org/2001/XMLSchema">

   <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes" />
   <xsl:param  name="remoteClientAddress" />
   <xsl:variable name="remoteClientAddressTrimmed"
       select="substring-before(substring-after($remoteClientAddress, '/'), ':')" />


<xsl:template match="@*|node()"> 
  <xsl:copy copy-namespaces="yes">
    <xsl:apply-templates select="@*|node()"/>
    <!-- <xsl:value-of select="$remoteClientAddressTrimmed"/> -->
  </xsl:copy> 
</xsl:template>



<xsl:template match="wsdl:operation[@name = 'GetCityWeatherByZIP']">
   <xsl:variable name="$rcaTrimmed" 
          select="substring-before(substring-after($remoteClientAddress, '/'), ':')" />
   <xsl:if test="$rcaTrimmed != '192.168.0.75'">
      <xsl:copy>
         <xsl:apply-templates select="@* | node()" />
      </xsl:copy>
   </xsl:if>
</xsl:template>


</xsl:stylesheet>
当我运行我的项目时,我的项目没有启动,我看到了我复制的所有主要错误。
我该怎么做才能解决这个问题呢?

最可能的问题是这一行:

<xsl:variable name="$rcaTrimmed" 

您是否尝试过使用XSLT转换XML,并按照您的期望找到了它?尝试使用
not($rcatimed='YOUR_IP')
我尝试了这个:但是我再次出现了错误>复制/粘贴您得到的转换错误。我在问题中复制了它们,现在在注释中我无法复制它们,因为它们太长了
        Exception in thread "main" org.mule.module.launcher.DeploymentStartException: TransformerConfigurationException: Failed to compile stylesheet. 2 errors detected.
        at org.mule.module.launcher.application.DefaultMuleApplication.start(DefaultMuleApplication.java:174)
        at org.mule.module.launcher.application.ApplicationWrapper.start(ApplicationWrapper.java:107)
        at org.mule.module.launcher.DefaultMuleDeployer.deploy(DefaultMuleDeployer.java:47)
        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.lifecycle.LifecycleException: Failed to start inbound endpoint "endpoint.http.localhost.8085.Weather.Service"
        at org.mule.endpoint.DefaultInboundEndpoint.start(DefaultInboundEndpoint.java:122)
        at org.mule.construct.AbstractFlowConstruct.startIfStartable(AbstractFlowConstruct.java:317)
        at org.mule.construct.AbstractPipeline.doStart(AbstractPipeline.java:259)
        at org.mule.construct.AbstractFlowConstruct$2.onTransition(AbstractFlowConstruct.java:143)
        at org.mule.construct.AbstractFlowConstruct$2.onTransition(AbstractFlowConstruct.java:139)
        at org.mule.lifecycle.AbstractLifecycleManager.invokePhase(AbstractLifecycleManager.java:141)
        at org.mule.construct.FlowConstructLifecycleManager.fireStartPhase(FlowConstructLifecycleManager.java:95)
        at org.mule.construct.AbstractFlowConstruct.start(AbstractFlowConstruct.java:138)
        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.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:225)
        at org.mule.lifecycle.RegistryLifecycleManager$RegistryLifecycleCallback.onTransition(RegistryLifecycleManager.java:276)
        at org.mule.lifecycle.RegistryLifecycleManager.invokePhase(RegistryLifecycleManager.java:155)
        at org.mule.lifecycle.RegistryLifecycleManager.fireLifecycle(RegistryLifecycleManager.java:126)
        at org.mule.registry.AbstractRegistryBroker.fireLifecycle(AbstractRegistryBroker.java:80)
        at org.mule.registry.MuleRegistryHelper.fireLifecycle(MuleRegistryHelper.java:120)
        at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:94)
        at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:90)
        at org.mule.lifecycle.MuleContextLifecycleManager.invokePhase(MuleContextLifecycleManager.java:72)
        at org.mule.lifecycle.MuleContextLifecycleManager.fireLifecycle(MuleContextLifecycleManager.java:64)
        at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:249)
        at org.mule.module.launcher.application.DefaultMuleApplication.start(DefaultMuleApplication.java:151)
        ... 4 more
    Caused by: org.mule.api.lifecycle.InitialisationException: Failed to compile stylesheet. 2 errors 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.endpoint.DefaultInboundEndpoint.createMessageProcessorChain(DefaultInboundEndpoint.java:163)
        at org.mule.endpoint.AbstractEndpoint.getMessageProcessorChain(AbstractEndpoint.java:517)
        at org.mule.endpoint.DefaultInboundEndpoint.start(DefaultInboundEndpoint.java:104)
        ... 27 more
    Caused by: javax.xml.transform.TransformerConfigurationException: Failed to compile stylesheet. 2 errors 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)
        ... 32 more
<xsl:variable name="$rcaTrimmed" 
<xsl:variable name="rcaTrimmed"