xslt를 처음 사용합니다. 한 스키마의 XML을 다른 스키마로 변환하려고합니다. 변환 후 이전 네임 스페이스를 "제거"하고 싶습니다. 변환 자체에 이전 스키마가 필요한 경우 변환 후에 해당 스키마를 지우려면 어떻게해야합니까? 본질적으로, 나는 http://positionskillmanagementservice.webservices.com
을 없애고 전적으로 http://newschema
(노드 이름을 변경 한 후)으로 대체하려고합니다.xslt를 사용하여 이전 네임 스페이스 제거
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns="http://positionskillmanagementservice.webservices.com"
version="1.0">
<xsl:output method="xml" />
<xsl:template match="ns:return">
<parameter>
<xsl:apply-templates select="@*|node()"/>
</parameter>
</xsl:template>
<xsl:template match="ns:position">
<parameter>
<xsl:apply-templates select="@*|node()"/>
</parameter>
</xsl:template>
<xsl:template match="ns:positionSkillResponse">
<positionSkillRequest >
<xsl:apply-templates select="@*|node()"/>
</positionSkillRequest >
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
내가 일을 확인하고 있습니다 :
<ns:positionSkillResponse xmlns:ns="http://positionskillmanagementservice.webservices.com">
<ns:return>1</ns:return>
<ns:return>9</ns:return>
</ns:positionSkillResponse>
이는 XSLT이다 : 나는에서 Dimitre Novatchev의 방법을 통해 내가 원하는 걸의 대부분을 할 수 있어요 다음 XML change the namespace of an element with xslt
이있다 this tool.