Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

template matching problem

 
shankar vembu
Ranch Hand
Posts: 309
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Mapraputa Is
Leverager of our synergies
Sheriff
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<xsl:template match="table">
..... all transformations go here....
<xsl:apply-templates/>
</xsl:template>
should work...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic