未复制xslt属性

未复制xslt属性,xslt,Xslt,这是我的xml,我有简单的XSLT来更新一个元素,并复制所有其他元素 <?xml version='1.0' encoding='UTF-8'?> <sip xmlns="urn:x-emc:ia:schema:sip:1.0"> <dss> <holding>message</holding> <id>message-2018-06-12-gthlZYrWZjJuQ</id> <

这是我的xml,我有简单的XSLT来更新一个元素,并复制所有其他元素

<?xml version='1.0' encoding='UTF-8'?>
<sip xmlns="urn:x-emc:ia:schema:sip:1.0">
  <dss>
    <holding>message</holding>
    <id>message-2018-06-12-gthlZYrWZjJuQ</id>
    <pdi_schema>urn:bhp:documentum:message.1.0</pdi_schema>
    <production_date>2018-06-12T21:23:04.752+08:00</production_date>
    <base_retention_date>2018-06-12T21:23:04.752+08:00</base_retention_date>
    <producer>IA_Samples</producer>
    <entity>IA</entity>
    <priority>0</priority>
    <application>IA</application>
  </dss>
  <production_date>2018-06-12T21:23:04.752+08:00</production_date>
  <seqno>1</seqno>
  <is_last>true</is_last>
  <aiu_count>10</aiu_count>
  <page_count>0</page_count>
  <pdi_hash algorithm="SHA-256" encoding="base64">iLrzH22nT7Nr258E/oBve+dFDFFyUaMHGz2v9BoBSr0=</pdi_hash>
</sip>

消息
信息-2018-06-12-GTHLZYRWZJJJUQ
urn:bhp:documentum:message.1.0
2018-06-12T21:23:04.752+08:00
2018-06-12T21:23:04.752+08:00
IA_样本
IA
0
IA
2018-06-12T21:23:04.752+08:00
1.
真的
10
0
iLrzH22nT7Nr258E/oBve+DFFYUAMHGZ2V9BOBSR0=
下面是我的XSLT

<?xml version="1.0"?>
<xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"    
    xmlns="urn:x-emc:ia:schema:sip:1.0" xmlns:exsl="http://exslt.org/common"
    xmlns:emc="urn:x-emc:ia:schema:sip:1.0"
    extension-element-prefixes="exsl" xmlns:f="Functions" exclude-result-prefixes="emc xs xsl f">

    <!-- 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>

   <xsl:template match="emc:base_retention_date"> 

           <base_retention_date>2016-06-30</base_retention_date>              
    </xsl:template>
  </xsl:stylesheet>

2016-06-30              
在输出xml中,不会复制以下元素的属性

 <pdi_hash algorithm="SHA-256" encoding="base64">iLrzH22nT7Nr258E/oBve+dFDFFyUaMHGz2v9BoBSr0=</pdi_hash>
iLrzH22nT7Nr258E/oBve+DFFYUAMHGZ2V9BOBSR0=

我遗漏了什么?

没有复制属性,因为您没有复制它们

如果要使用match=“@*”模板规则复制属性,则需要通过执行
,确保实际调用了该模板