首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >提取内联架构WSDL样式表xsom

提取内联架构WSDL样式表xsom
EN

Stack Overflow用户
提问于 2012-07-10 20:04:37
回答 2查看 865关注 0票数 0

我想从WSDL文件中提取内联模式。但是,我不知道如何执行XSL转换。任何关于创建这样的样式表的帮助都将是非常好的。

非常感谢,

EN

回答 2

Stack Overflow用户

发布于 2012-07-10 21:04:56

这一条对我很有效:

代码语言:javascript
复制
<?xml-stylesheet type="text/xsl"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:s="http://www.w3.org/2001/XMLSchema" >

<xsl:output method="xml" />

<xsl:template match='text()' />

<xsl:template match="//s:schema">
    <xsl:copy-of select='.'/>
</xsl:template>    

</xsl:stylesheet>

它假定您的内联架构使用http://www.w3.org/2001/XMLSchema名称空间。

票数 0
EN

Stack Overflow用户

发布于 2016-07-22 01:28:12

当wsdl包含多个架构元素时,您可以执行以下操作:使用https://gist.github.com/ebratb/3819949中的xsd-split.xslt将*.wsdl文件拆分为几个*.xsd文件。

您可以使用maven插件来运行带有Saxon的2.0XSLT(参见http://www.mojohaus.org/xml-maven-plugin/examples/transform-saxon.html )

然后编写一个小的模式文件,该文件只导入那些生成的*.xsd文件以及soap信封的官方定义。

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8" ?>  
<xsd:schema attributeFormDefault="unqualified"       elementFormDefault="qualified" targetNamespace="http://your.company.com/dummy" xmlns:xsd="http://www.w3.org/2001/XMLSchema">                      
   <xsd:import namespace="http://<target namespace of the first xsd file>"  schemaLocation="file:///path/to/first.xsd"  />
   <xsd:import namespace="http://<target namespace of the second xsd file>" schemaLocation="file:///path/to/second.xsd"  />
    ...

   <xsd:import namespace="http://schemas.xmlsoap.org/soap/envelope/" schemaLocation="http://schemas.xmlsoap.org/soap/envelope/" />
</xsd:schema>

使用自定义资源解析程序时,不需要schemaLocation属性。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11412925

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档