This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

conditional merge



I am attempting a conditional merge when two elements of different XML
files are the same.
Using the example below obtained from
http://www.dpawson.co.uk/xsl/sect2/merge.html#d154e147

 <xsl:copy-of select="document('a.xml')//id[.=document('b.xml')//id]"/>

I can match elements. However, when I attempt to  do a little more
processing such as is seen below, I fail to get the desired results.  When
the elements match I want it to copy that specific element. However, what I
have causes every element to be copied. Any help would be greatly
appreciated.

  <xsl:template match="l_name">
  <xsl:if test="document('a.xml')//l_name[.=document('b.xml')//_name]">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:if>
  </xsl:template>
  </xsl:stylesheet>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]