2017-10-06 73 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

相關問題