• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to map secondary elements with main if have same ids for both?

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to map secondry elements with its matching primary elements if they both have same id.
How can this be achieved in xslt.
If ids are not matching then not a single element of secondry sholud be shown.
If ids matching, then other fields of secondry elements, should be mapped to similar fields of primary elements.
Eg: Its like some program running and in between some add on programs started (may be trailor or advertisement).
the add on program is not always shown (optional), and whenever shown it has its own data information etc etc.

Please provide me some input, how to map and proceed.


Not sure what this code is really doing.

<xsl:template match="SECONDARY_EVENT_LIST">
<xsl:variable name="secondaryElements" select="ancestor::SCHEDULE/SECONDARY_ELEMENT_LIST"/>
<xsl:for-each select="SCHEDULE_ELEMENT_ID">
<xsl:variable name="id" select="."/>
<xsl:apply-templates select="$secondaryElements/SCHEDULE_ELEMENT[(@ID=$id)]"/>
</xsl:for-each>
</xsl:template>

Is this having any relation with what my requirement is all about?
 
reply
    Bookmark Topic Watch Topic
  • New Topic