• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

template based XSl

 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,
We can make two types of xsl files in general .
1) Template based .
2) Non template Bases .or you can say simple.
Can anyone one compare what is the difference between them .
Regards .
Awais Bajwa
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Template base XSL use to create the rule of template that includes specify the template and apply the specified template.
It may be used to transform an XML document to an another XML document(filtered).
e.g,
<xsl:template match="root">
<xsl:apply-templates select="path1"/>
</xsl:template>
<xsl:template match="path1">
<xsl:apply-templates/>
</xsl:template>
In simple XSL used to create XSL-enhanced HTML document. I guess even in this trnsformation you need to specfy at lease a single template to get the required note path.
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, awais
The complexity of xsl depends on the structure of original xml document. Refer to Michael Kay's famous book _XSLT Programmer's Reference_ chapter9 "Stylesheet Design Patterns" to get some ideas of that.

Doug.
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Template based XSLT is usually used in a recursive way... along the lines of "whenever you find an element like this, do this with it", and then nested elements cause templates to be applied, etc...
The simpler form you're referring to is often called "fill in the blanks" XSLT, which is very much like a form letter used with a mail merge. You create lots of fixed (static) content, then insert xsl: elements for stuff that varies.
Here's an example of the latter, which writes a Java bean to represent state that's stored in an XML file:
reply
    Bookmark Topic Watch Topic
  • New Topic