<?xml version="1.0"?>
<c:configuration xmlns:c="urn:schemas-med-sadfens-com:config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:schemas-med-sadfens-com:config D:\config.xsd">
<c:component c:name="FC1PLAZACS1-DEV [Central Server]" c:keywords="Server" c:helpriid="11f7b87d-52ae-434b-8ace-4ffb4ecbe080">
<c:propertyelement c:name="System manufacturer" c:value="select Manufacturer from Win32_ComputerSystem" c:type="Wmi" xmlns:c="urn:schemas-med-siemens-com:config" />
<c:propertyelement c:name="System model" c:value="select Model from Win32_ComputerSystem" c:type="Wmi" xmlns:c="urn:schemas-med-siemens-com:config"/>
</c:component>
</c:configuration>
在上面的xml中,我想要一切都是这样,但是我的xsl没有复制它
即它无法从
复制元素xmlns:c =“urn:schemas-med-siemens-com:config”<c:propertyelement c:name="System manufacturer" c:value="select Manufacturer from Win32_ComputerSystem" c:type="Wmi" xmlns:c="urn:schemas-med-siemens-com:config" />
请找我的XSl
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:c="urn:schemas-med-siemens-com:config" >
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
请尽快告诉我答案
答案 0 :(得分:0)
我使用类似于以下内容的方法将节点迁移到新的命名空间YMMV:
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:c="urn:schemas-med-siemens-com:config" >
<xsl:param
name="new-ns"
select="'http://my.new.ns'"
/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="*">
<xsl:element name="{local-name()}" namespace="{$new-ns}">
<xsl:apply-templates select="node()|@*"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>