aspose file tools*
The moose likes XML and Related Technologies and the fly likes XSLT apply-template with-param not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSLT apply-template with-param not working" Watch "XSLT apply-template with-param not working" New topic
Author

XSLT apply-template with-param not working

kapil Gupta
Ranch Hand

Joined: Dec 17, 2001
Posts: 89
Hi,
I am facing problem in passing parameter using apply-templates in XSLT.


The value of parameter myvar is coming out to be empty in strong//text() template. Is this the right way to pass parameter?
Regards,
Kapil
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18909
    
    8

Yes, that is the correct way to pass parameters.

If you are getting nothing as the parameter of the second template, then perhaps it is not being called by the first template. Perhaps the first template calls a built-in template rule for some node, and that rule in turn calls the second template.
kapil Gupta
Ranch Hand

Joined: Dec 17, 2001
Posts: 89
Thanks Paul. I think you are right. The apply-template is calling some other template because it is working if I use call-template.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: XSLT apply-template with-param not working