dynamic paramaters in a <table> html tag?

B

bjam

Hi, I am trying to do the following, which is to have a single place to
define my table paramaters such as cellpadding / cellspacing etc.
Below is the code I am trying to achieve see the cell spacing element
in the table html tag below. Thanks in advance for any help you can
provide. I really appreciate it.

This is currently not working as I can't have an xsl:value-of select
inside of the table tag itself... does anyone have any ideas on this?
Thanks in advance for your help with this.



<!-- get table stats-->
<xsl:call-template name='get_summary_table_specs'/>
<!-- open the table for the summary of passed items -->
<table border="0" cellpadding="2" cellspacing="<xsl:value-of select =
/xmltable[@spacing][text()]\>" bgcolor="lightblue" width="50%">


!-- import the data output template for displaying each row of resutls
-->
<xsl:template name="get_summary_table_specs">
<xmltable padding="5"/>
<xmltable spacing="5"/>
</xsl:template>
 
D

David Carlisle

an xslt stylesheet has to be well formed XML.

<table border="0" cellpadding="2" cellspacing="{
/xmltable[@spacing][text()]}" bgcolor="lightblue" width="50%">

google for "attribute value template" for the {} syntax

david
 
B

bjam

Thanks for this david, your the best, this helps a lot. I also found
another way to do it using xsl:attribute which also works and seems
very clean.
 

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

Forum statistics

Threads
473,999
Messages
2,570,246
Members
46,840
Latest member
BrendanG78

Latest Threads

Top