Register  |  Login



Earn money by sharing your knowledge through Quomon's revenue sharing program

Question

Status: Closed Points: 150 Time: 03:21 - Dec 05, 2006  

theDude

how to use xsl:call-template with a node as a parameter?

In my XSLT document I need to run through a list of nodes and for each node call a template. But I need to pass the node as a parameter to the template. Is that possible? And how do I refer to the node within the template?

Categories:

Answer Discussion
Tutorials

 

Q&A System for Websites and Corporate Collaboration

Advertisement

  • Generates significant organic traffic for websites
  • Saves companies money, resources, and time

theDude

Date:: Dec 05, 2006

Time:: 03:41

i found out it wasn't so difficult:

<xsl:call-template name="concert">
 <xsl:with-param name="node" select="."/>
</xsl:call-template>

<xsl:template name="concert">
 <xsl:param name="node"/>
 <xsl:value-of select="$node/id" />
</xsl:template>

It was the part about getting the node attribute that I had wrong, when I tried.

xarcus

Date:: Dec 05, 2006

Time:: 07:37

Add the "attribute axis" sign @ to the attrib. name <xsl:value-of select="$node/@id" />

theDude

Date:: Dec 15, 2006

Time:: 12:17

actually Xarcus, it worked for me without the @, I have no idea why?!
thanks anyway.

Question Answered

This question has been closed, and points have been rewarded to the following experts:

theDude: 140
xarcus: 10

You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

No tutorials have been submitted yet. Want to be the first?

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top XSLT Experts

View More

Rank

Expert

Points

1.

xarcus

95

2.

rcastagna

25

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es