首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >JMS适配器添加命名空间值xmlns="“

JMS适配器添加命名空间值xmlns="“
EN

Stack Overflow用户
提问于 2015-07-18 03:57:53
回答 1查看 405关注 0票数 0

使用SOA BPEL2.0,我尝试将字符串映射到JMS出站队列。

我使用简单的xsd如下所示

代码语言:javascript
运行
复制
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                      elementFormDefault="qualified">
<xsd:element name="FullName" type="xsd:string"/>
</xsd:schema>

目前,队列消息的生成方式为

代码语言:javascript
运行
复制
<?xml version="1.0" encoding="UTF-8" ?><FullName xmlns="">
....
....
</FullName>

其中,所需的队列消息是

代码语言:javascript
运行
复制
<?xml version="1.0" encoding="UTF-8" ?><FullName>
....
....
</FullName>

我没有使用任何xsl之类的东西。

任何帮助或线索都会很棒。

EN

回答 1

Stack Overflow用户

发布于 2015-07-18 04:17:03

请尝试下面的代码:

它从处理的文件中删除所有名称空间定义,但复制所有其他节点和值:元素、属性、注释、文本和处理指令。

代码语言:javascript
运行
复制
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:output indent="yes" method="xml" encoding="utf-8" omit-xml-declaration="yes"/>

    <!-- Stylesheet to remove all namespaces from a document -->
    <!-- NOTE: this will lead to attribute name clash, if an element contains
        two attributes with same local name but different namespace prefix -->
    <!-- Nodes that cannot have a namespace are copied as such -->

    <!-- template to copy elements -->
    <xsl:template match="*">
        <xsl:element name="{local-name()}">
            <xsl:apply-templates select="@* | node()"/>
        </xsl:element>
    </xsl:template>

    <!-- template to copy attributes -->
    <xsl:template match="@*">
        <xsl:attribute name="{local-name()}">
            <xsl:value-of select="."/>
        </xsl:attribute>
    </xsl:template>

    <!-- template to copy the rest of the nodes -->
    <xsl:template match="comment() | text() | processing-instruction()">
        <xsl:copy/>
    </xsl:template>

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

https://stackoverflow.com/questions/31483764

复制
相关文章

相似问题

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