xml Constant

E

elhajjar

Hi,

I have a block of code (title of table with some images) repeating
many time in my XSL file. I do not want to repeat this block of code
many time, I like to use like constant to define the block of code to
it.

And in my XSL file, put this constant to have the block of code.

How can I do this in XSL?

Thanks,
 
P

Patrick TJ McPhee

% I have a block of code (title of table with some images) repeating
% many time in my XSL file. I do not want to repeat this block of code
% many time, I like to use like constant to define the block of code to
% it.

How about using a variable?
<xsl:variable name="block">
<whatever>you like</whatever>
</xsl:variable>

% And in my XSL file, put this constant to have the block of code.

<xsl:copy-of select="$block"/>

Note that the variable value must be well-formed.
 
J

Johannes Koch

elhajjar said:
Hi,

I have a block of code (title of table with some images) repeating
many time in my XSL file. I do not want to repeat this block of code
many time, I like to use like constant to define the block of code to
it.

And in my XSL file, put this constant to have the block of code.

How can I do this in XSL?

<xsl:template name="myBlock">
<!-- the code -->
</xsl:template>

<xsl:call-template name="myBlock"/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top