Register  |  Login




Advertisement

Start Your Own Q&A Site

Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.

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

 

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 Experts

View More

Rank

Expert

Points

1.

nidhi

10354

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4848

5.

PeterNZ

3487

6.

gonzalo

2840

7.

Mason

2770

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

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