2017-10-06 93 views

回答

0

对于当前的需求,你可以处理这只是这样

<xsl:template match="Records"> 
    <xsl:for-each select="//Person|//Entity"> 
     <Entity> 
      <xsl:attribute name="ID" select="position()"/> 
      <xsl:choose> 
       <xsl:when test="self::Person"> 
        <Type>Individual</Type> 
        <Gender>Male</Gender> 
        <xsl:copy-of select="descendant::FirstName"/> 
       </xsl:when> 
       <xsl:otherwise> 
        <Type>Business</Type> 
        <Full_Name><xsl:value-of select="descendant::EntityName"/></Full_Name> 
       </xsl:otherwise> 
      </xsl:choose> 
     </Entity> 
    </xsl:for-each> 
</xsl:template> 
+0

由于@Rupesh ...一张更多怀疑。由于我是XSLT新手,我不确定很多事情。 –

+0

是否可以从标签中删除重复项? –

+0

是@nandhinisuresh – Rupesh

相关问题