Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Hard coding a value to an XSLT file

Hard coding a value to an XSLT file

Hard coding a value to an XSLT file


I have an XSLT file that used to style a report in Excel format. I'd like to hard code some values in the XSLT file. These values will be a few lines of disclaimers since the file will soon be used by external clients.

Here's a table being added that displays at the top of the Excel file:

<xsl:template name="CreateWorkSheet">
<xsl:param name="PortfolioCode" />
<xsl:element name="Worksheet">
<xsl:attribute name="ss:Name">
<xsl:value-of select="$PortfolioCode"/>
<xsl:variable name="LiqHorizonCol">
<xsl:call-template name="CalcLiqHorizonColCount">
<xsl:with-param name="PortfolioCode" select="$PortfolioCode" />
<!-- Common Data -->
<Table x:FullColumns="1" x:FullRows="1">

After the table opens, it writes some basic info about the report and specify the rows/cells in the Excel file:

<Row ss:Index="1">
<Data ss:Type="String">Portfolio Name:</Data>
<Data ss:Type="String">
<xsl:value-of select="ivy:PortfolioName"/>

I think the opening tab tells it Row 1 since it appears in the first row.

I tried adding some tags specifying a much lower row but it didn't work. It pushed everything down. My guess is that I need to build a new table at the end of the XSLT file. Anyone know if that's correct or if there's a better way to get my hard coded disclaimers in the Excel file?


RE: Hard coding a value to an XSLT file

Hi Mark,

I usually start this kind of project by creating a spreadsheet, saving it, and then reverse engineering the resulting XML into XSLT.

Excel can be quite picky about things. In the case of ssLIndex, in my experience you definitely have to have increasing values and no overlap.

The bits you have shown don't give enough context to allow much help...

Tom Morrison
Hill Country Software

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close