Subject:New to Stylus Author:Carlton Noles Date:25 Nov 1999 10:37 AM
I am new with stylus. One of the default rules outputs all of the text. When I add rules I am getting a duplication of the existing text what am I doing wrong?
Subject:New to Stylus Author:Omri Traub Date:29 Nov 1999 01:11 PM
Hi,
I am not sure that I understand your problem. In general, there are two default rules: one that processes every xml element by searching and applying an appropriate template for each of its children. The other is a default rule for text, which just displays it.
The result of these two is that with a brand new stylesheet, you will see that just the xml text is being displayed.
I am not sure why you are getting duplication. If you post a specific example, I can be more specific.
The reason you get the data repeated is because you have both: (xsl:apply-templates) and (xsl:value-of) in your template. The apply-templates call goes and uses the default text rule to accomplish the same thing as your value-of call. Stylus puts (xsl:apply-templates) in every new template you create. If you want to specify your own content, you may wish to delete that code first.