• 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

template matching problem

 
Ranch Hand
Posts: 309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
This seems to be a simple problem at first glance, but i somehow got stuck and still trying...
I have a template that transforms the contents in a <table>....</table> tag.

Now I have an xml file

I import the above template(xsl file) in my main xsl file to use the table template.
Now how do I apply this template. I am currently at the table element and gotto apply the table template. This wont work cos the table template matches the table tag and since I am already at the table tag, I can only process the child elements of the table tag. I am not supposed to change the imported template and my xml structure is also as defined above. I hope I have explained the problem clearly.
Regards,
Shankar.
 
shankar vembu
Ranch Hand
Posts: 309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I forgot to stress that I am the table tag currently. So I need to call the template while the context node is table tag.
shankar.
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<xsl:template match="table">
..... all transformations go here....
<xsl:apply-templates/>
</xsl:template>
should work...
 
You don't like waffles? Well, do you like this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic