XSLT格式化XML标记问题

时间:2015-02-01 06:34:53

标签: xml xslt

是XSLT的新手,需要使用XSLT代码将以下XML输入转换为XML输出。

输入:

<Raj>
   <A>1</A>
   <B>3</B>
   <D></D>
   <E></E>
</Raj>

输出:

<Raj>
   <Request>
       <A>1</A>
       <B>3</B>
       <D></D>
       <E></E>
   </Request>
</Raj>

1 个答案:

答案 0 :(得分:0)

对于XSL 1.0,请尝试这样的

  <xsl:template match="/*">
    <xsl:element name="{local-name(current())}">
      <Request>
        <xsl:copy-of select="child::*"/>
      </Request>
    </xsl:element>
  </xsl:template>
相关问题