• 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

what is template rule in xsl ?

 
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Following example is taken from the link "http://edutechwiki.unige.ch/en/XSLT_Tutorial_-_Basics#A_first_glance_at_XSLT"

xml file that contains content



xsl file used to transform xml in html


What does <xsl:apply-templates/> do ?
I was reading this example online and it was sated that
<xsl:apply-templates/> means: "go and look for other rules"
what does this mean ? where does the control go, when it encounters
<xsl:apply-templates/> as there is no other rule for root element "page" ?

in this example, we have "title" as a child element of "page" element. To access "title", do we need to have template for root elelment , <xsl:template match="page"> ? Can we access "title" without template for "page" like as follows by placing forward slash before "title" ?


I have read in other book that <xsl:apply-templates> is used when there unstructured content and tags in that unstructured cntent is t be matched. e.g. there are some <bold> texts in a paragraph and we can apply <B> for all the occurrences of <bold> using <xsl:apply-templates/> this secod use makes more sense to me. So does i mean that <xsl:apply-templates> can be used for both purposes ? Are these two purposes same or different ? Please explain if there is something wrong in understanding.

Please explain the use of <xsl:apply-templates> as its very confusing and has already taken lot of my time



 
reply
    Bookmark Topic Watch Topic
  • New Topic