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]

RE: Intersection Problem


> How I can "Intersect" document 2 with document 1 so that it brings the
> <statResult> nodes which have the equal number or more 
> drilldown nodes found
> in doc 2. (The intersection key is drilldownType)

I'm not really sure what you mean by "intersect" - it would help to give an
indication of the output you expect. I suspect you mean that you want to
augment document2 by adding the drillDownName corresponding to each
drillDownType. (I'd call that a join rather than an intersection). The
obvious way to do this is to define a key:

<xsl:key name="ddt" match="DrillDown" use="DrillDownType"/>

and then process document 2 by writing:

<xsl:template match="drillDown">
   <xsl:copy-of select="DrillDownType"/>
   <xsl:variable name="ddt" select="DrillDownType"/>
   <xsl:for-each select="document('doc1')">
      <xsl:copy-of select="key('ddt', $ddt)/DrillDownName"/>
   </xsl:for-each>
</xsl:template>

Mike Kay


 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]