• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Why aren't DENSITY & DISTANCE text displayed?

 
Rancher
Posts: 1449
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, all!
I just want to get something clear about default template rules. I have the following XML file and XSL stylesheet:

When I do the transformation I get a table that displays the name, mass, radius, and day of Mercury. What I am wondering is why doesn't the text data for the density & the distance get generated outside the table? Is this because the template for PLANET explicitly states what to do so that the density and distance elements aren't even looked at?
I guess my question is if you have a template or templates for a node (with a match attr) will this prevent the default template rule from being applied to sibling nodes even if they fail the match test? I just want to be very clear on how default template rules get applied.
The example XML & XSL files are based on the examples in Inside XSLT by Steven Holzner.
Thanks,
John
 
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
I guess my question is if you have a template or templates for a node (with a match attr) will this prevent the default template rule from being applied to sibling nodes even if they fail the match test?
I believe so. If you want to allow child nodes processing, add <xsl:apply-templates/> at the end of the template
<xsl:template match="PLANET">
   <TR>
       <TD><xsl:value-of select="NAME"/></TD>
       ...
       <xsl:apply-templates/>
   </TR>
</xsl:template>
and see all default templates at work
[ March 17, 2002: Message edited by: Mapraputa Is ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic