Forum main
page
Most
active member
Login page
Register
Log out
Search page
View our event calendar
Add general event such as an upcoming
software release or conference
View all birthdays
Public image gallery
Upload your images in your profile
Profile editing page
Subscription list page
Address book page
Member list page
View the
most active member
User groups listing
Private message page
|
|
Users viewing this topic: none
|
|
Login | |
|
apply-templates and don't come back...? - 15 September 2008
|
|
|
claes
Posts: 4
Score: 0 Joined: 11 February 2008 Status: offline
|
Hi, I am pretty new to xslt and have a basic question. I have a set of template rules that styles a pdf document from raw xml data. In my xml there is an element <overview> that is always at the very end of the doc before the closing </root>. In some cases I want to branch on a variable after writing some of the <head> element data at the top of the doc (with <xsl:template match="root/head/title">), and if the var has a value "x" I want to apply-templates select="../../overview" /> and write out the content of <overview> and then stop! In my output I get the <head> content, then the <overview> content (just like I want), but... then it "jumps back" and continues with all other elements between <head> and <overview>. Why is that? I thought after the "apply-templates select=..." it would jump to overview but not continue with the rest of the doc, since there is no other apply-templates after the jump to <overview>... Maybe I am being unclear, any help and suggestion are welcome! I am happy to try and clarify if needed. Thanks!! /Claes
|
|
|
|
RE: apply-templates and don't come back...? - 16 September 2008
|
|
|
nickat
Posts: 4
Score: 0 Joined: 26 July 2008 Status: offline
|
quote:
ORIGINAL: claes then it "jumps back" and continues with all other elements between <head> and <overview>. Why is that? I thought after the "apply-templates select=..." it would jump to overview but not continue with the rest of the doc, since there is no other apply-templates after the jump to <overview>... It always "jumps back" because the input tree is traversed recursively and all matching templates are applied to every node. You can use modes to choose different templates based on some condition. It's hard to give some concrete advice, since I don't have the whole picture. Some essential parts of your stylescheet, an example of an input and expected output could help.
|
|
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|