Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

One more URGENT Qustions about Default Template Rules

 
Himal Chuli
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi folk,
i am still not clear about this Default Template Rule and i would like to someone to clear my confusions.
here is my xml
_________________
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href = "Sales.xsl" type = "text/xsl" ?>
<SalesReport>
<!-- comments -->
<Company name = "Testing"></Company>
<Period date = "23 year"></Period>
<Sales Region = "EU"></Sales>
<Sales Region = "NA"></Sales>
<Sales Region = "AV"></Sales>
</SalesReport>
here is my xsl
______________________
<?xml version='1.0'?>
<!-- FILE NAME main.xsl -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>

</xsl:stylesheet>
what i am trying to do here is see if the default templates rules get applied here. if i provided a value to any of the elements in my xml above, the xls oututs it. this clearly says that the defualut rule for ELEMENT has been applied. but since all the elements are emply in the xml file, i am trying to see if the default template rule for attribute gets applied here.i always thought it would. but it's not because it does not output any value of the attributes. i don't understand why the default template rule for ATTRIBUTE has not be activated. could someone please explain me this process?
thanks.
himal
[ October 20, 2002: Message edited by: Himal Chuli ]
[ October 20, 2002: Message edited by: Himal Chuli ]
 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Himal,
Please have a look at the last item on this thread
http://www.coderanch.com/t/146567/po/certification/having-XPath-expression
I have to make a small correction there. The attributes are indeed nodes of the tree structure of xpath, but they are not the child nodes. I guess the <xsl:apply-templates/> and all the default stuff walks down the tree w.r.t the parent-child kind of relationship and hence we cannot see the default template for the attribute getting executed eventhough there exists one.
 
Himal Chuli
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Jayadev
himal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic